Subject: Re: mounting filesystems from within the MBR extended partition
To: None <netbsd-users@netbsd.org>
From: Klaus Heinz <k.heinz.jun.zwei@onlinehome.de>
List: netbsd-users
Date: 06/27/2002 22:00:32
Malcolm Herbert wrote:

> |I'm using (from memory)
> |
> |mbrlabel -w /dev/rwd2

If there is no NetBSD partition on this disk, this won't work. There is no
place to write the label.

> |mount /dev/wd2a /mnt
> |
> |mount tells me that /dev/wd2a isn't available ... there is also a note

As far as I know, the in-core disklabel is only valid, as long as the system
is using the disk in any way. Afterwards it discards this disklabel and
constructs it again when necessary.

> |from the kernel to say that wd2 has no disk label which I already know,
> |so mount or the kernel must be trying to recreate the in-core disk
> |label (trashing the modifications that mbrlabel made)
> |
> |... so if mbrlabel is modifying the in-core disklabel for this drive,
> |as it says it is, then why isn't it working?  How do I get mount to use
> |the in-core label rather than looking on disk again?

You have to 'use' the disk, e.g. by doing this:

   $ sleep 100 < /dev/rwd2d &

Subsequently using 'mbrlabel' should modify the (temporary) disklabel,
which the kernel will not discard.
Then you can 'mount /dev/wd2a /mnt', which will prolong the usage
of wd2 (and the temporary disklabel) until you unmount the partition.

I think a procedure like this was mentioned in an earlier version of the
man page for 'mbrlabel'.

ciao
     Klaus