chroot

milomak

Honorary Master
Joined
May 23, 2007
Messages
12,571
absolutely great tool.

i often do things i know i shouldn't do. often causing an inability to boot into a system. but often a quick
Code:
# mount /dev/<partition> /mnt/disk
# mount -t proc none /mnt/disk/proc
# mount -t sysfs /sys /mnt/disk/sys
# mount -o bind /dev /mnt/disk/dev
# cp -L /etc/resolv.conf /mnt/disk/etc
# chroot /mnt/disk /bin/bash

gets me access to the affected system and I can work at getting it working again. I reckon more than 90% of the time the above has helped me rescue a non-booting system.

As you may have guessed. Today was such a day.

edit: added the sysfs mounting
 
Last edited:

adrianx

Expert Member
Joined
Jun 30, 2008
Messages
3,761
chroot saved me from having to reinstall after my /boot partition was wiped out by some "unknown force". :)

I know that there are many more uses for it (e.g. sandbox, testing & development....) and I really want to play around with it some more.
 
Last edited:
Top