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
63 program is the command-line interface to working with the
65 library. It can determine the type of content (e.g. filesystem or swap)
66 that a block device holds, and also attributes (tokens, NAME=value pairs)
67 from the content metadata (e.g. LABEL or UUID fields).
70 has two main forms of operation: either searching for a device with a
71 specific NAME=value pair, or displaying NAME=value pairs for one or
72 more specified devices.
74 The \fIsize\fR and \fIoffset\fR arguments may be followed by binary (2^N)
75 suffixes KiB, MiB, GiB, TiB, PiB and EiB (the "iB" is optional, e.g. "K" has the
76 same meaning as "KiB") or decimal (10^N) suffixes KB, MB, GB, PB and EB.
81 instead of reading from the default cache file
83 If you want to start with a clean cache (i.e. don't report devices previously
84 scanned but not necessarily available at this time), specify
88 Don't encode non-printing characters. The non-printing characters are encoded
89 by ^ and M- notation by default. Note that \fB-o udev\fR output format uses
90 a diffrent encoding and this encoding cannot be disabled.
93 Perform a garbage collection pass on the blkid cache to remove
94 devices which no longer exist.
97 Display a usage message and exit.
100 Display I/O Limits (aka I/O topology) information. The 'export' output format is
101 automatically enabled. This option can be used together with the \fB-p\fR option.
104 Look up only one device that matches the search parameter specified with \fB-t\fR.
107 List all known filesystems and RAIDs and exit.
110 option. If there are multiple devices that match the specified search
111 parameter, then the device with the highest priority is returned, and/or
112 the first device found at a given priority. Device types in order of
113 decreasing priority are Device Mapper, EVMS, LVM, MD, and finally regular
114 block devices. If this option is not specified,
116 will print all of the devices that match the search parameter.
119 Look up the device that uses this \fIlabel\fR (equal to: -l -o device -t
120 LABEL=<label>). This lookup method is able to reliably use /dev/disk/by-label
121 udev symlinks (dependent on a setting in /etc/blkid.conf). Avoid using the
122 symlinks directly; it is not reliable to use the symlinks without verification.
123 The \fB-L\fR option works on systems with and without udev.
125 Unfortunately, the original
127 from e2fsprogs use the \fB-L\fR option as a
128 synonym for the \fB-o list\fR option. For better portability, use \fB-l -o device
129 -t LABEL=<label>\fR and \fB-o list\fR in your scripts rather than the \fB-L\fR option.
132 Restrict the probing functions to the specified (comma-separated) \fIlist\fR of
133 superblock types (names).
134 The list items may be prefixed with "no" to specify the types which should be ignored.
137 blkid -p -n vfat,ext3,ext4 /dev/sda1
139 probes for vfat, ext3 and ext4 filesystems, and
141 blkid -p -n nominix /dev/sda1
143 probes for all supported formats except minix filesystems.
144 This option is only useful together with \fB-p\fR.
149 output using the specified format. The
155 print all tags (the default)
158 print the value of the tags
161 print the devices in a user-friendly format; this output format is unsupported
162 for low-level probing (\fB-p\fR or \fB-i\fR)
165 print the device name only; this output format is always enabled for \fB-L\fR
169 print key="value" pairs for easy import into the udev environment; the keys are
170 prefixed by ID_FS_ or ID_PART_ prefixes
172 The udev output returns the ID_FS_AMBIVALENT tag if more superblocks are detected,
173 and ID_PART_ENTRY_* tags are always returned for all partitions including empty
177 print key=value pairs for easy import into the environment; this output format
178 is automatically enabled when I/O Limits (\fB-i\fR option) are requested
182 Probe at the given \fIoffset\fR (only useful with \fB-p\fR). This option can be
183 used together with the \fB-i\fR option.
186 Switch to low-level superblock probing mode (bypass cache).
188 Note that low-level probing also returns information about partition table type
189 (PTTYPE tag) and partitions (PART_ENTRY_* tags).
192 For each (specified) device, show only the tags that match
194 It is possible to specify multiple
196 options. If no tag is specified, then all tokens are shown for all
198 In order to just refresh the cache without showing any tokens, use
200 with no other options.
203 Overwrite device/file size (only useful with \fB-p\fR).
205 .BI \-t " NAME" = "value"
206 Search for block devices with tokens named
210 and display any devices which are found.
218 If there are no devices specified on the command line, all block devices
219 will be searched; otherwise only the specified devices are searched.
222 Restrict the probing functions to the specified (comma-separated) \fIlist\fR of "usage" types.
223 Supported usage types are: filesystem, raid, crypto and other. The list items may be
224 prefixed with "no" to specify the usage types which should be ignored. For example:
226 blkid -p -u filesystem,other /dev/sda1
228 probes for all filesystem and other (e.g. swap) formats, and
230 blkid -p -u noraid /dev/sda1
232 probes for all supported formats except RAIDs.
233 This option is only useful together with \fB-p\fR.
236 Look up the device that uses this \fIuuid\fR. For more details see the \fB-L\fR option.
239 Display version number and exit.
241 .BI \-w " writecachefile"
242 Write the device cache to
244 instead of writing it to the default cache file
246 If you don't want to save the cache at all, specify
248 If not specified, it will be the same file as that given with the
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
273 was written by Andreas Dilger for libblkid and improved by Theodore Ts'o
276 The blkid command is part of the util-linux package and is available from
277 ftp://ftp.kernel.org/pub/linux/utils/util-linux/.