Disk
blkid
Show block device identifiers such as UUID, label, and filesystem type.
diskuuidfilesystempartitionstorage
Additional Notes
blkid prints identifiers for block devices. It is commonly used to find UUIDs, labels, and filesystem types for disks and partitions.
UUIDs are often used in /etc/fstab because they are more stable than names like /dev/sda1.
Syntax
blkid [options] [device...]
Parameters
options: Flags that change howblkidbehaves.device: Disk, partition, volume, or filesystem path to inspect or modify.target: Mount point, file, or storage object used by the operation.
Common Options
-o value: Print only values.-s TAG: Show only a specific tag such asUUID,LABEL, orTYPE.-p: Probe a device directly.-L LABEL: Look up a device by label.-U UUID: Look up a device by UUID.
Examples
sudo blkid
Show identifiers for detected block devices.
sudo blkid /dev/sda1
Show identifiers for one partition.
blkid -s UUID -o value /dev/sda1
Print only the UUID value.
blkid -U UUID-HERE
Find the device with a UUID.
lsblk -f
Alternative overview showing filesystem data.
Practical Notes
- Use UUIDs in
/etc/fstabfor reliable mounting. - Confirm device names before formatting or mounting.
- Some
blkidoutput may require root privileges. TYPEshows filesystem type, not partition table type.