1BLKID(8)                    System Manager's Manual                   BLKID(8)
2
3
4

NAME

6       blkid - command-line utility to locate/print block device attributes
7

SYNOPSIS

9       blkid  [ -ghlv ] [ [ -c cachefile ] -w writecachefile ] [ -o format ] [
10       -s tag ] [ -t NAME=value ] [ device ...  ]
11

DESCRIPTION

13       The blkid program is the command-line interface to working  with  libu‐
14       uid(3) library.  It can determine the type of content (e.g. filesystem,
15       swap) a block device holds, and  also  attributes  (tokens,  NAME=value
16       pairs) from the content metadata (e.g. LABEL or UUID fields).
17
18       blkid  has  two  main forms of operation: either searching for a device
19       with a specific NAME=value pair, or displaying NAME=value pairs for one
20       or more devices.
21

OPTIONS

23       -c     Read  from  cachefile  instead of reading from the default cache
24              file /etc/blkid/blkid.tab.  If you want to start  with  a  clean
25              cache (i.e. don't report devices previously scanned but not nec‐
26              essarily available at this time), specify /dev/null.
27
28       -g     Perform a garbage collection pass on the blkid cache.
29
30       -h     Display a usage message and exit.
31
32       -l     Look up one device that matches the search  parameter  specified
33              using  the  -t option.  If there are multiple devices that match
34              the specified search parameter, then the device with the highest
35              priority  is  returned, and/or the first device found at a given
36              priority.  Device types in  order  of  decreasing  priority  are
37              Device Mapper, EVMS, LVM, MD, and finally regular block devices.
38              If this option is not specified, blkid will  print  all  of  the
39              devices that match the search parameter.
40
41       -o     Display  blkid's  output using the specified format.  The format
42              parameter may be full, (the default),  value,  (only  print  the
43              value  of  any  tags printed by blkid) or device (only print the
44              device name).
45
46       -s     Show only the tags for each (specified) device that  match  tag.
47              It  is  possible  to  specify multiple -s options.  If no tag is
48              specified,  then  all  tokens  are  shown  for  all  (specified)
49              devices.  In order to just refresh the cache without showing any
50              tokens use -s none with no other options.
51
52       -t     Search for block devices with tokens named NAME  that  have  the
53              value  value,  and  display any devices which are found.  Common
54              values for NAME include TYPE, LABEL, and UUID.  If there are  no
55              devices specified on the command line, all block devices will be
56              searched; otherwise, only search the devices  specified  by  the
57              user.
58
59       -v     Display version number and exit.
60
61       -w     <writecachefile>   Write  the  device  cache  to  writecachefile
62              instead   of   writing   it   to   the   default   cache    file
63              /etc/blkid/blkid.tab.   If  you  don't want to save the cache to
64              the default file, specify /dev/null.  If not specified  it  will
65              be the same file as that given by the -c option.
66
67       <device>
68              Display  tokens  from only the specified device.  It is possible
69              to give multiple <device> options on the command line.  If  none
70              is  given,  all  devices  which  appear  in /proc/partitions are
71              shown, if they are recognized.
72

RETURN CODE

74       If the specified token was found, or if any tags were shown from (spec‐
75       ified) devices 0 is returned.  If the specified token was not found, or
76       no (specified) devices could be  identified,  an  exit  code  of  2  is
77       returned.  For usage or other errors, an exit code of 4 is returned.
78

AUTHOR

80       blkid was written by Andreas Dilger for libblkid.
81

AVAILABILITY

83       blkid is part the e2fsprogs package since version 1.26 and is available
84       from http://e2fsprogs.sourceforge.net.
85

SEE ALSO

87       libblkid(3)
88
89
90
91E2fsprogs version 1.40.2           July 2007                          BLKID(8)
Impressum