Reinstall Grub2 after installing Windows

This note relates to:

  • grub2 version 1.98
  • Ubuntu 10.04
  • Windows 7

Reference: Ubuntu Guide

If you install (or re-install) Windows after you have been using Linux for a while, you might find out that the disk’s MBR (Master Boot Record) has been overwritten to point directly to Windows. This notes explains how to set up the MBR to point to the original grub.

Here are the general steps:

  1. Boot from Ubuntu Live CD
  2. Figure out which partition holds your GRUB boot
  3. Recover MBR
  4. Add new version of Windows to GRUB

Following are the steps in details.

Find your Ubuntu 10.04 Live CD and Boot from it

Self-explanatory. In theory, any live CD that uses Grub 2 should work.

Figure out boot partition

Using a partition editor, you can review the available partitions and remind yourself the name of the partition where the boot is located. On the Ubuntu Live CD, “gparted” is the command. It is available under the System > Administration menu.

You can add “gparted” in a Debian-based system with the following command:

Restore Master Boot Record (MBR)

Run the following commands, substituting with the correct partition names:

After this, remove Live CD, close tray and reboot. The original grub2 should load.

Add Windows to Grub2

Re-running the “update grub” should allow grub2 to discover Windows:

That should do it. Good luck.

One Reply to “Reinstall Grub2 after installing Windows”

Leave a Reply

Your email address will not be published. Required fields are marked *