How to restore the Windows MBR after removing Linux

I’ve been dual booting Windows 7 and Ubuntu Linux on my desktop PC for a while. Today I decided to delete Ubuntu to free up space for Windows as I’ll be dedicating more time to ASP.NET development.

So, I downloaded a free partition manager and deleted the LInux partitions from my HD and resized my Windows partition to fill the hard drive. When I restarted I was presented with an “error: unknown filesystem” or some such message and the “grub rescue” prompt. From experience I knew immediately it was MBR related. Unfortunately, I always forget what to do.

I did some research and eventually found the solution. Here’s how you fix the issue.

  1. Find your Windows installation disc and insert it into your optical drive.
  2. Restart your PC and boot from the installation disc. This will start the Windows installation interface.
  3. Select the region, language and keyboard type.
  4. Click “Repair my computer”, then select your Windows installation.
  5. Select “Command prompt”.
  6. Enter the following commands at the prompt:
    bootrec.exe /FixBoot
    bootrec.exe /FixMbr
  7. Restart.
  8. Done.