How to uninstall GRUB

by on December 5, 2006 · 116 comments· LAST UPDATED December 7, 2007

in , ,

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
TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 116 comments… read them below or add one }

1 Martijn van Vliet December 15, 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,


2 billy January 13, 2011 at 12:29 am

IM a total noob where do I put the command in ? Terminal? I tried it it did nothing juist reposted my username ect.


3 Karim January 7, 2012 at 6:04 pm

In unix/linux in general if no error is printed the command succeeded.

Also if echo $? prints zero, the last command generally succeeded. In all actuality the programmers of the command can return any value they’d like but in general zero is success.


4 nixCraft December 15, 2006 at 11:05 pm


You are correct; I have updated the article.

Appreciate your post.


5 Ron Plane April 21, 2007 at 3:35 am

Thanks for the help very easy to follow


6 Teemu Pudas April 29, 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.


7 Shafin June 28, 2007 at 8:55 pm
8 Harris Rasheed September 9, 2010 at 5:13 pm

How do you do this on Windows 7?


9 Jereme August 7, 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.


10 donnie bradley September 3, 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


11 gbacskai September 11, 2007 at 9:16 pm


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:



install lilo to MBR
lilo -M /dev/sda -b /dev/shd
and uninstall
lilo -U -M /dev/sda /b /dev/sda



12 P3eggroll November 23, 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…


13 Ash December 28, 2007 at 9:04 pm

Thanks, great article – removed that pesky GRUB from my drive which decided to boot before my primary one does


14 Rodney February 8, 2008 at 3:09 am

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?


15 fluteman February 25, 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!



16 Jason E December 26, 2011 at 1:47 am

I have an acer that requires a USB CDROM and I am trying to boot to cdrom to use the Acer recovery disks, but it will not boot to cd first. GRUB is superceding my Boot order, and even though my Fedora is working fine, I am trying to fix the XP side. any thoughts?


17 Carey May 5, 2008 at 6:55 am

You need to use /dev/zero, not /dev/null.


18 Velibor May 15, 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!


19 Andrew Sampson October 30, 2010 at 1:06 pm

This solution also works for Windows 7. Very grateful for this. Thank You



20 Name December 21, 2010 at 3:46 am

hi Velibor,

Thanks a lot, i could fix my problem with above said solutions. great


21 Zeekazoid July 2, 2011 at 3:53 am

Worked awesome for Windows 7. Thanks!


22 Mattrageous4 August 16, 2011 at 3:44 am

Thank you so much it worked


23 aubizzy August 26, 2011 at 7:56 am

thanks man this totally worked for me


24 nhlanhla October 10, 2011 at 8:17 am

Thank you Velibor
i used Bootrec.exe /FixMbr in Win7 and it worked


25 Velibor May 15, 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.


26 PapasmurfCBa May 23, 2008 at 9:27 pm

A problem and a few questions.

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.
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.
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).
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)

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,


27 PringleZ June 3, 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…


28 Nitin August 5, 2008 at 7:52 am

Oh my god! I ran following on my dual (XP & Fedora 9) after booting from Fedora(linux) and now my system doesn’t boot at all! Not even from XP!! Just shows blank screen (with blinking underscore)!

# dd if=/dev/zero of=/dev/sdX bs=446 count=1

Is it expected ? Please help…

If I run fixmbr now, I think that will destroy all my partition table??


29 Phlek0 October 10, 2011 at 8:02 pm

Hey I am having the same problem, How are you able to run the fixmbr, did you use a boot live cd then run it?


30 Nitin August 5, 2008 at 8:24 am

Looks like running “fixmbr” fixed the booting issue.



31 Derfomiundz September 2, 2008 at 9:57 pm

Hi, Well I got this issue with Grub 0.91 and Damn Small Linux 4.2.4. I have Vista Home Premium, and I run the Live cd of DSL, and there I connected my USB drive and I “Installed it on there”Now I have 2 partitions that I don’t know where did they came from and My OS Vista doesn’t load after doinf some of the thisngs you guys said about fixmrb and stuff. It says Error Running the Os. Now I dont know what happened to all my info and I dont know what this 2 partitions do and I dont know what to do… If needed I will give more details…Thnx


32 Bigjoe September 8, 2008 at 9:51 pm

thankyou guys absolutely brilliant advise i managed to fix in literally 30seconds with your advise


33 Diesel October 27, 2008 at 7:58 am

Great little article. I have been looking for a simple method to safely remove Ubuntu while keeping my XP install since I completely fluffed up Ubuntu by following an incorrect guide elsewhere for something completely unrelated.
Anyway, I will give this a go.
Thank you


34 Verbal November 28, 2008 at 5:19 am

I had the same problem as Diesel, and this saved my XP install. Thanks for the information!


35 HKCHAN November 30, 2008 at 3:50 pm

I have exactly the same problem with Derfomiundz . I tried to install DSL-n in the USB stick and had confirmed that I can see the contends in it when mount as “sda1″. But later I found out that the hard disk is also using “sda1″ and it overwrite my boot sector er installation and I can’t boot up my windows XP anymore. Any help will be appreciated as all my data for work in my hard disk is not backup. Any advise to make my Dell Laptop bootup again in Windows XP is very much appreciated.


