blob: 58ca91cbb48b8a77e262e4ca5720627f22111d68 [file] [log] [blame]
bigbiff7b4c7a62015-01-01 19:44:14 -05001.\" Copyright 2001 Andreas Dilger (adilger@turbolinux.com)
2.\"
3.\" This man page was created for libblkid.so.1.0 from e2fsprogs-1.24.
4.\"
5.\" This file may be copied under the terms of the GNU Lesser General Public
6.\" License.
7.\"
8.\" Created Wed Sep 14 12:02:12 2001, Andreas Dilger
9.TH LIBBLKID 3 "May 2009" "util-linux" "Programmer's Manual"
10.SH NAME
11libblkid \- block device identification library
12.SH SYNOPSIS
13.B #include <blkid.h>
14.sp
15.B cc
16.I file.c
17.B \-lblkid
18.SH DESCRIPTION
19The
20.B libblkid
21library is used to identify block devices (disks) as to their content (e.g.
22filesystem type) as well as extracting additional information such as
23filesystem labels/volume names, unique identifiers/serial numbers.
24A common use is to allow use of LABEL= and UUID= tags instead of hard-coding
25specific block device names into configuration files.
26.P
27The low-level part of the library also allows to extract information about
28partitions and block device topology.
29.P
30The high-level part of the library keeps information about block devices in a
31cache file and is verified to still be valid before being returned to the user
32(if the user has read permission on the raw block device, otherwise not).
33The cache file also allows unprivileged users (normally anyone other
34than root, or those not in the "disk" group) to locate devices by label/id.
35The standard location of the cache file can be overridden by the
36environment variable BLKID_FILE.
37.P
38In situations where one is getting information about a single known device, it
39does not impact performance whether the cache is used or not (unless you are
40not able to read the block device directly).
41.P
42The high-level part of the library supports two methods to evaluate LABEL/UUID.
43It reads information directly from a block device or read information from
44/dev/disk/by-* udev symlinks. The udev is preferred method by default.
45.P
46If you are dealing with
47multiple devices, use of the cache is highly recommended (even if empty) as
48devices will be scanned at most one time and the on-disk cache will be
49updated if possible.
50.P
51In some cases (modular kernels), block devices are not even visible until
52after they are accessed the first time, so it is critical that there is
53some way to locate these devices without enumerating only visible devices,
54so the use of the cache file is
55.B required
56in this situation.
57.SH CONFIGURATION FILE
58The standard location of the
59.I /etc/blkid.conf
60config file can be overridden by the environment variable BLKID_CONF. For more
61details about the config file see
62.BR blkid (8)
63man page.
64.SH AUTHOR
65.B libblkid
66was written by Andreas Dilger for the ext2 filesystem utilties, with input
67from Ted Ts'o. The library was subsequently heavily modified by Ted Ts'o.
68
69The low-level probing code was rewritten by Karel Zak.
70.SH COPYING
71.B libblkid
72is available under the terms of the GNU Library General Public License (LGPL),
73version 2 (or at your discretion any later version).
74.SH "SEE ALSO"
75.BR blkid (8),
76.BR findfs (8)
77.SH AVAILABILITY
78libblkid is part of the util-linux package since version 2.15 and is available from
79ftp://ftp.kernel.org/pub/linux/utils/util-linux/.