LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   erasing the MBR in linux (https://www.linuxquestions.org/questions/linux-general-1/erasing-the-mbr-in-linux-288683/)

TheOneAndOnlySM 02-10-2005 06:41 PM

erasing the MBR in linux
 
I have a harddrive with an MBR that refuses to allow me to install windows...

[Allow me to simply state that the sedistic reason for putting windows on this machine is simply because my friends want me to play gunbound with them... ]

I am without a floppy drive and have no spares to install, and have already formatted the factory-installed windows partition, so I cannot use the win98 bootdisk to issue fdisk /mbr . The windows installer also won't allow me to access a recovery mode without a bootdisk.

The windows pre-installer sees the sda device and copies its installer files to its correct partition, but when trying to run the installer from the harddisk, I either get garbled messages, errors about ntldr or a complete hang.

Is there any linux utility that will allow me to erase the mbr? I'm sure there's a way to directly edit the disk's raw data, but I'm not sure if that would damage the harddrive.

Thanks in advance!

syg00 02-10-2005 07:41 PM

dd if=/dev/zero of=/dev/sda bs=440 count=1
should do the job, and (hopefully) leave the partition table intact.

If I was to do such a thing I'd probably want to rebuild the part table anyway.

Standard disclaimers apply - I've not got myself into a situation where I have needed to do this.
Your disk, your decision.

harrygraham 02-10-2005 09:47 PM

try this
 
Have you tried booting your Windows CD? To do this you need to change the bios settings to boot the CD drive first. After the CD boots, try to escape all the gobbledegook wizardry and try to switch to the CD by typing "a:" (even though it's not really a floppy). If you get this far you can reinstall your Windows MBR with "fdisk /mbr". I think this is a lot safer than using Linux on your Windows MBR.


Harry

TheOneAndOnlySM 02-14-2005 09:15 PM

Hmm, blanking the mbr with /dev/zero didn't make any notable difference; the installer can once again still the drive and copy files to it correctly, and although the partition is active, the installer won't boot it after copying the initial files.

As for trying to switch to "a:" from the cd, I can't seem to get this to work? Did you do this while setup is asking "press F6 to install 3rd party raid or scsi driver" "press F2 for automated system recovery"?

In any case, the problem now extends to the windows installer, beyond the scopes (and sanctity) of this forum :-D . I'll ask around at a windows forum.

Thanks!

twantrd 02-14-2005 10:01 PM

Never really got into a situation where I needed to do this but if you find the answer, post back here so we know how to do it as well :). Thanks..

-twantrd

JoannesX 02-15-2005 07:48 AM

hello guys..
haven't you got a winXP cd? if no, get it.. it's easy!
so boot your machine with this cd in the drive.. (don't forget to adjust BIOS settings)
after a normal process of data, you should be taken to a screen asking you three things:
1 Install Win XP
2 Repair an installation
3 Exit

Ok choose "repair" and wait for the console...
in the prompt try FIXMBR

it should clean up your MBR...


All times are GMT -5. The time now is 08:51 PM.