36 camypaj December 7, 2008 at 3:02 am

xp + fc6
didn’t work with fixboot c: or fixboot [c:], BUT “fixboot” (without parameters) wrote a warning, and then wrote proper boot record. Hope this helps.



37 Max Schwanekamp December 23, 2008 at 7:23 pm

@Velibor (7 months later!)
Thank you! I had installed Ubuntu on an external USB drive, and did not realize grub would be installed on my boot hd. Grub is fine, but if I tried to boot my laptop without the external HD connected (even though I only wanted to boot into Windows), I’d get “Grub error 20″ (unspecified error).


38 Nitin December 29, 2008 at 12:55 pm

Hi ppl,

I have Fedora 8 and Win XP SP2 installed… I have a problem in Win XPthrough GRUB. Everytime I try to boot WinXP it says “GRUB Read error” after showing the menu consisting of the different OS. I tried to uninstall GRUB using the “dd” command as mentioned in this discussion and my MBR was changed. Now, when I try to boot WinXP I am facing a black screen with “GRUB” at the top left corner of the screen. I am unable to boot any OS now. Initially I had WinXP as my primary boot. I went through this forum and couldn’t find a solution to my problem. I will be glad if I am able to boot WinXP for now so that I can go to disk management and then try to install linux after that…
Need your help people!
Thank you


39 H January 9, 2009 at 12:20 pm

Hi – I wanted to try Ubuntu, but couldn’t get my head around it and now I have a dual-boot screen that I don’t know how to remove! I also no longer have my Vista recovery CD so the above, really straightforward methods, won’t work – which is what you get for packing in a hurry when you’re drunk and moving flats… there any way I can do this? Help really appreciated!


40 Rohit Mordani February 7, 2009 at 9:09 am

I dont have a CD drive in my laptop and I wanted to fix the issue. I cannot use the Recovery method (obviously since I dont have a CD drive). Is there another way to re-write the windows boot record?


41 ercan February 15, 2009 at 4:57 pm

listen to this man cos his solution realy works
gbacskai 09.11.07 at 9:16 pm

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:



install lilo to MBR
lilo -M /dev/sda -b /dev/shd
and uninstall
lilo -U -M /dev/sda /b /dev/sda



42 Hasi, sri lanka March 22, 2009 at 6:12 pm

Thank u very much


43 Artem April 12, 2009 at 5:16 pm

I suppose FIXMBR only works if your windows partition was on the _FIRST_ partition of the drive..


44 vishal April 13, 2009 at 3:50 pm

i am in big trouble , i removed my xp and installed ubuntu 7.10 but i realised dat i did blunder, when i wanted to install xp again… i booted from cd.. then a black screen comes with setup is inspecting your computer hardware config and screen disappears and nothing happens…. my exams are on my head pls anyone reply fast.. i will be very greatful of urs…thanks in advance..pls reply soon


45 Pooran Meen August 11, 2011 at 12:37 pm

you have to boot from windows 2003 server and after remove partition of linux then reboot your system from windows xp,

I m sure that now you will show screen..



46 vishal April 13, 2009 at 4:21 pm

pls reply soon.. as soon aS possible


47 Jon April 14, 2009 at 6:34 am


Your information worked awesome for me — thanks muchly.

I had a broken grub boot loader after removing the linux partition from my dual boot EEE PC, and now it’s working again.


48 Francis Moeris June 1, 2009 at 10:31 am

Thank you very much for the tip on how to remove grub.
Back to windows XP,
sorry to say but Ubuntu was a very bad experience for me.
In order for it to move I had to constantly move the mouse. I am using an ACER 430 travelmate.
Kind regards


49 Andrew J June 12, 2009 at 10:53 am

I don’t have a setup disk, so I’ve tried the dd approach, which certainly seems to have removed grub, I no longer get an error at start up, but neither does the XP system load. How do I rebuild the MBR now that it has been over-written, so that XP can load? I have a current backup, so I would be happy completely formatting the disk or anything else destructive!


50 Nereik June 19, 2009 at 3:04 pm

Hey, I have read the above tips on removing GRUB in the windows XP and Vista, but I have been unable to remove this successfully. I have duel booted windows Seven RC 32bit with Ubuntu 9.04 (Beta)! Is there anyway I can remove Ubuntu 9.04 and keep Seven? Thanks heaps cheers!


51 daid June 20, 2009 at 7:36 pm


I believe the assessment that outputing from /dev/null does not work is correct.

As far as I know, this is not limited to Fedora, but all Linux and UNIX-like sytems! It must be:

#dd if=/dev/zero of=/dev/hd## bs=446 count=1

To work in general. /dev/null is a place to send useless outputs, instead of to stout, for example. However, /dev/null will never contain anything, and so it cannot be used as an input file for any purpose, including dd. /dev/zero contains blank information, so it can be used as an input file to clear any sort of files or storage media location.

Unless I am in serious error, I request that the original post be edited to this point. If systems exist that can use /dev/null as an input file, then the post should, at the very least, be edited to specify that the commnad, as written, has limited usage, and that using if=/dev/zero is a more universally applicable technique.

