Subject: Re: disklabel won't! (WAS: Re: Bootability eludes me once again)
To: Anne Bennett <anne@porcupine.montreal.qc.ca>
From: Roland Dowdeswell <elric@imrryr.org>
List: port-i386
Date: 02/23/2003 14:50:53
On 1046023914 seconds since the Beginning of the UNIX epoch
Anne Bennett wrote:
>
>I do believe that there may be a bug in the DIOCWDINFO ioctl, though.
>I looked a bit at disklabel.c, and, as per the comment in it, the
>disklabel is read differently based on the flags. If "-r" or "-I" is
>given, the disk label is read from the raw device using an offset
>calculated in disklabel.c; that worked properly all along. If neither
>of those flags in specified, then the DIOCWDINFO ioctl is used to
>fetch the label, and that failed until I zeroed out part of my disk
>and reinstalled the MBR and disklabel from scratch. Therefore, it
>seems as though DIOCWDINFO is confused by the presence of additional
>label or MBR-like material on the disk.
Well, the logic in disklabel(8) is a bit more complicated that the
logic in the kernel. disklabel -r will scan the front or the disk
[using the raw device] for the disklabel, whereas the kernel will
look for the disklabel in a fixed position. You notice this
especially if you move a disk from, e.g. an alpha to an i386.
disklabel -r will find the alpha's disklabel, but the kernel will
not because on the i386 the disklabel is offset from the start of
the partition whereas on the alpha it isn't.
--
Roland Dowdeswell http://www.Imrryr.ORG/~elric/