How do I remove GRUB from an XP/Linux PC without using Windows or DOS?

I have a PC running XP and Ubuntu which installs GRUB. I want to remove GRUB without using Windows or DOS. I am not interested in whether or not the Linux partitions are deleted in the process - I just want GRUB gone and the machine to boot into XP like it did before I installed Ubuntu.

You may safely assume I know absolutely nothing about Linux and need a solution that tells me which keys to press. I have two disks that may be useful - an Ubuntu 7.10 Live CD (although it is 8.x that I have installed - the 8.x Live CD is corrupted) and a bootable GParted CD.
Who is Participating?
torimarConnect With a Mentor Commented:
I don't see how formatting the linux drive will get rid of anything in the master boot record. On the contrary, GRUB still residing in the MBR and not finding its config file may cause the system to become unbootable.

In the other thread I already pointed out that there are FIXMBR-alternatives on the Ultimate Boot CD ( Like MBRTool, for instance:

If you download the complete UBCD (I gave direct download links in the other thread), you will already have a bootable device with many other practical tools.

These MBR utilities act the same way as FIXMBR does, and they have to be used with the same amount of caution.

If you feel in any way uneasy about manipulating your MBR, consider simply deactivating your GRUB, as I have explained in the other thread as well.

just put the cd and boot it from cd...and then you will see the linux partitions there simply, reformat it with NTFS...neat...

no other cd you will need...just

"The problem is when you delete the Ubuntu partition, that second, vital part of Grub will suddenly be gone. When you try to boot up, your MBR will be pointing to an empty space, and there will be nothing there to offer you a menu to choose Windows anymore either.
You'll get a black monitor background with white text on it: 'GRUB error 22'

Meaning, 'No such partition. This error is returned if a partition is requested in the device part of a device- or full file name which isn't on the selected disk.'  Grub won't be there anymore and you won't be able to boot Windows or any other operating system you might have installed. You'll just have one of those black screens with the white typing on it and a blinking cursor."

Taken from:

So please don't just format the Ubuntu partition.
The above link belongs to a page dedicated to uninstalling GRUB. It offers many different options that may interest you.
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

Hi there;


thanks very much for the information...I want to ask stg...

I had imaged a machine having a Windows and SP3 dual boot...I encountered a problem when i post the image to 90 machines...The GRUB has gone...So, my imaging software cannot retrieve the i reactivate it...Just from curiosity, when i reactivate it, is it reactivated to MBR...I don't think so but see i am not sure...I would be delighted if you enlighten me...

This may lead me the solution for this question that whatever happens to GRUB, don't care it...If you lose him, you won't lose the partitions and  from /boot/grub/grub.conf or menu.lst, you can reactivate it if needed...So, i had thought the GRUB is not a big deal and  i had tried FIXMBR and i cannot recover anything by this command...

So, if i were the asker, i would delete the grub.conf lines of Linux and then using Gparted, format the partitions, / and swap (if used)...

Best regards...

read this section from the webpage I posted above:

It explains very well how GRUB works and may have some answers to your question.

Normally, when you image a hard drive, the MBR is not included in the image. Most imaging software has to be especially configured to include it. That explains why your GRUB seemed to have been lost after restoring an image to another system. On reactivating, it was rewritten to the MBR.
kilgore661Author Commented:
I found this:

The section on using linux says this one command will do the trick:

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

which is the kind of solution I was looking for, but I don't completely understand it (yet), and given this is my main Windows machine I want to be really sure I either knew what I was doing or had the recommendation of an expert that it was OK.

Torrimar, the problem I have with your suggestion about the UBCD is that iirc you said that using this to do what I wanted to do was not something you had tried yourself. Is this right?
torimarConnect With a Mentor Commented:

you have a problem with using a suggested programme made for the purpose, but you are almost ready to use potentially harmful commands found somewhere on the internet? It is true that I never used the free MBR utilities assembled on the UBCD, but then: I never used FIXMBR either, because I don't usually play around with my MBR :)

The Linux "dd" command, in the hands of someone who doesn't fully understand it, is probably the most dangerous command in the IT world, more so than even "format c:". It directly and without warning writes data to a drive, overwriting whatever there was before. Which is why its nickname in the community is the "Data Destroyer".

In detail: the command line you have quoted will write exactly one chunk of 446 bytes from a NULL device to your hard drive; with other words, it will overwrite the first 446 bytes of your HDD with nothing, thus deleting the present MBR. This process will be irreversible.

I don't trust the website you found it on (they are sloppy in some of their other recommendations), but if you replace "sdX" by the correct drive identification (most likely either "hda" or "sda"), I should expect the command to work correctly.
However, saying this I have a much less comfortable feeling than when I suggest you look at the MBRTool ( and make yourself familiar with using it to create a backup copy of your present MBR before using it to replace the MBR by a standard MBR.

kilgore661Author Commented:
Hi Torimar,

"you have a problem with using a suggested programme made for the purpose, but you are almost ready to use potentially harmful commands found somewhere on the internet?"

No - that's why I posted the "dd" command on here - for experts to tell me more :-) And now I certainly won't be using it - thanks for the heads up.

I'm surprised that I haven't received a more clear-cut "Do this simple well-known thing" type of response. Well I suppose if I didn't insist on a non-windows solution then "use fixbmr" would have been it. I'll close this question in a couple of days and try what you suggest unless I hear more/different solutions.

Thanks for your efforts.
Manipulations of the MBR aren't a simple thing. If someone did propose a simple solution to you without issueing a word or two of warning, he would not be a trustworthy expert.

But here's a relatively simple thing I had forgotten about:
- Download and burn the Super Grub Disk (
- Boot from it
- Choose:
. Language and Help
. English Super Grub disk
. Windows
. Fix boot of Windows

This should do it. No backup would be made, but with the help of that boot disk you would easily be able to reinstall Grub, hence no lasting damage could be caused.

And no: I have not tested this either, because I currently have Grub installed and I am very happy with my setup, running SuSE, Ubuntu and soon Debian 5 alongside XP. I only take risks when unavoidable. But I know the Super Grub Disk (SGD) is in wide use among the Linux community and has a good reputation.

Then I just tested that MBRTool we were talking about, mainly because I wanted to know whether its bootup routines will recognize SATA drives. They do. The tool makes a good impression, but I noticed something I hadn't thought of before: making a backup of your current MBR will require a floppy drive installed. If none is installed, you have to specify the physical address of a sector on HDD that the backup should be written to - which, even for an expert, is far too risky to consider.

So in case you have no floppy drive, you might as well consider going with the SGD which would spare you the effort of learning to use MBRTool.
kilgore661Author Commented:
Hi Torimar,

I finally got around to trying the UBCD. Specifically I followed your instructions that end

". Fix boot of Windows

This should do it. No backup would be made, but with the help of that boot disk you would easily be able to reinstall Grub, hence no lasting damage could be caused."

This didn't seem to have any effect. In more detail, I chose the option for Windows XP and my sda disk  then the screen went black. I assumed that the machine was booting so I quickly removed the UBCD. The machine did indeed boot but took me back to GRUB.

I am certain that my machine boots from what Linux calls sda, but I do have a sdb, and I don't know how to tell for sure which disk it is booting from.
There seems to be a misunderstanding in this:
UBCD = Ultimate BootCD
SGD = Super Grub Disk

From what you report, you must have been using the Grub Disk, *not* the UBCD?

I was not aware of these additional detailed options, and I don't see how they should be necessary when it comes to simply wiping the MBR. So maybe the method they use differs from the wiping.

You can tell what partition your system boots from by typing:
sudo fdisk -l
in a Ubuntu prompt; the active bootable partition will be marked by an asterisk.

if you want to fix the MBR download free DOS and or DOS bootdisk
boot your pc with either one and at the command prompt, once loaded type fixmbr... although it could be fdisk /mbr

i dont' remember which one, just one download

although you may want to consider removing the linux partition at some stage if you just want to run windows. its really a waste of space if it's not being used.
kilgore661Author Commented:
The solutions were not complete and did not really take on board that I am a beginner. I looked at the tools referred to and they look useful to someone who knows more about Linux than me.

you were looking for a way to reset your MBR without using the XP install CD.
In my very first post here as well as in your old thread I told you that the UBCD contains a variety of tools capable of doing this; I especially mentioned the MBRTool and even specified a separate download location for it, in case you preferred to download just this tool alone.

MBRTool and all tools on the UBCD are NO Linux tools, they don't require ANY Linux knowledge. They hardly require more computer knowledge than using the Recovery Console and the FIXMBR command.
I would have even guided you through using MBRTool, but I had no chance, because you never seem to have downloaded it.

If you never tested the solution I first offered, how can you say it was not complete? And if you don't follow my instructions, what am I to do?
kilgore661Author Commented:
I did download the UBCD but chose not to use it because it looked too technical and as you said making changes to the MBR is not something to be done lightly. I accept that it was a mistake to call this an incomplete solution - it is an untested solution. I did not go on to test it to determine its completeness because you then suggested I use the Super Grub Disk, so I followed your suggestion and tried that. It didn't work in the way you said it would so I felt I was wandering into unknown territory again.

There is NO need to SHOUT at me.

I am 100% certain that my suggestion ID 22869005 would have solved the problem rightaway (especially if combined with ID 22884417).
However, since the requestee seems to have considered my advice "too technical", I'd rather see the whole thread deleted than leave it without a proper solution selected.

I'd like the points to be refunded to the requestee so that he can spend them on a better cause.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.