Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
[SOLVED] How can I get from a disk UUID to a device name?
The blkid command will give you the info, but I'm not too sure how you would implement it into your program. Maybe somehow you could parse the into of blkid command and filter out only the info you want.
Thanks, Mike! That wasn't quite the answer but it led me to a possible answer.
The man page for blkid(8) has a cross-reference to libblkid(3), which describes the file /etc/blkid.tab where this information is stored. Basically I need to write a more complex parsing routine for fstab which picks up device names directly but passes UUIDs to a secondary search function. This would look them up in blkid.tab (probably using strstr()) and would return the device name from there. Complicated but doable.