How to Reinstall and Update Grub 2 with a Ubuntu Live CD

I had Windows 7 + Ubuntu 12.04 (Precise Pangolin) installed on my PC. But I needed to develop applications to Windows Phone 8. Since the SDK for Windows Phone 8 only works perfectly under Windows 8, I had to upgrade my Windows 7 installation to Windows 8. After the upgrade, and when I reboot my PC, I noticed that the GRUB won’t appear any more. The reason is Grub 2 gets overridden when you install Windows or another Operating System. But It can be fixed. In order to make Ubuntu control the boot process back again, you just need Reinstall (Repair/Restore) Grub using a Ubuntu Live CD. This is how it should be done :

1. Mount the partition you Ubuntu Installation is on. Replace the XY with the drive letter, and partition number. Example: sudo mount /dev/sda2 /mnt

** Note : To find the Partition with Ubuntu, launch GParted and find out. It is Usually a EXT4 Partition. In my case it’s /dev/sda2


2. Then bind the directories, using terminal commands shown below:

3. Jump into that using chroot.

4. Now install grub. ** you only need to add the partition letter (usually a) to replace X. Example: grub-install /dev/sda

5. Now check your grub installation. ** you only need to add the partition letter (usually a) to replace X.

6. Now Update grub.

7. Now you can exit you mounted hard disk (exit chroot).

GRUB install on Ubuntu

8. Now UN-mount your mounted directories

9. Now re-start your computer, and you will be able to see the default Grub2 screen.

10. That’s it :). Hope this post helped someone.