Rescue Mode

This page details how to activate and use the rescue mode on a GandiCloud VPS.

What is the rescue mode and what it can be used for?

The rescue mode allows you to recover from kernel mismatches or to perform repairs on corrupted file systems.

Note

Rescue mode will boot the server on a dedicated image and attach the disks from the failed instance as additional volume. The usual boot disk of the instance in rescue mode will be attached as secondary.

In order to access the data of your disks, you will need to mount them.

Activate the rescue mode

  • from your Gandi dashboard

The simple way to activate the rescue mode is to do it from your Gandi user interface. From your Gandicloud VPS overview page (VPS menu), select “activate the rescue mode”. Your server will restart; this operation can take up to two minutes.

  • with the OpenStack CLI

openstack server rescue --image "Rescue (Debian)" <server_name>

Access a server in rescue mode

You have two possibilities to access a server in rescue mode :

  • via SSH

You can only authenticate with your key and the ‘admin’ user (debian or ubuntu). Please notice that the OS changed, so the server fingerprint has too. You can remove the old one :

ssh-keygen -f "/home/user/.ssh/known_hosts" -R "X.X.X.X"
  • With the emergency console

Contrary to normal mode, in rescue mode the emergency console will not ask you a password to connect to your server. You can simply activate it and access to your server with the emergency console.

Access to your system disk

Once logged into the rescue system, you have to mount the original disk to access its file system :

List the attached devices :

$ sudo blkid
/dev/xvda1: UUID="9a03b9ab-ac87-455e-bd8d-83318a953647" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="646894e2-74bb-ca4e-bc80-6a1038ae6eec"
/dev/xvda15: SEC_TYPE="msdos" UUID="BDF8-5F5C" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="6d60f7e5-77cc-8940-9c5f-829e8ae84f7d"
/dev/xvdb1: UUID="4206ff7c-539c-4df8-8e05-4125edd44a99" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="3e928bbf-01"
/dev/xvda14: PARTUUID="fe531fb9-2529-5345-be1b-96e9419bf002"

xvda is the rescue system disk, you’re interested by xvdb you can create a folder and mount the device :

$ mkdir disk
$ sudo mount /dev/xvdb1 disk/
$ ls disk
bin   dev  home        initrd.img.old  lib32  libx32      media  opt   root  sbin  sys  usr  vmlinuz
boot  etc  initrd.img  lib             lib64  lost+found  mnt    proc  run   srv   tmp  var  vmlinuz.old

Deactivate the rescue mode

From your Gandi dashboard, on your VPS configuration page, just select deactivate. It will restart your server in normal mode.