Undo MBR
Andrew L. Gould
algould at datawok.com
Thu Sep 4 08:41:07 PDT 2003
On Thursday 04 September 2003 09:35 am, Jerry McAllister wrote:
> Hi,
>
> > I have just installed FBSD-CURRENT on a test box. During install I
> > unwittingly installed a BootMgr entry for the second HDD (it will
> > just be a data disk, no need to boot from it).
> >
> > If I do 'dd if=/dev/zero of=/dev/rad2 count=15' will this "erase" the
> > BootMgr or will I have to redo Fdisk and etcetera. There is no data
> > on the disk yet so this would be no hardship, but is there a "proper"
> > way of doing what I want?
>
> So, if there is nothing to be lost, just try it out and see what
> happens. Smoke testing is a tried and true technique.
>
> Anyway, you really don't need to bother, but yes, that should wipe it.
> There are some examples at the bottom of 'man disklabel' that you
> might want to check out - even though you really are talking about
> fdisk stuff. The fdisk man page is weak, for example it doesn't even
> document the -I switch (tho it lists it at the top) which is what you want.
> You kind of have to read the disklabel man page in conjunction with the
> fdisk man page to make any sense of things, and then it may still take
> some experimenting.
>
> From man disklabel:
>
> dd if=/dev/zero of=/dev/da0 bs=512 count=32
> fdisk -BI da0
> dd if=/dev/zero of=/dev/da0s1 bs=512 count=32
> disklabel -w -B da0s1 auto
> disklabel -e da0s1
>
> Completely wipe any prior information on the disk, creating a new
> bootable disk with a DOS partition table containing one ``whole-disk''
> slice. Then initialize the slice, then edit it to your needs. The dd
> commands are optional, but may be necessary for some BIOSes to
> properly recognize the disk.
>
> Actually, the first dd sometimes fails, if the disk has never had
> anything put on it. If so, just ignore it and go on with the fdisk.
>
> ////jerry
If you have a bootable DOS disk with fdisk, you can clear the MBR without
destroying partitions by executing:
fdisk /mbr
In my pre-FreeBSD days, I used to do this to clear LILO out after removing a
Linux installation so that it would boot to Windows.
Best of luck,
Andrew Gould
More information about the freebsd-questions
mailing list