This document describes how to use the rescue mode in the CVM console. If the server GRUB bootloader files, key system files, or .lib dynamic library files are corrupted or missing when you use the CVM operating system, the operating system may be unable to enter the single user mode and be repaired. In this case, you need to use the CVM rescue mode to repair the system.
Entering rescue mode
Before you enter the rescue mode, we strongly recommend you back up the instance to avoid the impact of maloperations. You can create snapshots to back up cloud disks and create custom images to back up local system disks.
- Log in to the CVM console.
- On the instance management page, proceed according to the used view mode:
Select More > OPS and Check > Enter Rescue Mode on the right of the row of the target instance as shown below:
Click the tab of the target instance and select More Actions > OPS and Check > Enter Rescue Mode in the top-right corner as shown below:
- In the Enter Rescue Mode pop-up window, set the instance login password for the rescue mode as shown below:
- Currently, the rescue mode supports only Linux instances but not Windows instances. If you enter the rescue mode in a Windows instance, you will enter the Linux rescue mode (on CentOS 7.5 64-bit) by default.
- The instance username is
root by default in the rescue mode.
- You can enter the rescue mode only when the instance is shut down. Forced shutdown may cause data loss or file system corruption. We recommend you shut down the instance as instructed in Shutting Down Instance before entering the rescue mode.
- Click Enter Rescue Mode.
At this point, you can see that the instance is entering the rescue mode. If the instance status is as shown below, the instance has entered the rescue mode successfully. Proceed to the next step to repair the instance as soon as possible.
Using rescue mode to repair system
- Use the
root account and the password set in step 3 to log in to the instance as follows:
- After successful login, run the following commands in sequence to mount the root system disk partition:
In rescue mode, the device name of the instance system disk is
vda, and its root partition is
vda1, which is unmounted by default.
mkdir -p /mnt/vm1
mount /dev/vda1 /mnt/vm1
After successful mounting, you can manipulate the data in the root partition. You can also use the
mount -o bind command to mount some sub-directories in the original file system and use the
chroot command to run commands in the specified root directory. Below are the specific commands:
mount -o bind /dev /mnt/vm1/dev
mount -o bind /dev/pts /mnt/vm1/dev/pts
mount -o bind /proc /mnt/vm1/proc
mount -o bind /run /mnt/vm1/run
mount -o bind /sys /mnt/vm1/sys
chroot /mnt/vm1 /bin/bash
Exiting rescue mode
- After repairing the instance, exit the rescue mode in the following steps according to the used view mode:
Select More > OPS and Check > Exit Rescue Mode on the right of the row of the target instance as shown below:
Click the tab of the target instance and select More Actions > OPS and Check > Exit Rescue Mode in the top-right corner as shown below:
- After the instance exits the rescue mode, it is still shut down. Start it up as instructed in Starting Up Instances to resume instance operations.