How to perform CHROOT without any issues
At the very beginning, we need to start the computer with a prepared some live linux distro.
To perform chroot from LiveCD to our (damaged) system, execute the following commands:
mount -t ext4 /dev/sdXn /media/our_system
mount -t proc proc /media/our_system/proc
mount -t sysfs sys /media/our_system/sys
mount -o bind /dev /media/our_system/dev
mount --bind /run /media/our_system/ru
If a separate partition is allocated for /boot, it should also be mounted with the following command:
mount /dev/sdXm /media/our_system/boot
Finally, we can switch to our “broken” system using the chroot command:
chroot /media/out_system
If the command executed without any errors, we will notice a changed command prompt.
That’s it. Now you can enjoy the opportunity to fix your “broken” system ;)
Assuming: /dev/sdXn - partition with our system (/) /dev/sdXm - partition for the dedicated /boot