Grub2 recovery with chroot environment
It may happen that grub breaks during an update and the system can not start anymore.
Here you can start the Kanotix-live-cd and repair grub with the Acritox-Installer.
But there is another alternative. You may try to repair grub with a chroot.
#### IMPORTANT! ####
The architecture of the live-system should to be the same as the architecture of your hd installed system! To rescue a 32-bit system a 32-bit live-system is recommended, 64 bit would work too (just update-grub in chroot detects Kanotix64
then), to rescue a 64-bit-system you need a 64 bit live system.
--> All commands are executed as root
* Boot with the Kanotix Live-CD.
* Open a terminal and execute the following commands. By typing
you will find out on which partition the system is installed and where grub needs repair.
From now on i will write /dev/sdXY , you have to replace sdXY with the right term of your partition.
* The filesystem will be mounted on /mnt
* Now the important devices of the filesystem /dev /proc /sys have to be mounted.
for x in proc sys dev; do mount --bind /$x /mnt/$x; done
* Changing into the installes system now:
* If needed Grub2
config files could be changed now like edit the /etc/default/grub for other vga modes or add custom scripts to /etc/grub.d for extra boot entries. The /boot/grub/device.map file can be optimized to match the correct boot device - the one that is select in the bios to boot from should be (hd0). You usally only need change this if you do not boot from /dev/sda. After that run
* Now grub can be written in the MBR using this command
* When errors appear, then try to run
grub-install --recheck /dev/sda
This rewrites the /boot/grub/devices.map with default values - which by default lists all available hds in default order. It does not
write the grub.cfg - this is done by update-grub.
* The chroot is left by the command
and /dev and the root filesystem will be unmounted by executing the following command
for x in proc sys dev; do umount /mnt/$x; done
* Reboot and your system should start again.