Locate/print block device attributes (file system type, LABEL, UUID, etc.).
In Linux, the blkid command can be used to query the file system type used on a device. blkid is primarily used to query information such as the file system type, LABEL, and UUID used by the system's block devices (including swap partitions). To use this command, the e2fsprogs package must be installed.
blkid -L | -U
blkid [-c <file>] [-ghlLv] [-o <format>] [-s <tag>] [-t <token>] [-w <file>] [<dev> ...]
blkid -p [-s <tag>] [-O <offset>] [-S <size>] [-o <format>] <dev> ...
blkid -i [-s <tag>] [-o <format>] <dev> ...
-c <file> # Specify a cache file (default: /etc/blkid.tab, /dev/null = none)
-d # Don't encode non-printing characters
-h # Display help information
-g # Garbage collect the blkid cache
-o <format> # Specify the output format
-k # List all known filesystems/RAIDs and exit
-s <tag> # Display specified information, defaults to all information
-t <token> # Find device with a specific token (NAME=value pair)
-l # Look up only the first device with the token specified by -t
-L <label> # Convert LABEL to device name
-U <uuid> # Convert UUID to device name
-v # Display version information
-w <file> # Write cache to a different file (/dev/null = no write)
<dev> # Specify device(s) to probe (default: all devices)
Low-level probing options:
-p # Low-level superblocks probing (bypass cache)
-i # Gather information about I/O limits
-S <size> # Overwrite device size
-O <offset> # Probe at the given offset
-u <list> # Filter by "usage" (e.g., -u filesystem,raid)
-n <list> # Filter by filesystem type (e.g., -n vfat,ext3)
sudo blkid
sudo blkid -s UUID /dev/sda5
sudo blkid -s UUID
sudo blkid -s LABEL /dev/sda5
sudo blkid -s LABEL
sudo blkid -s TYPE
sudo blkid -o device
sudo blkid -o list