Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Jun 1999 23:11:10 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        FREEBSD-FS@FreeBSD.ORG, K980705@atlas.kingston.ac.uk
Subject:   Re: crashed disk
Message-ID:  <199906071311.XAA17525@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>I have noticed similar comments in this forum; to the effect that the 
>disklabel stored on the disk is different from the one stored in 
>FreeBSD for the same disk.
>I used: 
>
>$disklabel wd2
>
>and
>
>$disklabel -r wd2
>
>Can any one shed any light on the matter?

This is probably caused by disklabel(8)'s search for the label being
inconsistent with the kernel's search, and the label not being in its
usual place because you moved it using fdisk or the disk is a foreign
one.  disklabel(8) searches for the label at each 16-byte boundary in
the entire "boot area" (8K beginning at byte offset 0 in the slice).
The kernel searches at each 4-byte boundary in the sector at sector
offset LABELSECTOR in the slice.  On i386's, LABELSECTOR is 1 and the
sector size is normally 512 (other sizes are unusual but possible),
so the kernel's search area is quite different from disklabel(8)'s.
There is normally no problem because sector 0 doesn't contain a label
for disklabel(8) to find, and disklabel -r isn't very useful anyway
(except for writing the initial label, when there is no problem).

Labels not in their standard place on a slice will also appear to be
different because i/o for them is not snooped on.  The kernel converts
offsets in labels from absolute to relative even for raw i/o, so that
`disklabel -r' and copying of whole slices works right.  The conversions
aren't done for misplaced labels or for copying whole disks.

Bruce


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




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