I appreciate the post, though, and particularly the bs=446, which I always forget the exact value of.

A linked post on how to re-enable grub may also be useful. It’s pretty straight forward, but usually when I disable booting, it is for particular problem solving, and then I need to reenable grub later. I could post with the ~10 commands for this purpose from a Live CD if it’s useful.


52 paul July 8, 2009 at 9:19 am

hey guys i installed unbuntu on my pc with xp, I wanted to get rid of ubuntu so i wiped the partition i made for it etc. tried to fixmbr etc noting works. whenever i boot up i get another error msg saying no sata disks detected which i only got once i deleted the partition with ununtu installed. i don’t even have any sata disks, there all IDE so ive no idea what to do. then after that msg i can press f1 to continune and then it has the dual boot either xp or ubuntu even tho ubuntu doesnt exist anymore! any help would be appreciated. also its weird i cant even do a live CD off backtrack 4 now since that happened i get errors..

Cheers lads.


53 The Doc August 9, 2009 at 11:02 pm

daid is 100% correct! The use of “null” does not work. To post its use here as supposedly being an effective means of removing the Grub MBR is quite fatuous.

Also the use of “sdx” in the expression (presumably for a SATA drive), and then the note “Replace /dev/hdX with your actual device name such as /dev/hda. ” adds to the confusion!

The correct expression (for a PC with hda) to remove Grub from the MBR without deleting the partition table is:

“# dd if=/dev/zero of=/dev/hda bs=446 count=1″.
When this is accepted you will then get a response indicating one record in and one out.


54 votuananhs August 20, 2009 at 2:28 pm

Thank you for information. It is great.
I run two command: fixmbr and fixboot.
Before I used both ubuntu 9.0.4 and win xp. But disk of OS ubuntu die. I find information to fix the error. Fortunately i read this article.


55 Hi_This_is_Dev August 30, 2009 at 8:39 pm


In order to explain my problem let me give you the details of my system as follows:

HD: 80 GB
First OS: Widnows XP
Partitions for Windows XP: C, D, E, F, (Free)

Installed Second OS: RHEL 5
Partitions/File Systems of Linux: Use the Free space and installed RHEL and specified / and /home partitions.

Some 3 GB space was still left free which I found through My Computer – > Manage – > Disk Manage:

Healthy Unknown Parition
Healthy Unknown Parition
Free SpaceSo, I deleted the Free Space and created a new logical volume in Windows. Before that, both Windows and Linux were running fine as part of dual booting system. When I restarted the system…. errrrrrr
Grub>prompt was there. Well, having seen it I wondered but was not worried because I am doing RHCE and my trainer taught me what to do when Grub> prompt comes. However, she said that it would come if grub.conf file was deleted. But I had not deleted any file, so, I went ahead did the troubleshooting part and was able to load linux and get the desktop. I checked the file grub.conf was intact and it must not have cuased the problem. I restarted the system and the same thing:
Grub>was there.

I was not able to load Windows XP and so I was a little confused this time. I called some other trainer and she asked me to do the following:

Grub> rootnoverify (hd0,0)
Grub> chainloader +1
Grub> boot
and voila! Widnows XP was loading!

So, I deleted the Linux partitions and restarted the system. But Grub> prompt was not willing to go away.

So, can you show me a way to remove the grub info in order for Windows XP to boot normally as if there were no Linux installed on the system? I have to do those steps over and again to boot from Windows:

Grub> rootnoverify (hd0,0)
Grub> chainloader +1
Grub> boot

One more thing, when I have deleted the Linux partitions why Grub> is still alive? I think it is present in MBR. So, how to troubleshoot it?


56 Bhgyesh Dhamecha August 31, 2009 at 4:13 am


M’ bhagyesh dhamecha..

i need help…
In my system.. is dual booting .. with win XP and RHEL 4.
at the time for new booting the system is taking automatic priority to booting Linux. i don’t know how to set priority for booting..
Yesterday, i was planned to remove the RHEL4 from my system.. the total partition is occupied to Linux total 15 GB..with like partition [ /, /home, /boot, and swap ], what wrongly i have doing is remove all partition one by one from windows, disk Management console…and then create new NTFS partition for 15 GB,

After booting the system… i show this grub error console..

” grub >”

and use to complete the command use ” tab key “…

Please help me as soon as possible..

bye.. friends..

Bhagyesh Dhamecha


57 dustin September 1, 2009 at 7:01 pm

in reply to:

Velibor 05.15.08 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!

THANK YOU SO MUCH! I have searched for a vista option everywhere and no help. your command was so easy! thank you!


58 marc September 7, 2009 at 4:08 pm


I have the same problem with the GRUB loader, but am unable to follow your advices. The reason is that i have done the same mistake on a mini pc (Acer ONE). And there is no way to boot from an optical unit. The only way to boot the system is eventually with USB key. At this point my question is: Is it possible to create a windows XP based bootable usb key to restore the original booting for Win XP?


59 Hi_This_is_Dev September 7, 2009 at 6:59 pm

In reply to Bhgyesh Dhamecha’s problem:

Since you have deleted Linux partitions while being in Windows mode, you are getting Grub> prompt.

