Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If I come across a system that uses a label in /etc/fstab instead of a device like /dev/sda1 how do I go about finding out which label is associated with which partition. For instance in an /etc/fstab there is a line like this:
Label=/logs /var/log ext3 defaults 1 2
How do I go about finding out exactly which partition on the disk is associated with that label ? Is there a map kept someplace ?
The forward slash doesn't look like a legal character. However by mounting by label or uuid, the fstab entry will be valid even if you repartition the drive, or if the device is external and gets a different device node the next time you plug it in.
You can get the label, uuid and filesystem information using the "udevinfo" program. You don't need to run it as root.
For example, if you what the information for the device & filesystem for /dev/sda5:
udevinfo -q env -n /dev/sda5
There are other options besides (-n) such as for using the /sys/ filesystem, the that type of query doesn't use the /sys/ part of the directory name so tab completion doesn't work.
If you don't have udev installed, then the /dev/disk/by-* links won't be created either and you need to stick to the normally named devices instead of auto created links to then same devices. The udevd daemon is what auto creates the device links.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.