Restore a Windows7 Master Boot Record

A friend of mine recently asked me to install Linux on her laptop which I was happy to do. I installed Xubuntu alongside Windows7 as dual boot. After a few days of use, she complained that the Ordnance Survey “Getamap” webpage would not work. When I investigated, I found out that the website requires Silverlight to be installed in order to work.

When vieweing the OS website in Firefox or Chromium on Xubuntu, it asked to install Silverlight then set about installing Moonlight (the Linux alternative since Silverlight only seems to work on Windows). Sadly, Moonlight does not support the while Silverlight API therefore the website would still not work properly.

My friend decided that she had to revert to using Windows 🙁
I therefore had to figure out how to remove Grub from the master boot record on the disk and replace the original Windows7 boot record. The machine was shipped without and CD or DVD media therefore where to start?

Lots of Googling later, I found a technique that worked:

  1. While booting Windows, I repeatedly press F8 – this caused Windows to offer a menu where I could choose a recovery tool. I chose “Command Prompt”.
  2. CD to each drive letter until the one is found which has the Windows7 recovery tools on it (“C:” in my case)
  3. Type “bootsect /nt60 SYS /mbr” and press enter. This command finds the active partition with the system files and restores your master boot record to Windows7.
  4. Type “exit” to leave the command line and then reboot.
    Despite being a bit nerve racking, it worked perfectly and Windows immediately booted.

The final thing left to do was to remove the ext4 partition and the swap partition that Linux had installed. Fortunately Windows7 includes a disk partition tool that worked well. Having deleted the two partitions, I selected the original Windows partition and asked it to expand to fill the empty space.

It worked – all sorted 🙂

Leave a comment

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