I was searching for the best way to find a partition UUID. It turns out, there are lots of ways to do it, some of which are now obsolete.
My requirements were that I wanted something usable from normal users and available on major distros by default. This rules out blkid that is now regarded as the “golden standard” (and looks like a good and useful tool to me). But it’s not available on Fedora by default and it requires root privileges.
So I spent a few hours searching and trying various methods. Seems like vol_id, blkid predecessor, is now vanished from major distros, so it was not an option.
I didn’t want to use the symlinks in /dev/disk/by-uuid/ because it required a lot of searching around to find which device they are pointing to (the link points to the real block device, but often you mount a symlink, like it happens with LVM). This is the most portable and available solution.
Then I found this page that documents another method: using udevadm you can find a whole lot of informations about each partition. It’s available on both Debian/Ubuntu and Fedora and it doesn’t require root privileges. So, my current cmdline is:
user$ udevadm info -q all -n <partition>