blkid
Identify block device attributes
TLDR
List all block devices with attributes
$ sudo blkid
List all partitions in a table including mountpoints$ sudo blkid -o list
Get the UUID of a specific partition$ sudo blkid -s UUID -o value [/dev/sdXY]
Get the filesystem type of a partition$ sudo blkid -s TYPE -o value [/dev/sdXY]
Look up device by label$ sudo blkid -L [mylabel]
Look up device by UUID$ sudo blkid -U [uuid]
Probe device bypassing cache$ sudo blkid -p [/dev/sdXY]
SYNOPSIS
blkid [-o format] [-s tag] [device...]
DESCRIPTION
blkid lists all recognized partitions and their attributes including Universally Unique Identifier (UUID), filesystem type, and label. It uses the libblkid library to locate and identify block devices.
PARAMETERS
-o, --output format
Output format: full, value, list, device, udev, export-s, --match-tag tag
Show only the specified tag (UUID, TYPE, LABEL, etc.)-c, --cache-file file
Read from specified cache file instead of default-g, --garbage-collect
Perform garbage collection on the blkid cache-l, --list-one
Look up only one device matching parameters-L, --label label
Look up device by filesystem label-U, --uuid uuid
Look up device by filesystem UUID-p, --probe
Low-level superblock probing mode (bypass cache)-i, --info
Print I/O limits (sector size, etc.)-t, --match-token NAME=value
Search for block devices with tokens named NAME that have the specified value-n, --match-types list
Restrict probing to a comma-separated list of superblock types-u, --usages list
Restrict probing to a comma-separated list of usage types (filesystem, raid, crypto, other)
CONFIGURATION
/etc/blkid.tab
Default cache file storing previously detected block device attributes./run/blkid/blkid.tab
Runtime cache location on systems using tmpfs for /run.
CAVEATS
Output format varies by option. Running without arguments shows all block devices. Results may be cached; use -p for live probing.
HISTORY
Part of util-linux package. Developed to provide a unified interface for identifying block device attributes.
