How to chroot from live session to #! on disk
Assumption 1: #! is installed on /dev/sda1 but is not accessible via grub
Assumption 2: /dev/sda1 is the root partition, and you do not have a separate boot partition
Goal: reinstall grub in mbr of /dev/sda:
Boot from livecd or usb, then in the terminal window enter:
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/bash
This 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-grub
To exit from chroot:
press control-D or enter exit
This 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/sys
Thats it…
Reboot into the #! system on disk.