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 2009" "Linux" "MAINTENANCE COMMANDS"
10 blkid \- command\-line utility to locate/print block device attributes
65 program is the command-line interface to working with
67 library. It can determine the type of content (e.g. filesystem, swap)
68 a block device holds, and also attributes (tokens, NAME=value pairs)
69 from the content metadata (e.g. LABEL or UUID fields).
72 has two main forms of operation: either searching for a device with a
73 specific NAME=value pair, or displaying NAME=value pairs for one or
76 The \fIsize\fR and \fIoffset\fR arguments may be followed by binary (2^N)
77 suffixes KiB, MiB, GiB, TiB, PiB and EiB (the "iB" is optional, e.g. "K" has the
78 same meaning as "KiB") or decimal (10^N) suffixes KB, MB, GB, PB and EB.
83 instead of reading from the default cache file
85 If you want to start with a clean cache (i.e. don't report devices previously
86 scanned but not necessarily available at this time), specify
90 Perform a garbage collection pass on the blkid cache to remove
91 devices which no longer exist.
94 Display a usage message and exit.
97 Display I/O Limits (aka I/O topology) information. The 'export' output format is
98 automatically enabled. This option could be used together with \fB-p\fR option.
101 Look up one device that matches the search parameter specified using
104 option. If there are multiple devices that match the specified search
105 parameter, then the device with the highest priority is returned, and/or
106 the first device found at a given priority. Device types in order of
107 decreasing priority are Device Mapper, EVMS, LVM, MD, and finally regular
108 block devices. If this option is not specified,
110 will print all of the devices that match the search parameter.
113 Look up one device that uses the label (same as: -l -o device -t
114 LABEL=<label>). This look up method is able to reliable use /dev/disk/by-label
115 udev symlinks (depends on setting in /etc/blkid.conf). Avoid to use the
116 symlinks directly. It is not reliable to use the symlinks without verification.
117 The \fB-L\fR option works on systems with and without udev.
119 Unfortunately, the original
121 from e2fsprogs use the \fB-L\fR option as a
122 synonym to the \fB-o list\fR option. For better portability use "-l -o device
123 -t LABEL=<label>" and "-o list" in your scripts rather than -L option.
126 Restrict probing functions to defined (comma separated) list of superblock types (names).
127 The list can be prefixed with "no" to specify the types which should be ignored.
130 blkid -p -n vfat,ext3,ext4 /dev/sda1
132 probes for vfat, ext3 and ext4 filesystems, and
134 blkid -p -u nominix /dev/sda1
136 probes for all supported formats exclude minix filesystem. This option is
143 output using the specified format. The
149 print all tags (the default)
152 print the value of the tags
155 print the devices in a user-friendly format, this output format is unsupported
156 for low-level probing (\fB-p\fR or \fB-i\fR)
159 print the device name only, this output format is always enabled for \fB-L\fR
163 print key="value" pairs for easy import into the udev environment. The keys are
164 prefixed by ID_FS_ or ID_PART_ prefixes.
166 The udev output returns ID_FS_AMBIVALENT tag if more superblocks are detected,
167 and ID_PART_ENTRY_* tags are always returned for all partitions including empty
171 print key=value pairs for easy import into the environment. This output format
172 is automatically enabled when I/O Limits (\fB-i\fR option) are requested.
176 Probe at the given offset (only useful with \fB-p\fR). This option could be
177 used together with \fB-i\fR option.
180 Switch to low-level superblock probing mode (bypass cache).
182 Note that low-level probing also returns information about partition table type
183 (PTTYPE tag) and partitions (PART_ENTRY_* tags).
186 For each (specified) device, show only the tags that match
188 It is possible to specify multiple
190 options. If no tag is specified, then all tokens are shown for all
192 In order to just refresh the cache without showing any tokens, use
194 with no other options.
197 Overwrite device/file size (only useful with \fB-p\fR).
199 .BI \-t " NAME" = "value"
200 Search for block devices with tokens named
204 and display any devices which are found.
212 If there are no devices specified on the command line, all block devices
213 will be searched; otherwise only the specified devices are searched.
216 Restrict probing functions to defined (comma separated) list of "usage" types.
217 Supported usage types are: filesystem, raid, crypto and other. The list can be
218 prefixed with "no" to specify the usage types which should be ignored. For example:
220 blkid -p -u filesystem,other /dev/sda1
222 probes for all filesystems and others (e.g. swap) formats, and
224 blkid -p -u noraid /dev/sda1
226 probes for all supported formats exclude RAIDs. This option is useful with
230 Look up one device that uses the uuid. For more details see the \fB-L\fR option.
233 Display version number and exit.
235 .BI \-w " writecachefile"
236 Write the device cache to
238 instead of writing it to the default cache file
240 If you don't want to save the cache to the default file, specify
242 If not specified it will be the same file as that given by the
247 Display tokens from only the specified device. It is possible to
250 options on the command line. If none is given, all devices which
253 are shown, if they are recognized.
255 If the specified token was found, or if any tags were shown from (specified)
256 devices, 0 is returned. If the specified token was not found, or no
257 (specified) devices could be identified, an exit code of 2 is returned.
258 For usage or other errors, an exit code of 4 is returned.
261 was written by Andreas Dilger for libblkid and improved by Theodore Ts'o
264 The blkid command is part of the util-linux package and is available from
265 ftp://ftp.kernel.org/pub/linux/utils/util-linux/.