Subject: Re: sd rereads
To: Chris G. Demetriou <>
From: Manuel Bouyer <>
List: tech-kern
Date: 09/01/1999 18:15:02
On Wed, Sep 01, 1999 at 08:23:53AM -0700, Chris G. Demetriou wrote:
> Manuel Bouyer <> 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.

I'd call it 'an annoying feature' :)

> 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.

Unless we provide some way (ioctl) to invalidate the in-core disklabel.

> 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
> last-close-of-all-partitions.

Well, I'd really prefer if the in-core label was sticky by default, and
we provide a way to re-read it from disks from tools which need it
(either via calling the rigth ioctl or disklabel with the rigth option).

Loosing the in-core label which has been setup because the last partition
was unmounted is unpleasant, at last.

Manuel Bouyer, LIP6, Universite Paris VI.