]>
Commit | Line | Data |
---|---|---|
a0948ffe KZ |
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 | |
601d12fb | 8 | .TH LIBBLKID 3 "May 2009" "util-linux" |
a0948ffe KZ |
9 | .SH NAME |
10 | libblkid \- block device identification library | |
11 | .SH SYNOPSIS | |
8e368761 | 12 | .B #include <blkid.h> |
a0948ffe KZ |
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 | |
c632883f | 22 | filesystem labels/volume names, unique identifiers/serial numbers. |
a0948ffe KZ |
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 | |
c632883f KZ |
26 | The low-level part of the library also allows to extract infomation about |
27 | partitions and block device topology. | |
28 | .P | |
29 | The high-level part of the library keeps information about block devices | |
30 | in a cache file | |
a0948ffe KZ |
31 | .I /etc/blkid.tab |
32 | and is verified to still be valid before being returned to the user | |
33 | (if the user has read permission on the raw block device, otherwise not). | |
34 | The cache file also allows unprivileged users (normally anyone other | |
35 | than root, or those not in the "disk" group) to locate devices by label/id. | |
36 | The standard location of the cache file can be overridden by the | |
37 | environment variable BLKID_FILE. | |
38 | .P | |
c632883f KZ |
39 | In situations where one is getting information about a single known device, it |
40 | does not impact performance whether the cache is used or not (unless you are | |
41 | not able to read the block device directly). | |
42 | .P | |
43 | The high-level part of the library supports two methods to evaluate LABEL/UUID. | |
44 | It reads information directly from a block device or read information from | |
45 | /dev/disk/by-* udev symlinks. The udev is preferred method by default. | |
46 | .P | |
47 | If you are dealing with | |
a0948ffe KZ |
48 | multiple devices, use of the cache is highly recommended (even if empty) as |
49 | devices will be scanned at most one time and the on-disk cache will be | |
c632883f | 50 | updated if possible. |
a0948ffe KZ |
51 | .P |
52 | In some cases (modular kernels), block devices are not even visible until | |
53 | after they are accessed the first time, so it is critical that there is | |
54 | some way to locate these devices without enumerating only visible devices, | |
55 | so the use of the cache file is | |
56 | .B required | |
57 | in this situation. | |
0eb0aff9 KZ |
58 | .SH CONFIGURATION FILE |
59 | The standard location of the | |
60 | .I /etc/blkid.conf | |
61 | config file can be overridden by the environment variable BLKID_CONF. | |
62 | The following options control the libblkid library: | |
63 | .TP | |
64 | .I SEND_UEVENT=<yes|not> | |
65 | Sends uevent when | |
66 | .I /dev/disk/by-{label,uuid}/ | |
67 | symlink does not match with LABEL or UUID on the device. Default is "yes". | |
68 | .TP | |
69 | .I CACHE_FILE=<path> | |
70 | Overrides the standard location of the cache file. This setting can be | |
71 | overridden by the environment variable BLKID_FILE. Default is | |
72 | .I /etc/blkid.tab. | |
73 | .TP | |
74 | .I EVALUATE=<methods> | |
75 | Defines LABEL and UUID evaluation method(s). Currently, the libblkid library | |
76 | supports "udev" and "scan" methods. More than one methods may be specified in | |
77 | a comma separated list. Default is "udev,scan". The "udev" method uses udev | |
78 | .I /dev/disk/by-* | |
79 | symlinks and the "scan" method scans all block devices from the | |
80 | .I /proc/partitions | |
81 | file. | |
a0948ffe KZ |
82 | .SH AUTHOR |
83 | .B libblkid | |
84 | was written by Andreas Dilger for the ext2 filesystem utilties, with input | |
85 | from Ted Ts'o. The library was subsequently heavily modified by Ted Ts'o. | |
0eb0aff9 KZ |
86 | |
87 | The low-level probing code was rewritten by Karel Zak. | |
a0948ffe | 88 | .SH FILES |
0eb0aff9 | 89 | .TP 18 |
a0948ffe | 90 | .I /etc/blkid.tab |
0eb0aff9 KZ |
91 | caches data extracted from each recognized block device |
92 | .TP | |
93 | .I /etc/blkid.conf | |
94 | configuration file | |
a0948ffe KZ |
95 | .SH AVAILABILITY |
96 | .B libblkid | |
601d12fb KZ |
97 | is part of the util-linux package since version 2.15 and is available from |
98 | ftp://ftp.kernel.org/pub/linux/utils/util-linux/. | |
a0948ffe KZ |
99 | .SH COPYING |
100 | .B libblkid | |
101 | is available under the terms of the GNU Library General Public License (LGPL), | |
c632883f | 102 | version 2 (or at your discretion any later version). |
a0948ffe KZ |
103 | .SH "SEE ALSO" |
104 | .BR blkid (8) | |
fc7a1669 | 105 | .BR findfs (8) |