How to uninstall GRUB
Q. How do I uninstall GRUB? I need to uninstall everything before sending this hard disk to someone including GRUB. All I need to keep is windows XP.
A. GNU GRUB ("GRUB" for short) is a boot loader package from the GNU Project. GRUB is the reference implementation of the Multiboot Specification, which allows a user to have several different operating systems on their computer at once, and to choose which one to run when the computer starts.
You can overwrite MBR with standard dd command. You can also use old good MS-DOS fdisk command to overwrite MBR.
Using MS-DOS/Windows 9x boot disk
In order to remove the GRUB bootloader from a Linux and Windows XP machine, boot with a Windows 9x startup disk or CD and execute the MS-DOS command:
fdisk /mbr
Using Windows XP boot disk
Boot computer using Windows XP (Windows 2000) setup disc / CD / DVD. Next, type the following commands:
# fixmbr
# exit
Using Linux
You can also use dd command from Linux itself (it removes partition table):
# dd if=/dev/null of=/dev/sdX bs=512 count=1
Just remove MBR, without the partition table (see comment below):
# dd if=/dev/null of=/dev/sdX bs=446 count=1
Replace /dev/hdX with your actual device name such as /dev/hda. Use fdisk -l command to find out device name:
# fdisk -lOutput:
Disk /dev/sda: 251.0 GB, 251000193024 bytes 255 heads, 63 sectors/track, 30515 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 30384 243955057+ 83 Linux /dev/sda3 30385 30515 1052257+ 82 Linux swap
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Other Helpful FAQs:
- Disable graphical GRUB splash screen
- Error /dev/hdX does not have any corresponding BIOS drive and Solution
- I2O block arrays trouble - Linux fails to install GRUB at the end of successful installation
- Does Linux grub replace Windows MBR?
- Linux: Grub Boot into single user mode
Discussion on This FAQ
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: boot_loader, dd_command, delete grub, fdisk_mbr, fixit command, gnu_grub, grub_bootloader, ms_dos_command, multiboot, remove grub, windows_xp_boot, windows_xp_boot_disk, xp_boot_disk



