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.

Once you chroot, you can change root password on the server with the command

If you use LVM for root partition, do

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *