# removing GRUB



## dustyjay (Jan 24, 2003)

I willbe moving my linux (Simply Mepis) to a different computer in a few days. Making a dedicated linux machine. I want to remove it from my existing computer. I know that repartioning the drive it is on will clean it from this machine, question is, so that I dont have to go through the process of reinstalling windows, how do I remove the GRUB from the MBR? I know from past experience that if I just remove linux that the grub will error out with a error code 17 and not allow me to boot my computer. 

Any help would be appreciated.

I am running winXP Home SP2.


----------



## saikee (Jun 11, 2004)

Dead easy

Just insert a DOS bootable floppy with fdisk.exe inside and then type 

fdisk /mbr.

If you haven't got a DOS floppy them use XP installation CD, drop into Recovery console, type

fixmbr

Exit ,reboot and Windows will be back to the stage before you install GNU/Linux.

You remove a bootloader with another. You can get back Grub anytime you want too. Just give a shout.


----------



## dustyjay (Jan 24, 2003)

Thanks Giving it a try now

I appreciate the quick response.


----------



## jiml8 (Jul 3, 2005)

You should also be aware that repartitioning will not certainly clear Grub. No reason to, and most partitioning programs that I am aware of won't change it.


----------



## tsunam (Sep 14, 2003)

the boot loader lies in the MBR, and since any partitioning program won't affect that..it'd not have any reason to do it.


----------



## dustyjay (Jan 24, 2003)

I knew this, I was just mentioning that I was going to remove linux from this machine by deleting the linux partitions. Linux is on a separate drive ,then partitioning the drive and formatting it. I had done this before but it always left the grub. That is why I was asking how to get rid of the grub. The recovery console and fixmbr did the trick.

Thanks for the replies and info though.


----------



## selvashankar (Nov 24, 2005)

great post
fixmbr works like charm...
thanks a lot guys...


----------



## talon03 (Apr 26, 2005)

ah great, I sometimes have problems with re-installing xp and then having to re-install my linux just to get the boot loader back on..... but now I know how to get it off!


----------



## saikee (Jun 11, 2004)

A partition if created will always reserve the entile sector 0 as the boot sector. This area is excluded from the filing system. It is the ideal location to store the boot loader of a Linux. If the Linux is shouldered with the task to multi-boot then one simply replicates its boot loader into the MBR.

Grub does this by --->grub-install /dev/hda
alternatively one can invoke the Grub shell inside the Linux and type
root (hdi,j) <---- telling Grub to source Grub data from roof (hdi,j)
setup (hd0) <-----tell Grub to replicate the boot loader in MBR

Lilo does this by --->lilo -b /dev/hda

The replication of MBR by Windows is done either by a DOS floppy or a Win2k or XP installation CD. The latter is a snobbish method which can be used to restore a dead DOS's MBR.

I happen to believe Windows MBR has been given undue prominence because any of MS system can be booted up without the use of the MBR.

A Grub floppy "unattached" to any operating system can be used to boot any system (see Grub Manual Chapter 3.1. In combination with a free software called Grub4Dos one can even boot up from a DOS floppy, cd to a FAT16 partition and launch Grub to boot any system in a PC, without using the MBR.


----------

