Subject: Re: sd rereads
To: Manuel Bouyer <firstname.lastname@example.org>
From: Chris G. Demetriou <email@example.com>
Date: 09/01/1999 08:23:53
Manuel Bouyer <firstname.lastname@example.org> writes:
> I think I know why it does this: for disks without NetBSD disklabel,
> you can but an incore disklabel (disklabel, mbrlabel, ...) but then you
> had to keep a partition open, otherwise the in-core label would be lost.
Fine, great. This is documented as an alleged bug in the mbrlabel
manual page, but in fact it's _not_ a bug.
If you do this, you can e.g. never sanely clear the disklabel on-disk
and have the kernel re-provide you with a default.
Further, your suggestion of disklabel -r (presumably to read the
disklabel), that's totally bogus. it _does not_ as far as I can tell
set the kernel disklabel. There's no guaranteed way to be able to set
the kernel disklabel without:
(a) giving disklabel(8) the opportunity to write it, on most
ports, either via the kernel interface or the raw disk, or
(b) writing a program that just sets the in-core label.
It's not right to have to use disklabel, or to have a new program that
does it. For all the kernel can assume, you dd'd an entire new disk
image, complete with disklabel, to the disk.
If the kernel, for any disk driver, keeps the label across last-close
of all partitions on the disk, it's broken. If somebody wants to add
an option to set a sticky in-core label, that might be a good idea,
but aside from that the label should be cleared at every
Chris Demetriou - email@example.com - http://www.netbsd.org/People/Pages/cgd.html
Disclaimer: Not speaking for NetBSD, just expressing my own opinion.