Results 1 to 3 of 3
Is there any C function that will translate UUIDs into device names? I have a little graphical mount tool that can read user-mountable device names from /etc/fstab and lets you ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 10-04-2010 #1
[SOLVED] How can I get from a disk UUID to a device name?
- 10-04-2010 #2
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.
- 10-05-2010 #3
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.