]>
Commit | Line | Data |
---|---|---|
51410fc6 KZ |
1 | .\" Copyright 2000 Andreas Dilger (adilger@turbolinux.com) |
2 | .\" | |
3 | .\" This man page was created for blkid from e2fsprogs-1.25. | |
4 | .\" | |
5 | .\" This file may be copied under the terms of the GNU Public License. | |
6 | .\" | |
7 | .\" Based on uuidgen, Mon Sep 17 10:42:12 2000, Andreas Dilger | |
fc7a1669 | 8 | .TH BLKID 8 "February 2009" "Linux" "MAINTENANCE COMMANDS" |
51410fc6 KZ |
9 | .SH NAME |
10 | blkid \- command\-line utility to locate/print block device attributes | |
11 | .SH SYNOPSIS | |
12 | .B blkid | |
fc7a1669 KZ |
13 | .RB \-L |
14 | .IR label " | " | |
15 | .RB \-U | |
16 | .IR uuid | |
17 | ||
18 | .B blkid | |
19 | .RB [ \-ghlv ] | |
02a8a21a KZ |
20 | .RB [ \-c |
21 | .IR file ] | |
22 | .RB [ \-w | |
23 | .IR file ] | |
24 | .RB [ \-o | |
25 | .IR format ] | |
26 | .in +6 | |
27 | .RB [ \-s | |
28 | .IR tag ] | |
29 | .RB [ \-t | |
30 | .IR NAME=value ] | |
31 | .I device | |
32 | [\fIdevice\fR ...] | |
33 | .in -6 | |
34 | ||
35 | .B blkid | |
36 | .RB -p | |
37 | .RB [ \-O | |
38 | .IR offset ] | |
39 | .RB [ \-S | |
40 | .IR size ] | |
41 | .RB [ \-o | |
42 | .IR format ] | |
7711e215 KZ |
43 | .RB [ \-s |
44 | .IR tag ] | |
45 | .in +9 | |
0bdd2f97 KZ |
46 | .RB [ \-u |
47 | .IR list ] | |
02a8a21a KZ |
48 | .I device |
49 | [\fIdevice\fR ...] | |
50 | ||
51410fc6 KZ |
51 | .SH DESCRIPTION |
52 | The | |
53 | .B blkid | |
54 | program is the command-line interface to working with | |
55 | .BR libblkid (3) | |
56 | library. It can determine the type of content (e.g. filesystem, swap) | |
57 | a block device holds, and also attributes (tokens, NAME=value pairs) | |
58 | from the content metadata (e.g. LABEL or UUID fields). | |
59 | .PP | |
60 | .B blkid | |
61 | has two main forms of operation: either searching for a device with a | |
62 | specific NAME=value pair, or displaying NAME=value pairs for one or | |
63 | more devices. | |
64 | .SH OPTIONS | |
65 | .TP | |
66 | .BI \-c " cachefile" | |
67 | Read from | |
68 | .I cachefile | |
69 | instead of reading from the default cache file | |
70 | .IR /etc/blkid.tab . | |
71 | If you want to start with a clean cache (i.e. don't report devices previously | |
72 | scanned but not necessarily available at this time), specify | |
73 | .IR /dev/null . | |
74 | .TP | |
75 | .B \-g | |
76 | Perform a garbage collection pass on the blkid cache to remove | |
77 | devices which no longer exist. | |
78 | .TP | |
79 | .B \-h | |
80 | Display a usage message and exit. | |
81 | .TP | |
82 | .B \-l | |
83 | Look up one device that matches the search parameter specified using | |
84 | the | |
85 | .B \-t | |
86 | option. If there are multiple devices that match the specified search | |
87 | parameter, then the device with the highest priority is returned, and/or | |
88 | the first device found at a given priority. Device types in order of | |
89 | decreasing priority are Device Mapper, EVMS, LVM, MD, and finally regular | |
90 | block devices. If this option is not specified, | |
91 | .B blkid | |
92 | will print all of the devices that match the search parameter. | |
93 | .TP | |
fc7a1669 KZ |
94 | .B \-L " label " |
95 | Look up one device that uses the label (same as: -l -o device -t | |
96 | LABEL=<label>). This look up method is able to reliable use /dev/disk/by-label | |
97 | udev symlinks (depends on setting in /etc/blkid.conf). Avoid to use the | |
98 | symlinks directly. It is not reliable to use the symlinks without verification. | |
99 | The \fB-L\fR option is portable and works on systems with and without udev. | |
100 | .TP | |
0bdd2f97 KZ |
101 | .B \-u " list " |
102 | Restrict probing functions to defined (comma separated) list of "usage" types. | |
103 | Supported usage types are: filesystem, raid, crypto and other. The list can be | |
104 | prefixed with "no" to specify the usage types which should be ignored. For example: | |
105 | .sp | |
106 | blkid -p -u filesystem,other /dev/sda1 | |
107 | .sp | |
108 | probes for all filesystems and others (e.g. swap) formats, and | |
109 | .sp | |
110 | blkid -p -u noraid /dev/sda1 | |
111 | .sp | |
112 | probes for all supported formats exclude RAIDs. This option is useful with | |
113 | \fB-p\fR only. | |
114 | .TP | |
fc7a1669 KZ |
115 | .B \-U " uuid " |
116 | Look up one device that uses the uuid. For more details see the \fB-L\fR option. | |
02a8a21a | 117 | .TP |
51410fc6 KZ |
118 | .BI \-o " format" |
119 | Display | |
120 | .BR blkid 's | |
121 | output using the specified format. The | |
122 | .I format | |
02a8a21a KZ |
123 | parameter may be: |
124 | .RS | |
51410fc6 | 125 | .TP |
02a8a21a KZ |
126 | .B full |
127 | print all tags (the default) | |
128 | .TP | |
129 | .B value | |
130 | print the value of the tags | |
131 | .TP | |
132 | .B list | |
133 | print the devices in a user-friendly format | |
134 | .TP | |
135 | .B device | |
136 | print the device name only | |
137 | .TP | |
138 | .B udev | |
139 | vol_id compatible mode; usable in udev rules | |
140 | .RE | |
141 | .TP | |
142 | .BI \-O " bytes" | |
143 | Probe at the given offset (only useful with \fB-p\fR). | |
144 | .TP | |
145 | .BI \-p | |
7711e215 | 146 | Switch to low-level probing mode (bypass cache) |
51410fc6 KZ |
147 | .TP |
148 | .BI \-s " tag" | |
149 | For each (specified) device, show only the tags that match | |
150 | .IR tag . | |
151 | It is possible to specify multiple | |
152 | .B \-s | |
153 | options. If no tag is specified, then all tokens are shown for all | |
154 | (specified) devices. | |
155 | In order to just refresh the cache without showing any tokens, use | |
156 | .B "-s none" | |
157 | with no other options. | |
158 | .TP | |
02a8a21a | 159 | .BI \-S " bytes" |
0bdd2f97 | 160 | Overwrite device/file size (only useful with \fB-p\fR). |
02a8a21a | 161 | .TP |
51410fc6 KZ |
162 | .BI \-t " NAME" = "value" |
163 | Search for block devices with tokens named | |
164 | .I NAME | |
165 | that have the value | |
166 | .IR value , | |
167 | and display any devices which are found. | |
168 | Common values for | |
169 | .I NAME | |
170 | include | |
171 | .BR TYPE , | |
172 | .BR LABEL , | |
173 | and | |
174 | .BR UUID . | |
175 | If there are no devices specified on the command line, all block devices | |
176 | will be searched; otherwise only the specified devices are searched. | |
177 | .TP | |
178 | .B \-v | |
179 | Display version number and exit. | |
180 | .TP | |
181 | .BI \-w " writecachefile" | |
182 | Write the device cache to | |
183 | .I writecachefile | |
184 | instead of writing it to the default cache file | |
185 | .IR /etc/blkid.tab . | |
186 | If you don't want to save the cache to the default file, specify | |
187 | .IR /dev/null. | |
188 | If not specified it will be the same file as that given by the | |
189 | .B \-c | |
190 | option. | |
191 | .TP | |
192 | .I device | |
193 | Display tokens from only the specified device. It is possible to | |
194 | give multiple | |
195 | .I device | |
196 | options on the command line. If none is given, all devices which | |
197 | appear in | |
198 | .I /proc/partitions | |
199 | are shown, if they are recognized. | |
200 | .SH "RETURN CODE" | |
201 | If the specified token was found, or if any tags were shown from (specified) | |
202 | devices, 0 is returned. If the specified token was not found, or no | |
203 | (specified) devices could be identified, an exit code of 2 is returned. | |
204 | For usage or other errors, an exit code of 4 is returned. | |
205 | .SH AUTHOR | |
206 | .B blkid | |
02a8a21a KZ |
207 | was written by Andreas Dilger for libblkid and improved by Theodore Ts'o |
208 | and Karel Zak. | |
51410fc6 | 209 | .SH AVAILABILITY |
02a8a21a KZ |
210 | The blkid command is part of the util-linux-ng package and is available from |
211 | ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/. | |
51410fc6 KZ |
212 | .SH "SEE ALSO" |
213 | .BR libblkid (3) | |
fc7a1669 | 214 | .BR findfs (8) |