Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Oct 1998 12:43:33 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        ccsanady@friley-185-114.res.iastate.edu, dan@math.berkeley.edu
Cc:        current@FreeBSD.ORG
Subject:   Re:  Partition weirdness..
Message-ID:  <199810050243.MAA17879@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>second sector of a disk slice (i.e. DOS partition).  Disk label sectors
>are special and the disk drivers normally refuse to write them.
>You are supposed to be able to turn off this protection with the
>"disklabel -W" command, though this never seems to work for me.

It turns back on on close or thereabouts.  This is easy to work around
by not closing (e.g., sleep 1000 </dev/rsd0c; disklabel -W sd0).

>I have discovered (the hard way) that disk label sectors are also
>special because the I/O system munges them when you read them.
>It subtracts the slice base address from the bsd partition base
>addresses in the label.  I suspect it also recomputes the label
>sector checksum, though I don't remember specifically checking
>for this.  It does not reverse these changes when you write
>a label sector for the first time.

Oops.  There's nothing to reverse the first time, but it should add
the slice base address.  It only adds the slice base address for
labeled slices, and the slice is still unlabeled when the i/o munging
is done.  This is for direct writes.  The fixup is always done for
writes for label ioctls, and it somehow gets done for direct writes
by disklabel(8).

>I present these possibly unintended features as an example of
>what I think is a generally good design principle:  An unnecessary
>and complex feature is usually a bad idea.  It is often much
>better to have no feature at all.

Absolute offsets for sectors in on-disk labels is 386BSD misfeature.
The label fixups are supposed to make it transparent.

Bruce

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



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