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.

Advertisement

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

πŸ₯Ί Was this helpful? Please add a comment to show your appreciation or feedback.

nixCrat Tux Pixel Penguin
Hi! 🀠
I'm Vivek Gite, and I write about Linux, macOS, Unix, IT, programming, infosec, and open source. Subscribe to my RSS feed or email newsletter for updates.

121 comments… add one
  • Jothi Arumugam Aug 15, 2014 @ 1:28

    Please Help me

    My lap-Hasee make Model No:HEC41 is showing
    β€œGRUB loading.
    WELCOME TO GRUB!
    error: unknown filesystem.
    Entering rescue mode…
    grub resume>”
    How i can Fix.

  • Jamil Aug 29, 2014 @ 17:54

    Hello. I want some help.

    I make a BOOTABLE USB (Puppy Linux [Slacko 5.7]) and it works fine. I tried to install GRUB4DOS Boot Loader, and I installed it on my SDA1 (which is my hard drive where my OS [XP] belongs)

    Now I have some trouble on how to uninstall or remove the Grub menu when booting up. Any one can help? :(

  • Jatin Jan 29, 2016 @ 17:00

    i had install kali linux on my windows 7 but when i restart my laptop it direct start the kali linux instead of asking which operating sytem u want to open please help me to get through this out without losing my windows 7 and any data on it

  • thankful person Jul 4, 2016 @ 15:00

    Thank you!
    This is the first solution option for MS-DOS and it worked perfectly.
    :)

  • Arnaud Oct 6, 2020 @ 17:36

    thanks !! “fdisk /mbr” saved me!

Leave a Reply

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

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the site admin.