Whamcloud - gitweb
Integrate new blkid library.
[tools/e2fsprogs.git] / lib / blkid / libblkid.3.in
1 .\" 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 Public License.
6 .\" 
7 .\" Created  Wed Sep 14 12:02:12 2001, Andreas Dilger
8 .TH LIBBLKID 3 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
9 .SH NAME
10 libblkid \- block device identification library
11 .SH SYNOPSIS
12 .B #include <blkid/blkid.h>
13 .sp
14 .B cc
15 .I file.c
16 .B \-lblkid
17 .SH DESCRIPTION
18 The
19 .B libblkid
20 library is used to identify block devices (disks) as to their content (e.g.
21 filesystem type) as well as extracting additional information such as
22 filesystem labels/volume names, unique identifiers/serial numbers, etc.
23 A common use is to allow use of LABEL= and UUID= tags instead of hard-coding
24 specific block device names into configuration files.
25 .P
26 Block device information is normally kept in a cache file
27 .I /etc/blkid.tab
28 and is verified to still be valid before being returned to the user
29 (if the user has read permission on the raw block device, otherwise not).
30 The cache file also allows unprivileged users (normally anyone other
31 than root, or those not in the "disk" group) to locate devices by label/id.
32 .P
33 Functions with "get" in their name will first search the cache (if given)
34 for the specified data, and failing that will search visible block devices
35 for this information.  Functions with "find" in their name will only search
36 the existing cache data for the specified device.
37 .P
38 In situations where one is getting information about a single known device,
39 it does not impact performance whether the cache is used or not (unless you
40 are not able to read the block device directly).  If you are dealing with
41 multiple devices use of the cache is highly recommended (even if empty) as
42 devices will be scanned at most one time, and the on-disk cache will be
43 updated if possible.  There is rarely a reason not to use the cache.
44 .P
45 In some cases (modular kernels), block devices are not even visible until
46 after they are accessed the first time, so it is critical that there is
47 some way to locate these devices without enumerating only visible devices,
48 so the use of the cache file is
49 .B required
50 in this situation.
51 .SH AUTHOR
52 .B libblkid
53 was written by Andreas Dilger for the ext2 filesystem utilties, with input
54 from Ted Ts'o.
55 .SH FILES
56 .TP
57 .I /etc/blkid.tab 
58 Caches data extracted from each recognized block device.
59 .SH AVAILABILITY
60 .B libblkid
61 is part of the e2fsprogs package since version 1.25 and is available from
62 http://e2fsprogs.sourceforge.net.
63 .SH COPYING
64 .B libblkid
65 is available under the terms of the GNU Library General Public License (LGPL),
66 version 2 (or at your discretion any later version).  A copy of the LGPL
67 should be included with this library in the file COPYING.  If not, write to
68 .RS
69 Free Software Foundation, Inc.
70 .br
71 59 Temple Place
72 .br
73 Suite 330
74 .br
75 Boston, MA  02111-1307  USA
76 .RE
77 .PP
78 or visit
79 .UR http://www.gnu.org/licenses/licenses.html#LGPL
80 http://www.gnu.org/licenses/licenses.html#LGPL
81 .UE
82 .SH "SEE ALSO"
83 .BR blkid_read_cache (3),
84 .BR blkid_save_cache (3),
85 .BR blkid_free_cache (3),
86 .BR blkid_get_devname (3),
87 .BR blkid_get_devno (3),
88 .BR blkid_probe_all (3),
89 .BR blkid_token_to_tag (3),
90 .BR blkid_free_dev (3),
91 .BR blkid_find_tag_dev (3),
92 .BR blkid_find_tag_cache (3),
93 .BR blkid_get_tag_cache (3),
94 .BR blkid_get_tagname_devname (3),
95 .BR blkid_get_token (3),
96 .BR blkid.tab (7)