UNPKG

2.22 kBMarkdownView Raw
1blkid
2===
3
4查看块设备的文件系统类型、LABEL、UUID等信息
5
6## 补充说明
7
8在Linux下可以使用 **blkid命令** 对查询设备上所采用文件系统类型进行查询。blkid主要用来对系统的块设备(包括交换分区)所使用的文件系统类型、LABEL、UUID等信息进行查询。要使用这个命令必须安装e2fsprogs软件包。
9
10### 语法
11
12```shell
13blkid -L | -U
14blkid [-c ] [-ghlLv] [-o] [-s ][-t ] -[w ] [ ...]
15blkid -p [-s ] [-O ] [-S ][-o] ...
16blkid -i [-s ] [-o] ...
17```
18
19### 选项
20
21```shell
22-c <file> # 指定cache文件(default: /etc/blkid.tab, /dev/null = none)
23-d # don't encode non-printing characters
24-h # 显示帮助信息
25-g # garbage collect the blkid cache
26-o <format> # 指定输出格式
27-k # list all known filesystems/RAIDs and exit
28-s <tag> # 显示指定信息,默认显示所有信息
29-t <token> # find device with a specific token (NAME=value pair)
30-l # look up only first device with token specified by -t
31-L <label> # convert LABEL to device name
32-U <uuid> # convert UUID to device name
33-v # 显示版本信息
34-w <file> # write cache to different file (/dev/null = no write)
35<dev> # specify device(s) to probe (default: all devices)
36Low-level probing options:
37-p # low-level superblocks probing (bypass cache)
38-i # gather information about I/O limits
39-S <size> # overwrite device size
40-O <offset> # probe at the given offset
41-u <list> # filter by "usage" (e.g. -u filesystem,raid)
42-n <list> # filter by filesystem type (e.g. -n vfat,ext3)
43```
44
45### 实例
46
471、列出当前系统中所有已挂载文件系统的类型:
48
49```shell
50sudo blkid
51```
52
532、显示指定设备 UUID:
54
55```shell
56sudo blkid -s UUID /dev/sda5
57```
58
593、显示所有设备 UUID:
60
61```shell
62sudo blkid -s UUID
63```
64
654、显示指定设备 LABEL:
66
67```shell
68sudo blkid -s LABEL /dev/sda5
69```
70
715、显示所有设备 LABEL:
72
73```shell
74sudo blkid -s LABEL
75```
76
776、显示所有设备文件系统:
78
79```shell
80sudo blkid -s TYPE
81```
82
837、显示所有设备:
84
85```shell
86sudo blkid -o device
87```
88
898、以列表方式查看详细信息:
90
91```shell
92sudo blkid -o list
93```
94
95