blkid - 查看块设备的文件系统类型、LABEL、UUID等信息

补充说明

在Linux下可以使用 blkid命令 对查询设备上所采用文件系统类型进行查询。blkid主要用来对系统的块设备(包括交换分区)所使用的文件系统类型、LABEL、UUID等信息进行查询。要使用这个命令必须安装e2fsprogs软件包。

语法

  1. blkid -L | -U
  2. blkid [-c ] [-ghlLv] [-o] [-s ][-t ] -[w ] [ ...]
  3. blkid -p [-s ] [-O ] [-S ][-o] ...
  4. blkid -i [-s ] [-o] ...

选项

  1. -c <file> # 指定cache文件(default: /etc/blkid.tab, /dev/null = none)
  2. -d # don't encode non-printing characters
  3. -h # 显示帮助信息
  4. -g # garbage collect the blkid cache
  5. -o <format> # 指定输出格式
  6. -k # list all known filesystems/RAIDs and exit
  7. -s <tag> # 显示指定信息,默认显示所有信息
  8. -t <token> # find device with a specific token (NAME=value pair)
  9. -l # look up only first device with token specified by -t
  10. -L <label> # convert LABEL to device name
  11. -U <uuid> # convert UUID to device name
  12. -v # 显示版本信息
  13. -w <file> # write cache to different file (/dev/null = no write)
  14. <dev> # specify device(s) to probe (default: all devices)
  15. Low-level probing options:
  16. -p # low-level superblocks probing (bypass cache)
  17. -i # gather information about I/O limits
  18. -S <size> # overwrite device size
  19. -O <offset> # probe at the given offset
  20. -u <list> # filter by "usage" (e.g. -u filesystem,raid)
  21. -n <list> # filter by filesystem type (e.g. -n vfat,ext3)

实例

1、列出当前系统中所有已挂载文件系统的类型:

  1. sudo blkid

2、显示指定设备 UUID:

  1. sudo blkid -s UUID /dev/sda5

3、显示所有设备 UUID:

  1. sudo blkid -s UUID

4、显示指定设备 LABEL:

  1. sudo blkid -s LABEL /dev/sda5

5、显示所有设备 LABEL:

  1. sudo blkid -s LABEL

6、显示所有设备文件系统:

  1. sudo blkid -s TYPE

7、显示所有设备:

  1. sudo blkid -o device

8、以列表方式查看详细信息:

  1. sudo blkid -o list