If for some reason your grub has gotten corrupted, here are the steps to restore it.
Boot into a rescue CD (either Ubuntu or System Rescue CD, which you can download freely).
Mount the drive, where sdXY is the partition (eg: /dev/sda1)
sudo mount /dev/sdXY /mnt
Map all of system partitions (/dev, sys and proc):
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
Then "chroot" to the new directory:
sudo chroot /mnt
Note: if you are using System Rescue CD, you may get this error:
chroot: failed to run command `/bin/zsh` : No such file or directory
In that case you have to specify the shell:
chroot /mnt /bin/bash
Once chrooted, run the following to install grub (where sdX is your drive where grub will be installed. You have to use the drive, not a partition. ie: /dev/sda, not /dev/sda1)
Finally, unmount everything:
sudo umount /mnt/sys
sudo umount /mnt/proc
sudo umount /mnt/dev
sudo umount /mnt
ALT is a specialized IT consulting and IT support company. If you need Linux-related support, feel free to contact us and one of our consultants will be happy to help.