After reinstalling Windows in a dual boot system with both Windows and Ubuntu Linux, you will need to restore grub because mbr has been rewritten. Follow the below steps to restore your grub 2.
Boot using a ubuntu livecd of 9.10 or higher.
Become root
sudo su -
Find your partitions. Type the command shown below and identify the ubuntu partitions.
fdisk -l
Lets assume that u have your / partition in sda5 ( if u do have a separate /boot and /var partition then lets assume it to be sda6 and sda7).
Now mount the partitions.
mount /dev/sda5 /mnt
if you do have a separate /boot partition then mount that also.
mount /dev/sda6 /mnt/boot #skip this one if you donot have a separate /boot partition
if you do have a separate /var partition then mount that also.
mount /dev/sda7 /mnt/var #skip this one if you donot have a separate /var partition
Now mount the rest as shown below
mount –bind /proc /mnt/proc
mount –bind /dev /mnt/dev
mount –bind /sys /mnt/sys
Now chroot, then update and install grub 2.
chroot /mnt
update-grub2
grub-install /dev/sda
If there is any error, try grub-install –recheck /dev/sda
Exit chroot.
exit # or press Ctrl+D
Unmount everything and reboot your system.
umount /mnt/sys
umount /mnt/dev
umount /mnt/proc
reboot
Enjoy!










[...] This post was mentioned on Twitter by grompol, Dipin Krishna. Dipin Krishna said: New post: How to restore/recover Grub 2 in ubuntu 10.10 Maverick Meerkat after reinstalling Windows XP/V… http://aroundtheweb.info/?p=1201 [...]
Thank you, it was useful. It helped me.
[...] time, fortunately, it went reasonably smoothly: download the live CD and boot with it, follow the usual magic incantations to chroot into your Ubuntu installation, and do dpkg-reconfigure grub-pc in order to generate a [...]
[...] PS : J'ai récupéré cette procédure ici : http://aroundtheweb.info/2010/10/restorerecover-grub-2-ubuntu-10-10-maverick-meerkat-reinstalling-wi... [...]