Now, what do you want to do?
[1] Do you want to start up Windows?

[b]Solution:[/b] (Assuming that Windows is / was your first OS)

Grub> rootnoverify (hd0,0)
Grub> chainloader +1
Grub> boot

[2] Do you want to install Linux again?


Well, you can do that by bootting from the media containing Linux installation. (O, you already know that! )

However, be careful when you choose paritions for installing Linux. As you have already deleted the partitions which were being used by Linux, so this time you should choose “Custom Layout” and then use the Free Space for creating new partitions for Linux.

[3] Do you want to get rid of the Grub> prompt and get into Windows directly every time you start your system?


Install Recovery Console using your Windows XP Installation CD and then select it at next start up (you should follow the first solution given above for getting into Windows) and then type this command:

[code]C:\WINDOWS> fixmbr
C:\WINDOWS> boot [/code]

It will remove Grub Loader and reinstall MS DOS Loader so that you should not see the Grub> prompt again.

You may like to have a look at this page which contains my originals posts. I had a similar problem some days ago and posted how I fixed it.


60 Alexander September 13, 2009 at 4:04 pm

Hello i’ve been having trouble with GRUB as well;
Originally i Had Xandros on my desktop, i got hold of another hard drive and installed Mandriva on it, so now i have two hard drives on desktop
thats when the problem started;
Mandriva loads fine but i can’t get Xandros to load up again.
Through Mandriva i accessed my Xandros hard drive and did what you recommended (first two steps);
# dd if=/dev/null of=/dev/sdX bs=512 count=1
# dd if=/dev/null of=/dev/sdX bs=446 count=1

But i’m not sure what you mean by your last step
“Replace /dev/hdX with your actual device name such as /dev/hda. Use fdisk -l command to find out device name:”
dis is what i get when i do fdisk -l;

Disk /dev/sda: 10.0 GB, 10003955200 bytes
255 heads, 63 sectors/track, 1216 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x563d5c59

Device Boot Start End Blocks Id System
/dev/sda1 * 1 629 5052411 83 Linux
/dev/sda2 630 1216 4715077+ 5 Extended
/dev/sda5 630 704 602406 82 Linux swap / Solaris
/dev/sda6 705 1216 4112608+ 83 Linux

Disk /dev/sdb: 81.9 GB, 81963220480 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000e689a

Device Boot Start End Blocks Id System
/dev/sdb1 1 182 1456128 82 Linux swap / Solaris
Partition 1 does not end on cylinder boundary.
/dev/sdb2 * 182 9965 78586079 83 Linux

Disk /dev/sdc: 4077 MB, 4077912064 bytes
126 heads, 62 sectors/track, 1019 cylinders
Units = cylinders of 7812 * 512 = 3999744 bytes
Disk identifier: 0×00000000

Device Boot Start End Blocks Id System

Disk /dev/sdd: 2032 MB, 2032664576 bytes
64 heads, 63 sectors/track, 984 cylinders
Units = cylinders of 4032 * 512 = 2064384 bytes
Disk identifier: 0×00000000

Device Boot Start End Blocks Id System
/dev/sdd1 1 984 1983619+ 6 FAT16

Disk /dev/sda is my Mandriva and Disk/dev/sdb is Xandros other was my Sansa player charging.

How do i do that third step and what should i do.

Thanks for the help

P.S. after i did the first two steps and tried loading my hard drive, my monitor only displayed “GRUB” not “GRUB ERROR”.


61 MuZo November 2, 2009 at 5:18 pm

Ok, here comes my problem:

C: Vista : Active and Running
Z(or)M: FlashDisk : Xubuntu 9.04 installed. 8gb

My Problem : Grub Error 17. Without Flash drive,system is NOT starting.
Recovery CD-DVD: Valid,but i dont want to use it. (REASON:) It can delete everything.

Wish: i dont want to See Grub+Uninstall linux from my usb.

Any ideas?


62 MuZo November 3, 2009 at 4:24 am

Ok, Here i fixed my problem from Vista with MBRFix file.

I made a quick uninstall guide for Grub from Vista:

A “Fast” and simple Grub Removal Guide(From vista without and disk or any other stuff) with pictures :)


63 alex November 10, 2009 at 4:02 pm

boot hiren cd
run smartfdisk
then repair mbr for partition c:
and save changes


64 Starl8gazer December 2, 2009 at 3:20 pm


I have the following BIG problem.

Original situation: dual-boot computer Windows XP SP3, Linux

Goal: remove Linux installation;
concluded from web searches that I should remove GRUB first

My level of knowledge in these things: beginner

What I did: started with booting from a WinXP installation CD;
‘Repair’ did not work because hard disk driver was not found (?!);
so I thought I’d go for the Linux solution suggested above
and issued command:

root@mymachine:/# dd if=/dev/zero of=/dev/sda1 bs=446 count=1

Result: GRUB still comes up when booting, giving option to Windows or Linux;
booting Windows fails with following message:

Booting 'Windows 95/98/NT/2000'

root (hd0,0)
Filesystem type unknown, partition type 0x7
chainloader +1

Loading stage 2..

