Using a chroot Environment

A chroot (change root) environment lets you temporarily switch the root directory of your current session — allowing you to enter your main operating system from within the rescue system and run commands as if it had booted normally.

Prerequisite: Your server must be booted into the Linux Rescue System and you must be connected via SSH. → Starting rescue mode

Step 1: Mount the System Partitions

The commands differ depending on whether your server uses software RAID or not.

Non-RAID Server

Use lsblk to identify your root and boot partitions, then mount them:

Terminal
lsblk mount /dev/sda3 /mnt mount /dev/sda1 /mnt/boot

If there is no separate boot partition, the second line can be omitted. Adjust the device names to match your lsblk output.

RAID Server

Assemble the RAID arrays first, then mount the root and boot partitions:

Terminal
mdadm --assemble --scan mount /dev/md2 /mnt mount /dev/md1 /mnt/boot

/dev/md2 and /dev/md1 are examples — use lsblk to identify your actual RAID devices.

Step 2: Bind-Mount System Directories

Make the rescue system's core directories available inside the mounted filesystem so chroot works correctly.

Bind-mount the essential system directories:

Terminal
for i in /dev /dev/pts /proc /sys /run; do mount -B $i /mnt$i; done

Step 3: Enter the chroot Environment

Switch into your main operating system's filesystem.

Run the chroot command to switch into your server's filesystem:

Terminal
chroot /mnt

Your prompt will change — from this point on, all commands you run (such as passwd, grub-install, or update-grub) will act directly on your server's actual operating system.

Step 4: Exit the chroot Environment

Once your maintenance tasks are complete, exit cleanly before rebooting.

Type exit to leave the chroot environment and return to the rescue prompt:

Terminal
exit

Then log out of your SSH session and cancel rescue mode via the PowerPanel. → Cancelling rescue mode

Further Documentation

For more information on the chroot command, refer to the official Linux man page.