This guide explains how to mount the root disk, edit system files, or change the root password when using Rescue Mode on an OVH Public Cloud instance.
🔐 When to Use Rescue Mode
Rescue mode is useful when:
- You’ve lost access to the server (SSH key or password issues).
- A misconfiguration prevents the system from booting correctly.
- You need to repair, back up, or recover system files.
🛠️ Step-by-Step Instructions
1. Reboot into Rescue Mode
- Log in to the OVH Control Panel.
- Go to your Public Cloud Instance.
- Click the ⋮ menu (three dots) at the top right.
- Select “Reboot in rescue mode”.
- Choose the “rescue-pro” image.
- You’ll be provided with a temporary root password in the console. If you’ve added an SSH key previously, you’ll be logged in automatically via key-based authentication.
2. Access the Instance in Rescue Mode
Login via SSH:
ssh [email protected]
If no SSH key is installed, use the root password provided in the console.
3. Check Mounted Filesystems
Run:
df -h
Example output:
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 2.4G 1.5G 784M 66% /
...
/dev/sda1
is the temporary rescue system — not your main system disk.
4. Identify Your Attached System Disk
Run:
lsblk
Example:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 2.5G 0 disk
└─sda1 8:1 0 2.5G 0 part /
sdb 8:16 0 40G 0 disk
└─sdb1 8:17 0 40G 0 part
Here, /dev/sdb1
is the root partition of your actual system disk.
5. Mount the System Disk
mount /dev/sdb1 /mnt
Confirm it’s mounted:
df -h
You should see:
/dev/sdb1 40G 7.0G 31G 19% /mnt
6. Access System Files
Switch to the mounted disk:
cd /mnt
Check contents:
ls
You’ll see the standard root directory structure:
bin boot dev etc home lib media mnt opt proc root sbin tmp usr var
🔑 Example: View Authorized SSH Keys
cat /mnt/root/.ssh/authorized_keys
You can add your new key here if you’re locked out.
🔒 Change the Root Password
- Chroot into the mounted system:
chroot /mnt
- Change the root password:
passwd
Enter and confirm the new password.
- Exit chroot:
exit
🔁 Reboot Normally
Once you’ve finished your tasks:
- Go back to the OVH Control Panel.
- Click the menu and select “Exit rescue mode”.
- The instance will reboot normally using the updated configuration or password.
🖥️ Using OpenStack CLI (Optional)
If you prefer using OpenStack CLI tools:
- Enter rescue mode:
nova rescue INSTANCE_ID
- Exit rescue mode:
nova unrescue INSTANCE_ID
✅ Summary
Task | Command/Action |
---|---|
Identify disks | lsblk |
Mount real system disk | mount /dev/sdb1 /mnt |
View root filesystem | ls /mnt/root/ |
Change root password | chroot /mnt && passwd |
Restore normal boot | Exit rescue mode via OVH panel |