Rescue mode is the most useful button on Cloud when something has gone wrong. It restarts your VM into a small Debian system that runs entirely in memory, leaving your own system switched off with its disks untouched. From there you can repair it, reset a password, or copy your data off.
Use it when:
- your VM won't boot, or stops on an error during startup;
- you've lost your key or password, or locked yourself out;
- a bad update,
fstabline or firewall change has broken things; - you want to get your files off a system that won't start.
What you need
- The Boot tab. You'll need the Use rescue mode permission if the project isn't yours. If the tab isn't there at all, it may not be available on your VM.
- At least 2 GB of memory on the VM, because rescue runs in RAM.
- A VM that isn't busy. Rescue can't start during a backup or restore, including the overnight backups. If it's refused for that reason, try again shortly.
Start it
- Open your VM and go to the Boot tab.
- If you'll need more than one restart, tick Keep booting into rescue until I turn it off. Otherwise, leave it, and rescue lasts for one boot.
- Press Start rescue and confirm. The VM restarts straight away, and anything running on it stops.
- It usually takes under a minute. The tab updates when it's ready.
If rescue never gets as far as starting, it gives up after 60 minutes and goes back to booting normally.
Log in
You have two ways in. The console is simplest, and SSH is nicer to work in.
The console
Open the Console tab and press Connect. You're logged in as root, with no password. It works even if your SSH port or firewall is the very thing that's broken.
SSH with PuTTY
Rescue listens on the VM's usual SSH port, so use the same public address and port as always, with the username root. The SSH line on the Boot tab shows the VM's private address, which won't work from outside.
| PuTTY setting | Use |
|---|---|
| Host Name | Your VM's public address, from the Ports tab |
| Port | Your VM's usual SSH port |
| Auto-login username | root |
| Private key | Your usual .ppk, or press Show password on the Boot tab and use that |
These work because rescue is given the VM's own keys and the keys on your account. The password is made fresh for each rescue session.
PuTTY will warn you that the host key has changed. That's expected, since rescue isn't your usual system and makes a new key every time. Check the fingerprint matches Rescue's SSH host key on the Boot tab, then press Connect Once. Don't press Accept, or PuTTY will warn you again when you return to your own system.
Your VM's firewall rules still apply in rescue. If they block port 22, use the console, or fix them first.
The tools
Type mship-help at any time to see this list.
| Command | What it does |
|---|---|
mship-disks |
Shows the disks, and which one holds your system |
mship-chroot |
Mounts your system and opens a shell inside it. mship-chroot <command> runs one command |
mship-unmount |
Unmounts your system again |
mship-fsck |
Checks filesystems without changing them |
mship-fsck --repair |
Fixes them |
mship-password [user] |
Sets a password on your system, for root if you don't name a user |
mship-grub |
Reinstalls the bootloader |
mship-cloudinit |
Clears cloud-init's state, so it runs again at the next boot |
install |
Installs a new OS, erasing the disk. See reinstalling |
Start with mship-disks to check it can see your system. Looking doesn't write to your disks, so it's safe at any stage. Nothing on your disks changes until you change it.
For step-by-step fixes, see common repairs in rescue mode.
Rescue also includes nano, vim, tmux, rsync, curl, wget, parted, and tools for LVM, RAID and NTFS. It has internet access too.
Finish up
- Leave any shell inside your system with
exit, then runmship-unmount. - Press Exit rescue and boot from disk on the Boot tab. Rescue stops straight away, so do step 1 first.
- Check that your VM has started properly.
If you started it for one boot, a restart from inside rescue also goes back to your own disk. If you chose to keep it, the VM goes on booting into rescue until you press Exit.
Anything stored in rescue itself disappears when it stops, because it's all in memory. Only what you've written to your VM's disks is kept.
Things to know
- Rescue is powerful. It can read and change everything on your disks. While it's running, anyone in your project who can open the console is logged in as root, so be careful who has that permission.
- Windows VMs. Rescue can still reach their disks, as it has NTFS tools, but the
mship-tools are written for Linux. - Encrypted disks. They aren't found automatically, though
cryptsetupis there to open them by hand.