Ubuntu – Removing Grub and MBR


I installed Ububtu 12.04LTS as dual boot along with my Windows 7. I need to remove Grub and restore Windows MBR but without uninstalling Ubuntu

Best Answer

To install a Windows bootloader, boot Windows and create a Repair CD. Boot from the repair CD (or from your original Windows DVD) to a repair prompt and run:

bootrec /fixmbr

(If you use Windows XP then the command is: fixmbr)

If you can't boot Windows and can't create a repair CD, you can install something like lilo which works identically to the Windows boot loader when used as shown below. Boot from an Ubuntu CD/USB and select "Try Ubuntu", connect to the internet and drop to a terminal (Ctrl+Alt+T):

sudo apt-get update
sudo apt-get install lilo
sudo lilo -M /dev/sda mbr

Note, when you install lilo it will popup a big warning. You can ignore this (as it's not relevant when installing a Windows-style bootloader) - Tab to OK and hit enter. Also, if you don't boot from /dev/sda change as appropriate.

If you're planning to continue to boot Ubuntu after replacing the Windows bootloader you can use easyBCD. Otherwise you'll need to boot a live CD/USB to reinstall Grub later.

Related Question