Reinstall GRUB from linux live CD

If you have installed Windows after Linux, or borked GRUB somehow, and are unable to load your Linux installation, then this article may be helpful.

You'll need a Linux live cd. I'll be using ubuntu for this example.

First, boot from your Ubuntu CD, and choose the option of trying Ubuntu without installation.

Once Ubuntu has loaded the desktop, we're ready to begin. You'll need a terminal. Press Alt + F2 and type gnome-terminal and then press enter. I suppose you could find a terminal in the menu. But Ubuntu's menus tend to change. A lot. So just do it like that.

With a terminal open, we must now determine where GRUB is to be installed. We need to find out what drives are available, and what their labels are.

Issue the following command on the terminal
sudo fdisk -l
This will show you the list of partitions you have in your system.

After you get to know the partition where Linux was installed, issue the following commands. Replace /dev/sda1 with your actual system partition. If you don't know which one it is, and don't know how to identify it, stop, and ask for help. Otherwise, you run the risk of making things even worse.

sudo mount /dev/sda1 /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo chroot /mnt
grub-install /dev/sda
If any errors are found after entering the previous line, then try this one:
grub-install --recheck /dev/sda
That's it.

Now you're ready to reboot, and go back to your previously installed Linux system.

In a perfect world, issuing "exit" from the chrooted environment would unmount all the filesystems, but that's not really certain, so just to be on the safe side, issue the following commands.
exit
sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt
and then reboot:
sudo shutdown -r now