Posts Tagged ‘windows’

Fix Windows 7 MBR after GRUB

Tuesday, August 24th, 2010

During a Linux install to my 2nd hard drive, GRUB was automatically installed to the wrong MBR (master boot record). The files were on the /boot of the Linux drive, but the Windows’ drive’s MBR was used. This meant without both drives, I could not boot either operating system.

So I installed GRUB manually with grub-install /dev/sdb. Now I needed to restore the original Windows 7 MBR so that it didn’t require GRUB to boot it.

The Windows 7 “startup repair” from the installation disc detected the OS but didn’t find any boot problems with it, so I went to the command prompt on the disc.

There are several commands for this. A lot of web pages suggest using “bootsect”. However, this did not fix anything. The fact that it was for use on individual partitions was probably a clue on that. Some web pages even used “bootcfg” which is for older Windows installs such as XP (it affects your boot.ini), but is still included on the Windows 7 disc to add to the confusion.

The command that did work was:

bootrec /fixmbr

Afterwards, for good measure, I also ran:

bootrec /fixboot