User: Password:
Subscribe / Log in / New account

The return of devfs

The return of devfs

Posted Oct 5, 2009 7:47 UTC (Mon) by cmccabe (guest, #60281)
In reply to: The return of devfs by epa
Parent article: The return of devfs

> Which makes you wonder why the disk label names have to be checked in some
> magic way, rather than just being exported by the kernel under
> /dev/disklabel/xxx.

If you're running a non-ancient system with udev, you can find all the disks by label under:


Actually, come to think of it, I'm not sure why the LABEL=foo hack was ever implemented. There must be a reason but I don't know it.


(Log in to post comments)

The return of devfs

Posted Oct 6, 2009 0:07 UTC (Tue) by nix (subscriber, #2304) [Link]

Firstly, LABEL= predates udev. Secondly, LABEL= works even before udev has
initialized. Thirdly, it works on systems without udev. (udev and mount
don't yet use the same probing library, but this is changing, I

The return of devfs

Posted Oct 18, 2009 22:43 UTC (Sun) by cmccabe (guest, #60281) [Link]

Ah, that makes sense. Thanks.


The return of devfs

Posted Apr 2, 2010 11:15 UTC (Fri) by skitching (subscriber, #36856) [Link]

Hi nix,

You mention in your comment that "root=LABEL=" work even when there is no udev.

Does this also apply to "root=UUID="?

And would you be able to give me a hint about where to find that code? All the relevant rootfs mounting bits appear to be in init/do_mounts.c, but I can't find anything related to handling LABEL or UUID. Function name_to_dev_t maps things like "root=08:05", "root=0x0805", "root=/dev/sda5" to a (major,minor) but I can't see UUID/LABEL handling anywhere.

Thanks, Simon

The return of devfs

Posted Apr 2, 2010 12:09 UTC (Fri) by hppnq (guest, #14462) [Link]

I'm sure nix will have more useful information, but you could take a look at libblkid in the meantime. This is used by mount to find devices identified by label or uuid (check the util-linux source).

The return of devfs

Posted Apr 3, 2010 0:50 UTC (Sat) by nix (subscriber, #2304) [Link]

I never mentioned root=. For everything *other* than root filesystem
mounting, the code to look at is libblkid, which supports both LABEL= and
UUID=. That's what mount(8) uses.

Raw non-initramfs/initrd kernel root= parameterwise, all that is supported
in /dev/{fake device name}, root={major:minor}, and
root={major*256+minor}. This is of course yet another reason to use an
initramfs, which can easily use normal mount and/or blkid directly to
support whatever permutations of LABEL=, UUID= or whatever you prefer.

Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds