1 .\" Copyright 2000 Andreas Dilger (adilger@turbolinux.com)
3 .\" This man page was created for blkid from e2fsprogs-1.25.
5 .\" This file may be copied under the terms of the GNU Public License.
7 .\" Based on uuidgen, Mon Sep 17 10:42:12 2000, Andreas Dilger
8 .TH BLKID 8 "February 2011" "util-linux" "System Administration"
10 blkid \- locate/print block device attributes
61 program is the command-line interface to working with the
63 library. It can determine the type of content (e.g. filesystem or swap)
64 that a block device holds, and also attributes (tokens, NAME=value pairs)
65 from the content metadata (e.g. LABEL or UUID fields).
69 reads information directly from devices and for non-root users
70 it returns cached unverified information. It's better to use
72 to get user-friendly overview about filesystems and devices.
74 is also easy to use in scripts.
76 is mostly designed for system services and to test libblkid functionality.
79 has two main forms of operation: either searching for a device with a
80 specific NAME=value pair, or displaying NAME=value pairs for one or
81 more specified devices.
83 The \fIsize\fR and \fIoffset\fR arguments may be followed by the multiplicative
84 suffixes KiB=1024, MiB=1024*1024, and so on for GiB, TiB, PiB, EiB, ZiB and YiB
85 (the "iB" is optional, e.g. "K" has the same meaning as "KiB") or the suffixes
86 KB=1000, MB=1000*1000, and so on for GB, PB, EB, ZB and YB.
91 instead of reading from the default cache file (see CONFIGURATION FILE section
92 for more details). If you want to start with a clean cache (i.e. don't report
93 devices previously scanned but not necessarily available at this time), specify
97 Don't encode non-printing characters. The non-printing characters are encoded
98 by ^ and M- notation by default. Note that \fB-o udev\fR output format uses
99 a different encoding and this encoding cannot be disabled.
102 Perform a garbage collection pass on the blkid cache to remove
103 devices which no longer exist.
106 Display a usage message and exit.
109 Display I/O Limits (aka I/O topology) information. The 'export' output format is
110 automatically enabled. This option can be used together with the \fB-p\fR option.
113 Look up only one device that matches the search parameter specified with \fB-t\fR
114 option. If there are multiple devices that match the specified search
115 parameter, then the device with the highest priority is returned, and/or
116 the first device found at a given priority. Device types in order of
117 decreasing priority are Device Mapper, EVMS, LVM, MD, and finally regular
118 block devices. If this option is not specified,
120 will print all of the devices that match the search parameter.
123 List all known filesystems and RAIDs and exit.
126 Look up the device that uses this filesystem \fIlabel\fR (equal to: -l -o device -t
127 LABEL=<label>). This lookup method is able to reliably use /dev/disk/by-label
128 udev symlinks (dependent on a setting in /etc/blkid.conf). Avoid using the
129 symlinks directly; it is not reliable to use the symlinks without verification.
130 The \fB-L\fR option works on systems with and without udev.
132 Unfortunately, the original
134 from e2fsprogs use the \fB-L\fR option as a
135 synonym for the \fB-o list\fR option. For better portability, use \fB-l -o device
136 -t LABEL=<label>\fR and \fB-o list\fR in your scripts rather than the \fB-L\fR option.
139 Restrict the probing functions to the specified (comma-separated) \fIlist\fR of
140 superblock types (names).
141 The list items may be prefixed with "no" to specify the types which should be ignored.
144 blkid -p -n vfat,ext3,ext4 /dev/sda1
146 probes for vfat, ext3 and ext4 filesystems, and
148 blkid -p -n nominix /dev/sda1
150 probes for all supported formats except minix filesystems.
151 This option is only useful together with \fB-p\fR.
156 output using the specified format. Note that the variables order and
157 devices order is variable. See also \fB-s\fR. The
163 print all tags (the default)
166 print the value of the tags
169 print the devices in a user-friendly format; this output format is unsupported
170 for low-level probing (\fB-p\fR or \fB-i\fR). This output format is \fBDEPRECATED\fR
176 print the device name only; this output format is always enabled for \fB-L\fR
180 print key="value" pairs for easy import into the udev environment; the keys are
181 prefixed by ID_FS_ or ID_PART_ prefixes
183 The udev output returns the ID_FS_AMBIVALENT tag if more superblocks are detected,
184 and ID_PART_ENTRY_* tags are always returned for all partitions including empty
185 partitions. This output format is \fBDEPRECATED\fR.
188 print key=value pairs for easy import into the environment; this output format
189 is automatically enabled when I/O Limits (\fB-i\fR option) are requested
193 Probe at the given \fIoffset\fR (only useful with \fB-p\fR). This option can be
194 used together with the \fB-i\fR option.
197 Switch to low-level superblock probing mode (bypass cache).
199 Note that low-level probing also returns information about partition table type
200 (PTTYPE tag) and partitions (PART_ENTRY_* tags).
203 For each (specified) device, show only the tags that match
205 It is possible to specify multiple
207 options. If no tag is specified, then all tokens are shown for all
209 In order to just refresh the cache without showing any tokens, use
211 with no other options.
214 Overwrite device/file size (only useful with \fB-p\fR).
216 .BI \-t " NAME" = "value"
217 Search for block devices with tokens named
221 and display any devices which are found.
229 If there are no devices specified on the command line, all block devices
230 will be searched; otherwise only the specified devices are searched.
233 Restrict the probing functions to the specified (comma-separated) \fIlist\fR of "usage" types.
234 Supported usage types are: filesystem, raid, crypto and other. The list items may be
235 prefixed with "no" to specify the usage types which should be ignored. For example:
237 blkid -p -u filesystem,other /dev/sda1
239 probes for all filesystem and other (e.g. swap) formats, and
241 blkid -p -u noraid /dev/sda1
243 probes for all supported formats except RAIDs.
244 This option is only useful together with \fB-p\fR.
247 Look up the device that uses this filesystem \fIuuid\fR. For more details see the \fB-L\fR option.
250 Display version number and exit.
253 Display tokens from only the specified device. It is possible to
256 options on the command line. If none is given, all devices which
259 are shown, if they are recognized.
261 If the specified token was found, or if any tags were shown from (specified)
262 devices, 0 is returned.
264 If the specified token was not found, or no (specified) devices could be
265 identified, an exit code of 2 is returned.
267 For usage or other errors, an exit code of 4 is returned.
269 If the ambivalent low-level probing result was detected, an exit code of 8 is
271 .SH CONFIGURATION FILE
272 The standard location of the
274 config file can be overridden by the environment variable BLKID_CONF.
275 The following options control the libblkid library:
277 .I SEND_UEVENT=<yes|not>
279 .I /dev/disk/by-{label,uuid,partuuid,partlabel}/
280 symlink does not match with LABEL, UUID, PARTUUID or PARTLABEL on the device. Default is "yes".
283 Overrides the standard location of the cache file. This setting can be
284 overridden by the environment variable BLKID_FILE. Default is
285 .I /run/blkid/blkid.tab
288 on systems without /run directory
290 .I EVALUATE=<methods>
291 Defines LABEL and UUID evaluation method(s). Currently, the libblkid library
292 supports "udev" and "scan" methods. More than one methods may be specified in
293 a comma separated list. Default is "udev,scan". The "udev" method uses udev
295 symlinks and the "scan" method scans all block devices from the
300 was written by Andreas Dilger for libblkid and improved by Theodore Ts'o
303 .IP LIBBLKID_DEBUG=0xffff
304 enables debug output.
306 The blkid command is part of the util-linux package and is available from
307 ftp://ftp.kernel.org/pub/linux/utils/util-linux/.