LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Removing bootloader from within Linux or CD. (https://www.linuxquestions.org/questions/linux-general-1/removing-bootloader-from-within-linux-or-cd-365824/)

dalek 09-22-2005 02:51 AM

Removing bootloader from within Linux or CD.
 
Well, this may or may not have been asked before but if it has I can not find it. I installed Linux on a friends rig but I need my hard drive back. She was supposed to buy one of her own but never did.

This is the setup. She has two hard drives, one with windoze XP and one with Gentoo Linux. Linux is on the second hard drive, grub is installed on the MBR of the drive with windoze XP on it. The Linux drive is the one I need back. Naturally if I just remove my drive it will not find the /boot with the grub file, I assume I will just get a error message though I never tried it.

She doesn't have the original XP CD, she lost it, so I can not boot the CD and just let it wipe it out real quick. Is there a way to erase the MBR and therefore grub from the drive from within Linux or from the Gentoo CD maybe? Is there a way to do it from within windoze without the CD? I just want to get rid of the bootloader so it will just boot windoze and I can remove the drive again.

Oh, I don't need to mess up windoze either. She doesn't have a CD remember, no way to install again if it gets messed up.

Thanks

:D :D :D :D

Stan the caddy 09-22-2005 03:23 AM

Well in windows open a "terminal" and try
Code:

fdisk /mbr
I dont know if you have to be in the rescue cd for that to work or not though.

To do it from linux i belive
Code:

dd if=/dev/zero of=/dev/hda bs=512 count=1
should do it.

kees-jan 09-22-2005 06:04 AM

Uh....
That last command will erase the master boot record, rendering your disk unbootable. I'd recommend against trying that :-)

Basically, you can't "erase" the master boot record. Best you can do is write something else over it, be it zeroes (as in the example above, rendering your disk unbootable), or a "standard" windows MBR, using fdisk /mbr or fixmbr or whatever.

Groetjes,

Kees-Jan

dalek 09-22-2005 12:02 PM

What if I make a bootable floppy. like a DOS disk but from windoze XP, will it have the fdisk command and then run it from that?

If I have read correctly, the above command fills the MBR with O's and does the same thing as fdisk /mbr or fixmbr with windoze. I have never used it though.

Has someone ever used the dd command and had it work for them? I need to know if someone actually did this or not though. I don't want to have to go buy a copy of Windoze XP so I can reinstall windoze on her rig.

Thanks

:D :D :D :D

XavierP 09-22-2005 12:47 PM

I get my boot floppys from www.putergeek.com and they have never failed me. Get a Win 98 one, boot from it and run "fdisk /mbr" and the boot loader will be removed.

dalek 09-22-2005 01:58 PM

XavierP, have you ever used the dd command to do this? You ever seen or heard first hand of someone using that command and it being sucessful?

Mostly curious now. I have a win 98 CD and a old hard drive that I can install it on to get the floppy. Hmmm, I have a neighbor that is using my rig with windoze 98 on it too. I can just run up there and get one from it.

Still wondering about the dd command though. I read the man page and it sounds like it does erase the first 512 bytes of the drive which is the MBR.

Thanks

:D :D :D :D

XavierP 09-22-2005 03:16 PM

I have never used dd. Normally because my system gets so hosed that I give up and start from scratch :) LQ members have reported that it's worked, though I'd use a test box first to ensure that the right thing gets deleted!

dalek 09-22-2005 06:24 PM

Well, I called and talked to the new guy and told him I wanted to come get my drive, he wants to use Linux too. The lady that owns the place may get the same story from him that she got from me.

Just so you know, she owns a local newspaper and needs Scribus to replace Quark. She has a very public email address, it's on the newspaper :rolleyes: , so she gets a ton of spam and viruses. She gets several hundred emails a day, 80% of which is spam or virus stuff. Weekends, she can easily get close to 2,000 emails. She had to get broadband just because of the email. It would take all of Monday morning just to download the email. Paper has to be out on Tuesday so she needs it first thing.

That's the story. I may not get my drive back for a while longer. LOL

:D :D :D :D


All times are GMT -5. The time now is 11:20 AM.