Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Apr 95 08:09 WET DST
From:      pete@pelican.com (Pete Carah)
To:        current@FreeBSD.org
Subject:   Re: Label/slices : how to add a disk ?
Message-ID:  <m0rwtBa-000K0iC@pelican.com>
In-Reply-To: <199504061345.XAA21963@godzilla.zeta.org.au>

next in thread | previous in thread | raw e-mail | index | archive | help
In article <199504061345.XAA21963@godzilla.zeta.org.au> bde writes:
....
>For this to work, you have to have a disk that doesn't have a partition
>table.  This is easy to arrange by overwriting the partition table:
>	dd if=/dev/zero of=/dev/rsd2 count=1
>to clear the MBR or

>	dd if=/dev/zero of=/dev/sd2 bs=1 seek=46 count=66
                                              ^^ this can't be right.

The table ends at byte 510 - the seek must be 446 (and 66 will wipe
the signature too; if you want the bootstrap to work with another
table you need that back.)  46 will write in the code area.

>to clear the partition table (leaving the bootstrap intact) or

>	dd if=/dev/zero of=/dev/sd2 bs=1 seek=510 count=2
>to clear only the partition-table-valid magic.

Actually that is the bootstrap-code-valid magic; an all-0 partition
table *is* valid for no allocated partitions.  Presuming this to
flag the table as valid is true (it actually flags both) but nuking
it will make any Microsoft/IBM fdisk (maybe not ours) overwrite the
code too later.  I don't know what dos does with a valid table and no
boot code and no signature; I've never tried it...

There is a related problem with floppies with valid BPB's with no boot
code, and no signature; our pcfs driver doesn't recognize them as dos
floppies (because of the no signature), thus making about half the brands
of preformatted floppies not work with pcfs.  (they properly don't have
the signature, so they don't fool the bios into branching into the block
of 0's above the BPB.  DOS and OS/2 both use them just fine as FAT
filesystems.)  This comes from using the signature for two separate
purposes...

-- Pete



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?m0rwtBa-000K0iC>