Under Linux You can use the Blkid command to query the file system type used on the query device. Blkid is mainly used to query the file system type, LABEL, UUID, etc. used by the system's block devices (including the swap partition). To use this command, you must install the E2fsprogs package.
Use Blkid directly to list the types of file systems that are already mounted on the current system.
By default lsblk will output a block device in a tree format:
Name of the name--device
Each device in the Maj:min--linux operating system is represented as a file, and for a block (disk) device, the device is described here with a primary and secondary device number.
rm--removable devices. If this is a removable device will display 1, otherwise show 0.
Types of type--devices
Location of mountpoint--device mount
ro--for read-only file systems, this will show 1, or 0.
Capacity of size--Equipment
Blkid Use Example:
The code is as follows:
[Root@localhost ~]# blkid-s uuid/dev/sda5 #显示指定设备 UUID
/dev/sda5:uuid= "Cad7349a-601d-4df4-a46b-90e1ffc29b1b"
The code is as follows:
[Root@localhost ~]# blkid-s uuid #显示所有设备 UUID
/dev/sda5:uuid= "Cad7349a-601d-4df4-a46b-90e1ffc29b1b"
/dev/sda1:uuid= "d7899bc2-b08e-48cd-b904-54956c085951"
The code is as follows:
[Root@localhost ~]# blkid-s label/dev/sda5 #显示指定设备 LABEL
/dev/sda5:label= "Disk E"
The code is as follows:
[root@localhost ~]# blkid-s label #显示所有设备 label
/dev/sda1:label= "M-fm-^vm-0m-em-^jm-m-em-^mm-7"
/dev/sda5:label= "Disk E"
The code is as follows:
[Root@localhost ~]# blkid-s TYPE #显示所有设备文件系统
/dev/sda5:type= "Swap"
/dev/sda1:type= "Ext4"
The code is as follows:
[root@localhost ~]# blkid-o device #显示所有设备
/dev/sda5
/dev/sda1
The code is as follows:
root@tnak-virtualbox:/home/tnak# blkid-o list #以列表方式查看详细信息
Device fs_type label mount point  UUID
------------------------------------------------------------------ ---------------------
/dev/sda5 swap cad7349a-601d-4df4-a46b-90e1ffc29b1b
/dev/sda1 ext4/ d7899bc2-b08e-48cd-b904-54956c085951