GRUB loading, please wait...
Error 18

Linux still boots okay; it presents the following info:

root@mymachine:/# fdisk -l

Disk /dev/sda: 81.9 GB, 81963253760 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 3602 28933033+ 7 HPFS/NTFS
/dev/sda2 3603 9964 51102765 f W95 Ext'd (LBA)
/dev/sda5 3603 6993 27238176 b W95 FAT32
/dev/sda6 6994 7056 506016 82 Linux swap
/dev/sda7 * 7057 9964 23358478+ 83 Linux

root@mymachine:/# cat /etc/fstab
/dev/sda6 swap swap defaults 0 0
/dev/sda7 / ext3 defaults 1 1
/dev/sda1 /mnt/winc ntfs user,ro,auto,umask=2 1 0
/dev/sda5 /mnt/wind vfat user,rw,auto,umask=0 1 0
/dev/cdrom /mnt/cdrom iso9660 unhide,noauto,exec,user,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,umask=0 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0

What can I do to get WinXP to boot again?

Thanks a lot for your help!



65 Richard December 12, 2009 at 4:45 am

I have a similar query to Starl8gazer:
Will the command dd if=/dev/null of=/dev/sdX bs=446 count=1 allow the system to boot back into windows automatically at boot.



66 Cole Mickens December 21, 2009 at 1:47 am


No, the very point is that the command dd if=/dev/zero of=/dev/sdX bs=446 count=1, (Note: Use /dev/zero not /dev/null), will erase the boot sector (MBR) of the drive. Your computer will be unable to boot from that drive. If you are trying to boot Windows, then you need to use the Windows recovery disc and run one of the various Windows Boot Recovery commands.

They involve bootrec, fixboot/fixmbr or fdisk /mbr. I’ll leave it to you to figure out which you need for which recovery console you’re using.


67 Nicholas Maskal January 15, 2010 at 4:47 am

I recently had a similar problem on a dualboot of Windows 7 x64 and Vista x86 on an SSD, with Linux run from an older IDE drive. GRUB installed itself on the SSD and recently refused to boot. I’ve tried everything in these forums, finally figuring out the only solution that has worked:

Run Windows 7 Start-up Disk. Choose the Repair option, and run command prompt.
type bootsect /nt60 ALL /mbr

this was the only command that ended up writing over GRUB while allowing the windows loader to remain intact with both partitions. Hopefully you could turn this into a tutorial for future users, because I couldn’t find anything to help me online.



68 Neeraj Shah March 9, 2010 at 6:03 pm

For windows 7, use bootsect /FixMBR from recovery prompt


69 sam April 15, 2010 at 4:24 am

Thanks Nicolas! That worked! I use the f12 key to select the boot disk rather than a boot loader so my machine normally boots to W7 W/O hesitation. I did an update to Ubuntu after initial installation and wham, Grub! When doing updates to Linux I’ll disable my primary boot disk first!


70 mouse May 3, 2010 at 11:52 pm

I screwed up. I was updating ubuntu 9.10 to 10.04 when I was asked(I think) where to install GRUB. I put a check in the box for /dev/sda and /dev/sda1. I know now I wasn’t supposed to put it at /dev/sda1. But now I can’t boot into /dev/sda1(windows vista). I tried using the vista boot disc and it just keeps giving me errors. How do I make sda1 bootable again?


71 san May 17, 2010 at 6:17 am

I did the same thing as mouse – now I can’t boot into Windows. I can boot into Linux fine. Is overwriting GRUB with windows boot loader the only way to fix this?


72 mouse May 17, 2010 at 8:49 pm

I forgot I had this post here. I found a fix to that problem a while back, although I can’t find the site I used that had the step by step tutorial(sorry). What I used was testdisk and it worked perfectly. If you’re not afraid to do a little reading this should help you too. Good luck.


73 san May 21, 2010 at 7:08 am

I fixed it by booting from Windows XP CD, select R for repair, then run fixboot and fixmbr (had to do both, just fixmbr didn’t do it). This let me boot into Windows and Windows only. To get GRUB back and have multiboot, I then booted from the Linux Ubuntu CD, mounted /dev/sda2 and then did a grub-install following instructions here:


74 Lin May 16, 2010 at 6:20 pm

“boot hiren cd
run smartfdisk
then repair mbr for partition c:
and save changes”

This worked for me. Thanks Alex.


75 Bridger May 24, 2010 at 11:26 pm

QUESTION: How do i remove “GNU GRUB version 1.98-1ubuntu5″ during start up?

I have both windows 7 and ubuntu installed on a PC; but now during every start up, the GNU loader prevents running Windows 7 on /dev/sda1. PLEASE HELP

By the way I do not have the original windows 7 disk.


76 Mwale May 24, 2010 at 11:44 pm

Oh my!!!! these command lines are like casino slot machines, every time I input commands NOTHING HAPPENS!!!!!!!!!!!!!!!


77 rja May 27, 2010 at 10:14 pm

help me…
I format the partition that contain the ubuntu os….now the grub bootloader cant boot even my window vista….whenever i start my pc…this thing always popup…
GRUB loading
Error unknown filesystem
Grub rescue>
Plizz help me


