2014 edit: Warning unsure how accurate

Reinstalling from LiveCD

If you cannot boot from GRUB 2 review the section Boot Problems and Rescue Mode. If a reinstall becomes necessary follow these instructions. Two methods are presented; both require booting from a LiveCD (Ubuntu 9.10, Karmic Koala or later version). If the first method does not work, follow the second method, which is more complex and contains more options and instructions.

SIMPLEST - Copy GRUB 2 Files from the LiveCD

This is a quick and simple method of restoring a broken system’s GRUB 2 files. The terminal is used for entering commands and the user must know the device name/partition of the installed system (sda1, sdb5, etc). The problem partition is located and mounted from the LiveCD. The files are then copied from the LiveCD libraries to the proper locations and MBR. It requires the least steps and fewer command line entries than the following methods. If for example Windows is on sda1 and Ubuntu is on sda5, and Windows has overwritten the MBR, then the target for grub installation will be /dev/sda5, and the MBR in the boot sector of sda will be re written for grub.

1: Boot to the LiveCD Desktop (Ubuntu 9.10 or later).
2: Open a terminal by selecting Applications, Accessories, Terminal from the menu bar. Determine the partition with the Ubuntu installation. The fdisk option “-l” is a lowercase “L”.

sudo fdisk -l

If the user isn’t sure of the partition, look for one of the appropriate size or formatting. Running: <pre>sudo blkid</pre> may provide more information to help locate the proper partition, especially if the partitions are labeled.

The device/drive is designated by sdX, with X being the device designation. sda is the first device, sdb is the second, etc. For most users the MBR will be installed to sda, the first drive on their system. The partition is designated by the Y. The first partition is 1, the second is 2. Note the devices and partitions are counted differently.</li>

3: Mount the partition containing the Ubuntu installation.

sudo mount /dev/sdXY /mnt

Example: sudo mount /dev/sda1 /mnt

Note: If the user has a separate /boot partition, this must be mounted to /mnt/boot Note: If the user has a separate /home partition, this must be mounted to /mnt/home. Encrypted home partitions should work.

4: Run the grub-install command as described below. This will reinstall the GRUB 2 files on the mounted partition to the proper location and to the MBR of the designated device.

sudo grub-install --root-directory=/mnt /dev/sdX

Example: sudo grub-install –root-directory=/mnt /dev/sda

5: Reboot

Refresh the GRUB 2 menu with

sudo update-grub

From: https://help.ubuntu.com/community/Grub2#Reinstalling%20from%20LiveCD