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