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!

Post to Twitter Post to Plurk Post to Yahoo Buzz Post to Delicious Post to Digg Post to Facebook Post to MySpace Post to Ping.fm Post to Reddit Post to StumbleUpon

Related Posts:

Tagged with:  

4 Responses to “How to restore/recover Grub 2 in ubuntu 10.10 Maverick Meerkat after reinstalling Windows XP/Vista/Win7”

  1. [...] 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 [...]

  2. szs says:

    Thank you, it was useful. It helped me.

  3. [...] 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 [...]

Leave a Reply

*

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...