Product SiteDocumentation Site

16.3.2. Using the blkid Command

The blkid command displays information about available block devices, such as their file system type or universally unique identifier (UUID). For example:
~]$ blkid
/dev/sda1: UUID="5d170c31-0f14-4c7e-b72a-501b8f795bff" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda2: UUID="m9PwZw-Kwlz-VIRu-6TDh-zKjV-V3Ud-42IFuh" TYPE="LVM2_member"
/dev/sda4: UUID="TgN1Z5-5Qcx-cChP-A7Jx-v9DO-ZuTU-wAR0Uj" TYPE="LVM2_member"
/dev/mapper/vg_rhel-lv_home: UUID="abe1a729-2a72-4533-a9e8-77379d8d44c5" TYPE="ext4"
/dev/mapper/vg_rhel-lv_root: UUID="e2f60b08-f606-41ec-99cb-20550dde6aca" TYPE="ext4"
/dev/sda3: UUID="147bc2f6-edca-40b7-be05-092cda2e3993" TYPE="swap"
/dev/mapper/vg_test-lv_fedora_16: LABEL="_Fedora-16-x86_6" UUID="1d8b542a-e45c-4296-92c4-edaa8ef7dd7c" TYPE="ext4"
To display information about a particular device only, specify the device name on the command line:
~]$ blkid /dev/sda1
/dev/sda1: UUID="5d170c31-0f14-4c7e-b72a-501b8f795bff" SEC_TYPE="ext2" TYPE="ext3"
You can also use the above command with the -p and -o udev command line options to obtain more detailed information. Note that root privileges are required to run this command:
~]# blkid -po udev /dev/sda1
ID_FS_UUID=5d170c31-0f14-4c7e-b72a-501b8f795bff
ID_FS_UUID_ENC=5d170c31-0f14-4c7e-b72a-501b8f795bff
ID_FS_SEC_TYPE=ext2
ID_FS_VERSION=1.0
ID_FS_TYPE=ext3
ID_FS_USAGE=filesystem
ID_PART_ENTRY_SCHEME=dos
ID_PART_ENTRY_TYPE=0x83
ID_PART_ENTRY_FLAGS=0x80
ID_PART_ENTRY_NUMBER=1
ID_PART_ENTRY_OFFSET=2048
ID_PART_ENTRY_SIZE=4194304
ID_PART_ENTRY_DISK=8:0
For a complete list of available command line options, refer to the blkid(8) manual page.