Section: System Administration (8)
Updated: March 2013
blkid -L label | -U uuid
blkid [-dghlv] [-c file] [-o format] [-s tag] [-t NAME=value] [device ...]
blkid -p [-O offset] [-o format] [-S size] [-s tag] [-n list] [-u list] device ...
blkid -i [-o format] [-s tag] device ...
The blkid program is the command-line interface to working with the libblkid?(3) library. It can determine the type of content (e.g. filesystem or swap) that a block device holds, and also the attributes (tokens, NAME=value pairs) from the content metadata (e.g. LABEL or UUID fields).
When device is specified, tokens from only this device are displayed. It is possible to specify multiple device arguments on the command line. If none is given, all devices which appear in /proc/partitions are shown, if they are recognized.
Note that blkid reads information directly from devices and for non-root users it returns cached unverified information. It is better to use lsblk --fs to get a user-friendly overview of filesystems and devices. lsblk?(8) is also easy to use in scripts. blkid is mostly designed for system services and to test libblkid functionality.
The size and offset arguments may be followed by the multiplicative suffixes like KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is optional, e.g. "K" has the same meaning as "KiB"), or the suffixes KB (=1000), MB (=1000*1000), and so on for GB, TB, PB, EB, ZB and YB.
Unfortunately, the original blkid?(8) from e2fsprogs uses the -L option as a synonym for -o list. For better portability, use -l -o device -t LABEL=label and -o list in your scripts rather than the -L option.
blkid -p -n vfat,ext3,ext4 /dev/sda1
probes for vfat, ext3 and ext4 filesystems, and
blkid -p -n nominix /dev/sda1
probes for all supported formats except minix filesystems. This option is only useful together with -p.
The udev output returns the ID_FS_AMBIVALENT tag if more superblocks are detected, and ID_PART_ENTRY_* tags are always returned for all partitions including empty partitions. This output format is DEPRECATED.
The non-printing characters are encoded by ^ and M- notation and all potentially unsafe characters are escaped.
Note that low-level probing also returns information about partition table type (PTTYPE tag) and partitions (PART_ENTRY_* tags).
blkid -p -u filesystem,other /dev/sda1
probes for all filesystem and other (e.g. swap) formats, and
blkid -p -u noraid /dev/sda1
probes for all supported formats except RAIDs. This option is only useful together with -p.
If the specified token was found, or if any tags were shown from (specified) devices, 0 is returned.
If the specified token was not found, or no (specified) devices could be identified, an exit code of 2 is returned.
For usage or other errors, an exit code of 4 is returned.
The standard location of the /etc/blkid.conf config file can be overridden by the environment variable BLKID_CONF. The following options control the libblkid library:
:Setting LIBBLKID_DEBUG=0xffff enables debug output.
The blkid command is part of the util-linux package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/.
Tutoriais de Tecnologia Web