Topic: How to chroot into #! on disk when you can not boot via grub
How to chroot from live session to #! on disk
Assumption: #! is installed on /dev/sda1 but is not accessible via grub
Goal: reinstall grub in mbr of /dev/sda:
Here goes:
boot from livecd or usb
in terminal window:
TARGET=/media/sda1
sudo mkdir -p $TARGET
sudo mount /dev/sda1 $TARGET
sudo mount --bind /dev $TARGET/dev
sudo mount --bind /dev/pts $TARGET/dev/pts
sudo mount --bind /proc $TARGET/proc
sudo mount --bind /sys $TARGET/sys
sudo chroot $TARGET /bin/bashThis places you in a root terminal on the #! system
Do whatever you want to do there, e.g. re-install grub
grub-install /dev/sda
update-grubTo exit from chroot:
control-DThis brings you back to where you were in the live session and you can unmount
sudo umount -l $TARGET/dev/pts
sudo umount -l $TARGET/dev
sudo umount -l $TARGET/proc
sudo umount -l $TARGET/sysThats it...
Reboot into the #! system on disk.
Edit1: Replaced '/usr/bin/bash' by '/bin/bash'
Edit2: Start with defining TARGET, and reference it in all subsequent lines.
Last edited by xaos52 (2012-03-26 16:30:46)