Wednesday, October 6, 2010

Quick Tip: Removing GRUB loader and restore Windows (Vista/7) loader

If you have repartitioned your Vista/7 hard drive to make space for Ubuntu (or some other Linux flavor) , you may find that (should you decide to remove Linux because you find that it doesn’t suit you, or that company policies prevent you from installing it in their hardware *ahem*) while it’s easy to recover the space for Windows using Disk Management, the GRUB boot loader won’t go away that easily.

What happens is that you are stuck with a boot-time menu that lists a long list of “phantom” options (if you already deleted Linux’s partitions) besides your Windows option (which, if you are as lazy as I am, is NOT the default, so you have to manually select it every time you boot the system). Not very nice.

The official “clean” way to remove it involves your original (or any copy of the) media of your windows installation. What you have to do is boot your system from that media, and select the “Repair Windows” option (yes, there actually is an option for that in Vista/7 installation media and yes, it’s quite handy).

Once in the “Repair Windows” menu you then have to select the “Command Prompt” option (DOS FTW!) , change to your hard drive letter (by typing c: <return>), and run the following commands (one at a time):

bootrec.exe /FixBoot
bootrec.exe /FixMbr

These commands won’t take more than a couple of seconds each and, essentially, what they do is write a new boot sector and a new master boot record into your hard drive.

Once you have done that, reboot the machine (it will boot straight into windows) and delete the Linux partition(s) using Disk Management (if you haven’t already done so). After that, expand your Windows partition to recover the used space into it.

Last Year's Popular Posts