blkid -o export /dev/sdb1

Category: Administration

blkid -o export /dev/sdb1

Print filesystem metadata as key-value pairs

Outputs the UUID, type, and label of /dev/sdb1 in VAR=value format, easy to source in shell scripts. The UUID identifies the filesystem regardless of device name, which is why fstab entries often use UUID= rather than /dev paths.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.