December 15th, 2006 at 8:07 pm
The command # dd if=/dev/null of=/dev/sdX bs=512 count=1 is correct, but this will also wipe the partition table(!).
It could use a note that this will get you in troubles if you want to be able to reuse your data.
the alternative to NOT wipe the partition table is with bs=446 (NOT 466)
Have a good one,
December 15th, 2006 at 11:05 pm
Martijn,
You are correct; I have updated the article.
Appreciate your post.
April 21st, 2007 at 3:35 am
Thanks for the help very easy to follow
April 29th, 2007 at 5:10 pm
How do you do it in Vista? I was attempting to install a Linux on an external HD, but apparently the idiotic installer decided GRUB was better off being the only thing to end up the internal drive. This is on a laptop with Vista preinstalled.
June 28th, 2007 at 8:55 pm
For Vista,Try this:
http://www.sysint.no/Nedlasting/MbrFix.htm
August 7th, 2007 at 2:04 am
On Fedora Core 6, I had to use /dev/zero instead of /dev/null. Otherwise, this guide worked great. Thanks.
September 3rd, 2007 at 4:29 am
i suggest you download the latest version of hiren’s boot cd and use one of the mbr tools to install standard boot code - worked for me
September 11th, 2007 at 9:16 pm
Hi!
You can do it under linx:
0. log in as a root
1. install lilo (if you do not have)
2. create a dummy lilo.conf
like this:
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
default=dos
other=/dev/hda1
label=dos
install lilo to MBR
lilo -M /dev/sda -b /dev/shd
and uninstall
lilo -U -M /dev/sda /b /dev/sda
Regards
Gergo
November 23rd, 2007 at 1:03 am
This only works for XP if you have the administrator password. The way to get around the password is to use the registry editor and go to HKEY_LOCAL_MACHINE, SOFTWARE, Microsoft, Windows NT, Setup and then Recovery Console. Once you get to the Recovery Console part you must change the Security Level and Security Command value’s to 1. You can do this by right clicking and the click modify and then change the values to 1. Then you can reboot to the Recovery Console and the CD and then you can do the FIXMBR command which will fix your MBR…
December 28th, 2007 at 9:04 pm
Thanks, great article - removed that pesky GRUB from my drive which decided to boot before my primary one does
February 8th, 2008 at 3:09 am
Hi:
I am trying to get rid of this GRUB and Linux partitions but i have windows vista and i cannot enter to that recovery console with the installation disk. Any suggestion?
February 25th, 2008 at 2:17 pm
Hi, I’m having exactly the same problem in trying to remove GRUB. I have an older dual-boot system (XP Pro SP/2 and Ubuntu) and I’m using one of the slave drives from that old system as a primary drive in a new system that I’m building. I installed the drive into the new system and attempted performing a fresh install using XP Pro to delete old repartitions, create a new one, and reformat the entire drive, without considering that I needed to remove the existing GRUB mbr prior to performing the install. So even though XP Pro will perform the entire install without no errors, I still get a GRUB load error on reboot.
I’ve tried using the recommended XP Pro Recovery Console process of running “FIXBOOT C:” then “FIXMBR” and then “BOOTCFG /rebuild” as well as various other alternatives and nothing works - not even deleting the partition and reformatting!
Help!
May 5th, 2008 at 6:55 am
You need to use /dev/zero, not /dev/null.
May 15th, 2008 at 5:13 am
Guys if you have problems with grub in Windows Vista
this is how you solve it. restore your MBR before u erase the linux partition .
(Master Boot Record)= MBR
Put the Windows Vista installation disc in the disc drive, and then start the computer.
2. Press a key when you are prompted.
3. Select a language, a time, a currency, a keyboard or an input method, and then click Next.
4. Click Repair your computer.
5. Click the operating system that you want to repair, and then click Next.
6. In the System Recovery Options dialog box, click Command Prompt.
7. Type Bootrec.exe /FixMbr, and then press ENTER.
That’s it. Now when you reboot your PC, Vista will load automatically… You can now safely boot using your Ubuntu desktop CD, to use the built in Gnome Partition Manager to remove your Ubuntu partition!
May 15th, 2008 at 5:25 am
Rodney try to get any Vista instalation just to get in comand prompt and problem solved. Or get a dos boot floppy, USB, or burnt CD. Get to c: and type Bootrec.exe /FixMbr, and then press ENTER.
Done. Always enter bios setup to boot from the device to get to comand prompt ex: (USB, CD, Floppy etc.)
Remember to backup all your data before u install any other operating system.
That way your on the safe side always.
May 23rd, 2008 at 9:27 pm
A problem and a few questions.
Problem:
Older computer was running Fedora C4 great for several months installed from a Corporate DVD that I got from work.
Decided to install Fedora 9. Downloaded it and ultimately made 3 copies due to unsuccessful installs.
First:
Initial attempt wiped the drive and pooped the bed half way through the install. The system would not boot anything (no other media, cd, dvd, usb) until I removed the hard drive from the system, set it as slave in my XP box, formatted the drive, and set it back into the fedora box.
Next:
Fedora 9 installed with no errors, looking good so far. Reboot, and all I get is grub (I did not install this with the F9 but I did with the F4 I haven’t played with Linux since RedHat5.2).
Then:
Read this string as I was thinking that I don’t need grub if the system is only running one OS anyway. Removed grub using the
dd if=/dev/zero of=/dev/sdX bs=446 count=1
(null didn’t work)
Now:
When I boot the system stops at
Verifying DMI Pool Data ……….
I am guessing that I can fix the MBR using the F9 dvd in rescue mode but I don’t know how.
Q1: Can I fix this from the Fedora dvd in rescue mode?
Q2: If so, how do I go about that?
Q3: Since I have 1 hard drive and one OS, do I need grub?
Please don’t assume that I know anything, I hate the standard 3 hour search because I am supposed to know where the command/file is located that I don’t know to begin with.
Thank You for Your Time and Concern,
Papasmurfcba
June 3rd, 2008 at 2:31 pm
I was having Windows XP and Ubuntu before i went on to install Solaris. I made a mistake of not knowing that Solaris shared the same ’swap’ order as that of UBUNTU. So, after the installation, i got two OS’s in the system (Solaris and Windows), instead of 3 (i wanted XP, Solaris and UBUNTU together) and the GRUB menu got updated to 2.0. The Linux partition dissappeared from the menu.
Now i just want to get rid off these Solaris and UBUNTU installations by keeping my XP intact.
I tried the “fixmbr” technique, but i still get to the Solaris GRUB menu.
So, inorder to directly boot to XP, should i remove (delete) the Ubuntu and Solaris partitions on the harddisk?
When i tried to remove Solaris, i get an “operating system not found error”. So inorder to get to XP, i need the GRUB menu.
i want it to be plain old XP…(direct boot)
hope u guys can help me out here…