tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: (Semi-random) thoughts on device tree structure and devfs

Iain Hibbert wrote:
On Tue, 9 Mar 2010, Johnny Billquist wrote:

The problem you are highlighting is another one, and one which I agree it
would be nice to have a solution to. But the only solution I can come up with
is to be able to refer to disks by their name in the disk label, or something
similar, which is unique per disk, and have no relationship at all with which
how they are attached to the system.

Something like:

wd0 at umass? label="foobar"

But, as I said, this is another problem, which Masao hasn't at all addressed.
His solution to his random device enumeration problem is simply a solution to
a non-problem.

So, you want to be able to mount a disk by the label:

  $ mount -t msdosfs -o label "foobar" /external_disk_foobar

or, if you know the UUID

  $ mount -t msdosfs -o uuid 3478374923723423 ~/thumb_drive

That would be equally acceptable. As long as it'n not just mount, but also fsck, and whatever else that deals with disks on a low level understands it.

What I'm asking is, why does the "device node" need to be deterministic
and why is this a 'devfs' problem?

The device node only need to be deterministic to the point that you can predictably get the same configuration on every boot. /etc/fstab is a typical example of a critical piece, that depends on this.

Think boot time - your system starts by doing some fsck on the disks in fstab, and then mounts them. If suddenly another disk gets the id of your root disk, the bootup will fail miserably until you fix fstab.

And having this fixed in the config/kernel seems like a much easier proposition than to make all possible potential tools that needs to be aware of this. Even tools that you might now know about, or even originate totally outside of NetBSD.

Since there is no really standardized library to access the raw devices, most programs simply just open a device node. How do you, at that point, make it find the right device node, with a disk that matches a specification that you give (be it disk label, uuid, or whatever).

The "special" argument to mount(8) does not really need to be a device
node, it could find the right one on its own by checking hw.disknames and
scanning the disklabels..

Yes. But it is not only mount that would need to be fixed.


Home | Main Index | Thread Index | Old Index