Subject: Re: mbrlabel problem
To: None <tech-kern@netbsd.org>
From: Pavel Cahyna <pcah8322@artax.karlin.mff.cuni.cz>
List: tech-kern
Date: 09/16/2005 23:51:45
On Fri, Sep 16, 2005 at 10:44:58PM +0100, David Laight wrote:
> On Fri, Sep 16, 2005 at 11:16:39PM +0200, Pavel Cahyna wrote:
> > On Fri, Sep 16, 2005 at 09:13:31PM +0100, David Laight wrote:
> > > You might find you can copy the label to where the alpha system will
> > > find it, eg:
> > > # dd if=/dev/sd2c skip=64 seek=1 count=1 of=/dev/sd2c
> > > (I suspect the kernel scans the first 8k of the disk looking for a label)
> > 
> > BTW thanks for your suggestion, but it doesn't work. Kernel still prints:
> > "sd2: no disk label" and there is only the "c" partition... I tried even
> > detaching and re-attaching the disk.
> 
> Hum....
> 
> Looks like the alpha kernel only looks for the label at offset 64 in sector 0.
> You might manage to copy the label there (probably via a file to get the
> offset correct, and with care because the kernel will try hard to stop you
> writing to the label sector).
> 
> Actually you can run the alpha disklabel to setup a label that describes
> sectors 63 - 6Gb as an FFS partition.
> That will make the disk not bootable.  It will also (probably) destroy
> the mbr partition info.  However I believe the code that the i386 kernel
> uses (in kernel/subr_disk_mbr.c) will find that label.

I already did that (including the destruction of the mbr partition info -
I believed diskabel would update only the in-core label like mbrlabel -w,
which it did not.) Now I will try to copy the complete disklabel there to
reveal other partitions. Thanks again for your suggestions. But the output
from mbrlabel which started this discussion still seems nonsensical to me.

Pavel