78 Loz May 28, 2010 at 12:00 pm

RJA: as it says above several times, use your Vista installation disk in Repair mode, to re-write the MBR with the command tools suggested above. Or try download the Hiren’s BootCD.

As Cole pointed out above, IGNORE the advice in the main article to use the ‘dd’ command to zero the MBR, partly or completely: it won’t help you to boot the hard disk! The MBR code area (first 440 bytes) needs to be refilled with windows-compatible bootstrap instruction code, to replace your broken GRUB setup. Binary zeros don’t do it!


79 aaaa August 15, 2010 at 4:02 am

The following command didn’t work:
# dd if=/dev/null of=/dev/sdX bs=446 count=1


80 Michael September 8, 2010 at 6:33 am

Hi guys i seem to have a crappy problem…. I installed Linux onto an external hard drive… so i thought cool plug it in start linux no probs… but if i dont have the hard drive plugged in it gives me the recovery console… i cnat do anything with that, since it does not sopport many commands… i would really like to ,be able to start windows on my internal, without my external hard drive…. is it possible to remove grub in recovery mode? and if how?


81 Gopal October 9, 2010 at 5:57 am

I have Dell laptop with Ubuntu OS, But I would like to remove ubuntu and install XP. I have Bootable CD, but while installation there is one massage that your system may have some problem and it stopped working……. I am not from technical background will you please tell me how to resolve this problem…


82 eleazar October 14, 2010 at 3:09 pm

hey i have a problem it says grub loading… please wait.. error 22 can you help me please i dont know what to do


83 bernie October 30, 2010 at 2:18 am

Thanks so much, just a simple step but a great solution. Bless


84 Polygon November 2, 2010 at 3:42 pm


I have read all the threads and tried all the ideas but I’m still stuck. So I am after some ideas of what to do next as there seem to be experts here.

I have a single boot Fedora 11. I want to blow away Fedora & install XP (…for my wife). I have an original ’95 disc & an OEM XP disc – both bootable.

Despite re-ordering the boot order in the BIOS, changing the MBR “dd if=/dev/zero …” I still cant get the machine to boot from ANY bootable CD or USB device.

I dont want to format the drive as I suspect it will not fix the problem.

For the first time I am contemplating using a repair company but that is £100/$150 just to look at it!!!!

Anything else I can try to get XP installed?

Many thanks,


85 nereik November 2, 2010 at 9:31 pm

Do you know what the model of the motherboard is? Does have a boot menu?

With alot of the older systems, the motherboad(mobo) was not able to use the boot… There is a disk which basically is a portable boot menu which has the same auto run ability as a xp dsk from m/soft.



86 mitul November 9, 2010 at 11:37 am

i was having wondows 7 in my laptop, then i made 1 partition on my hard drive and installed u buntu. after istallation i restarted my laptop then if i boot ubuntu ,everything works fine but if boot windows and then shutdown , after thst i am unable to boot any of my OS….. pls help me ourt with it…..its urgent….please


87 gelspace November 22, 2010 at 8:31 pm

I have a laptop that has debian 3.1 grrrrrub and some kind of linux installation on it. I want to completely clean the hard drive but I don’t have root passwords logins etc.
There is no Windows installation on it.
Just want scrub the lot and start again.
can anyone help?
Gels (the ultimate newbie)


88 Curtis November 24, 2010 at 12:13 am

Yes! Thank you worked great for my windows7


89 mike dela paz December 10, 2010 at 11:54 am

i had a windows vista os i formated it after i reboot boom stupid grub it wont load my windows vista.. how can i remove and get rid of the grub4dos program????ive tried already partitioning and formatting the hard drive but it really doesnt work grub still appears after rebooting and wont allow windows to load up.. need your help very badly… Thank you so much in advance…


90 Freerk December 21, 2010 at 3:21 pm

I had better results by using a Knoppix CD or thumbdrive.
Open a terminal window and type:
sudo testdisk
It will lead you trough a few menus and one of them is writing MBR to the chosen disk.
Works great!


91 Twp January 16, 2011 at 5:34 pm

Im using a linux script for deleting partitions and format my HD to NTFS. it is a .s script. How can I use the line below in my script?

# dd if=/dev/null of=/dev/sdX bs=446 count=1

The “#” sign is usaly used to make a comment in a script so if I write # te line wont run!? Will it work with just:

dd if=/dev/null of=/dev/sda bs=446 count=1


92 Twp January 18, 2011 at 10:47 am

Ok, I got it to work i my script but I can still not get my win xp to boot. I need to do it with a script because im working in a big environment. Our old computers a Grub boot to load Win XP end now when im trying to deploy just an ordinary XP image over the Grub and XP I cant get it to work.

Before the dd command I got an Grub 17 error. After dd command I get rid off de Grubb error but my Win XP is still refusing to Boot. Now just get “_” in de top lef corner of my screan.

Any ideas someone?


93 Maarten January 23, 2011 at 5:39 pm

I was about to by a new hard disk, but thanks to you everything works as in should.


94 krishna pada baidya January 30, 2011 at 1:41 am

