Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Apr 1995 02:07:45 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        current@FreeBSD.org, pete@pelican.com
Subject:   Re: Label/slices : how to add a disk ?
Message-ID:  <199504061607.CAA26085@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>>	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

I meant to type 446.  It's important to clear the signature because the
driver interprets the signature as belonging to the table and not to the
bootblock (there's no better way to tell if the partition table is
supposed to be valid) and an empty table means that there are 4 empty
slices, not that the whole disk is for BSD.  I forgot to say that when
you write a boot block, the signature will come back together with a
bogus partition table.  The driver interprets the combination of the
particular bogus table and the signature as a big signature saying that
the whole disk is for FreeBSD.

>>	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...

I assumed that the signature would always come back if the whole disk
is used for BSD, but it doesn't come back if you never run fdisk and
only run disklabel without -B.  I don't know what other fdisks do with
the bogus partition table.  I assume that people who want to use a
purely for BSD won't allow foreign fdisks near 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 file system iscalled msdosfs now :) and still has this check :(.

Bruce



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