After reinstalling Windows in a dual boot machine, the GRUB boot manager usually stops working. To restore it, use the following procedure:

1. Boot from a Linux Live CD

2. Execute grub in a terminal (as root):

# grub

3. Determine the location of the grub files:

grub> find /boot/grub/stage1
(hd0,1)

4. Set GRUB’s root device (use the output of the previous command):

grub> root (hd0,1)

5. Restore GRUB (specify only the device, not the partition):

grub> setup (hd0)

6. Exit GRUB:

grub> quit

7. Reboot


If the above doesn’t work (happens in recently Ubuntu Live CDs), try the following:

1. Boot from a new Ubuntu Linux Live CD (10.04+)

2. Mount in /mnt the partition where Linux had been installed (assume it’s /dev/sda5):

# sudo mount /dev/sda5 /mnt

3. Execute the following:

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