i have a linux machine.i can change it to xp2. when boot from cd press any key
then it is black screen. and other wise boot grub loded…
c commend promt then grub>
so how can change linux to fresh xp2. plese help me.


95 master mind February 5, 2011 at 7:03 am

thanks for comment to my fab genius tech master

i miss you ……………..


96 Spilluz March 10, 2011 at 9:50 am

I have Win7 and Ubuntu 10.
I Installed Windows 7 on drive C and UBuntu in drive L (NTFS)
But after restart it does’t work and it display “grub rescue” prompt.

I solved whit Installation DVD of Windows 7, recovery panel, prompt
I used bootsect batch like this: “bootsect nt60 ”

And it works



97 Deepak Sharma March 23, 2011 at 5:29 am

I had window 7 as well linux on my machine. i formatted the linux partition(uninstalled linux) and formed a new drive in Window 7. But when i restarted my machine i was not able to start window 7. I get a blank screen that asks for path of Grub.
Now i don’t know what to do to get my window back.
please tell me any feasible solution.
Deepak Sharma


98 Nereik23 March 23, 2011 at 11:12 am

Yer, I remember when I had this issue. Had Windows 7 on HDD1 and had a copy of Linux on HDD2. What I also noted was that during the install I had both HDD’s plugged in. (WINDOWS & LINUX).

So, basically I think (Dont quote me) but during the installation of Linux theres the boot config file (ONLY FOR LINUX) which is transfered to all HDD so that Linux doesn’t get confused with where it has to boot its files from. During this being copyied is when Windows relises that Windows inst compatible, and then gives the following error when you delete the partition with Linux.

Now, to your question. Basically the only way that I have been kinda successful with getting windows back up is, i found this bootable software which allowed me to create a new boot menu before any of the OS loaded. And had got into there once or twice, but then quickly got sick of the menu that it came up with, and was also really buggy, back when i tried it.

In the end you are basically gonna have to re-format the computer and re-install the critical component that Win7 needs to run. (AKA Format & Reload. :) Good luck!


99 jitendra khunt March 27, 2011 at 4:20 am

->i hava xp 2 and fedora.
->but i can’t boot in fedara when i start computer or restart.
->automatically xp start
->what i have to do.


100 Nereik24 March 27, 2011 at 9:32 pm

Ok, Start Windows XP, login etc just till you get to the desktop, you need to go into the start menu. Right click on My Computer, than go properties. There should be a tab called advanced system settings. In there it should say somewhere “Startup & Recovery – System startup, system failure, system debugging information” and then a settings box. click on that. Now in this window, basically these are the settings which alter the way the computer starts in the different OS.. you need to check to see if fedora is in the default opearting list. Also you need to make sure that Time to display list of Operating systems are ticked. and say 30seconds. Also if Fedora does come up, as well as Windows XP than you can say pick what OS you want to be default. I would probably recommend XP though. Let me know how you go. :)


101 rahul April 18, 2011 at 4:46 am

hai this is rahul i ask your advise

sir i can install fedora 10 with the windows xp but i can remove fedora in the windows disk management console
when the same time i reboot the system
by the next time show “Grub booting loading” error in the monitor


102 Environmental Consultants April 19, 2011 at 9:49 am

I had a nightmare situation when I installed linux on a 2nd HDD and couldn’t boot from CD, to use recovery consol.

Luckly I am using an old computer and so I downloaded the widget from M$ to make floppy recovery disks (six disks!!).

Then I used fixboot, fixmbr to overwrite grub, or whatever in the recovery consol.

Trying out ubuntu cost me around 12 hours to get shot of it.

Version 10.4 has zero multi monitor support, which I why I jumped ship!


103 rafeeque April 21, 2011 at 10:54 am

i remove grub loader.i solved boot problum by this site.
Thank you very much


104 onyeka April 23, 2011 at 4:20 pm

I had windows xp 2002 edition installed on my laptop, but i also installed ubuntu 10 and got a lot of trouble with freezes after booting, i removed XP and installed only Ubuntu hoping that would solve the problem but ubuntu is not a good a idea either, i want the old XP back but i can’t reinstall it because i am using a usb disk for that and i get grub prompt and i am lost on how to proceed from there..any help please will be appreciated.


105 lenfantroi April 26, 2011 at 9:07 am

Hi, I have Windows XP and ubuntu installed on two disks on my desktop computer and I used grub as a bootloader. I wanted do remove linux and remove the corresponding disk from the computer. I followed the instructions above, and now, grub is still there and I cannot start Windows anymore.

I first thought that just removing the disk would be ok, but grub cannot start Windows without the linux disk. So I followed the instructions above (at least I thought so) to uninstall grub.
Here is a copy of what I did:

jf@computer:~$ sudo fdisk -l

Disk /dev/sda: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xeede9d79

Device Boot Start End Blocks Id System
/dev/sda1 1 8 64228+ de Dell Utility
/dev/sda2 * 9 19060 153035190 7 HPFS/NTFS
/dev/sda3 19061 19452 3148740 db CP/M / CTOS / …

Disk /dev/sdb: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0×00000081

