Fixing Linux Problems with Chroot

If you want to reset password or fix some booting issue, you may need to boot the server in rescue, then mount old live disks and chroot it. Once it is done, you will be able to run commands like passwd to change password or install any missing software with apt/dnf/yum etc.

To chroot a file system, run

In above example /dev/sdc1 was / partiition. /dev/sdc2 was /boot.