Device Boot Start End Blocks Id System
/dev/sdb1 14660 19452 38499772+ 5 Extended
/dev/sdb2 1 304 2441848+ 82 Linux swap / Solaris
/dev/sdb3 305 2501 17647402+ 83 Linux
/dev/sdb4 2502 14659 97659135 7 HPFS/NTFS
/dev/sdb5 14660 19452 38499741 83 Linux

Partition table entries are not in disk order
jf@computer:~$ sudo dd if=/dev/null of=/dev/sda2 bs=446 count=1
0+0 records in
0+0 records out
0 bytes (0 B) copied, 1.5922e-05 s, 0.0 kB/s
jf@computer:~$ sudo dd if=/dev/zero of=/dev/sda2 bs=446 count=1
1+0 records in
1+0 records out
446 bytes (446 B) copied, 0.0157452 s, 28.3 kB/s

Since the first dd command did nothing (I tried to restart and grub was still there, booting etc.) I tried the same using /dev/zero instead of /dev/null (the second dd command).
Now, when I start the computer, I get the usual grub screen, with the two systems. It works if I try to start ubuntu, but when I choose Windows, I get the message:
Starting up…
Loading stage2…

GRUB loading, please wait…
Error 18

Can anybody explain this to me ? I guess I erase the beginning of the wrong drive… How can I just remove linux ? I do not have a windows CD (Dell computers come without one), so I cannot try the fixmbr option.


106 Randy Stone April 27, 2011 at 10:22 pm

So I am running dual boot (windows 7 starter/ubuntu netbook remix) on an acer netbook and can’t for the life of me figure out how to get grub off my computer. I’m not a dev and really don’t like this software, but I can’t get it off. I got rid of ubuntu but not grub. Couldn’t find it through windows and after I deleted the linux partition I can’t get ubuntu to reinstall. Now I’m stuck running ubuntu off a flash drive and can’t access anything I want to use. Someone please give the idiot’s guide to getting this herpes of a software package off my computer.


107 Tarish July 15, 2011 at 11:13 am

Sir,I have installed dual OS on my system i.e.., windows XP2 & RHEL 5, when I was trying to install windows xp2 Mesaage shows as” for installing windows u have 64 MB of RAM” ,actually I have 128 MB of RAM & if PC boots normally it shows GRUB> .How should I recover that problem so I can install only windows XP2, Also tell me solution if I want to install Dual O/S i.e.., windows XP2 & RHEL 5.


108 Himanshu December 1, 2011 at 2:28 pm

I reached ‘Grub>’ when i deleted partition of my Linux Suse 11 OS from my Hard disk. Now, I want to boot from Windows 7 OS which was already installed along with the Suse 11. It asks me to install the Kernel. I wanted to access Win 7 without loosing any data. How to get rid of this?? Please Help!!!!!.


109 Ade December 27, 2011 at 12:19 am

How do you do this on a ZX81 ? nah, just kidding.

I got the same problem, thanks for the tips.


110 Manjunath February 14, 2012 at 6:17 am

recently I have reinstall the windows-XP to my laptop earlier I have working with both OS (Windows-XP and Mandriva) but now how can I get back the Mandriva OS in my laptop?


111 james February 17, 2012 at 12:37 am

Ahhhh, yes the perfect way to replace the MBR when you’re installing GRUB to Flash and you misinterpret it’s wish to install in the MBR of the hard drive as a request to install in the MBR of the Flash. Nasty “Welcome to GRUB” messages and “Error 21″ when it cannot boot the original hard drive system. An Emergency Boot Disk burned to CD-ROM (Nero does this – floppy emulation) gives you the option of “Starting the computer with CDROM support”. From there executing “fdisk /status” shows the hard drive completely intact (minus the MBR), “fdisk /mbr” silently fixes it. Even though this was a Windows98 EBD (no password there) it repaired an XP installation (silly Microsoft, we don’t need no stinking passwords!)


112 shiv August 22, 2012 at 1:38 am

i have an acer with windows 7 , i split the harddrive to install backtrack5.. In the beginning it was good but then i deleted the partition on what the backtrack 5 was .. Now when i start my laptop this comes everytime :’ error filesystem not found ,grub rescue>’ ..i cant acces windows anymore .. Help please??? What can i do to fix this ??


113 henry September 2, 2012 at 6:58 am

pls help me my laptop at risk how to exit GRUB rescue way to commands my laptop is goverment lap so no disk drive booting is not working pls tell me how to exit that way of commands pls pls pls….


114 sathish September 25, 2012 at 1:55 pm

i had window 7 as well as linux (coverment laptop), after compliting partition on my hard disk then i restart my laptop it shows block screan in that enter ENTER SECURE MODE. how can i face this proplem. any one can help me please……….!


115 Kotsos January 17, 2014 at 4:00 pm

I have a dell 3521 with ubuntu 12.04 lts.I changed something in bios and now when it starts it shows the grab command and i want to remove it.can you show me how?


116 khalid February 4, 2014 at 6:20 pm

When I am installing linux, my problem is that when packages are installed at that time there has an error and the error is that please debug the package so how i debug.
There is a three options
1)exit installer
please tell me solution, if you understand my problem.


Leave a Comment

Tagged as: , , , , , , , , , , , ,

Previous Faq:

Next Faq: