bigbiff | 7b4c7a6 | 2015-01-01 19:44:14 -0500 | [diff] [blame] | 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 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 |
| 11 | libblkid \- 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 |
| 19 | The |
| 20 | .B libblkid |
| 21 | library is used to identify block devices (disks) as to their content (e.g. |
| 22 | filesystem type) as well as extracting additional information such as |
| 23 | filesystem labels/volume names, unique identifiers/serial numbers. |
| 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 |
| 27 | The low-level part of the library also allows to extract information about |
| 28 | partitions and block device topology. |
| 29 | .P |
| 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 |
| 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 |
| 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 |
| 40 | not able to read the block device directly). |
| 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 |
| 44 | /dev/disk/by-* udev symlinks. The udev is preferred method by default. |
| 45 | .P |
| 46 | If you are dealing with |
| 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 |
| 49 | updated if possible. |
| 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. |
| 57 | .SH CONFIGURATION FILE |
| 58 | The standard location of the |
| 59 | .I /etc/blkid.conf |
| 60 | config file can be overridden by the environment variable BLKID_CONF. For more |
| 61 | details about the config file see |
| 62 | .BR blkid (8) |
| 63 | man page. |
| 64 | .SH AUTHOR |
| 65 | .B libblkid |
| 66 | was written by Andreas Dilger for the ext2 filesystem utilties, with input |
| 67 | from Ted Ts'o. The library was subsequently heavily modified by Ted Ts'o. |
| 68 | |
| 69 | The low-level probing code was rewritten by Karel Zak. |
| 70 | .SH COPYING |
| 71 | .B libblkid |
| 72 | is available under the terms of the GNU Library General Public License (LGPL), |
| 73 | version 2 (or at your discretion any later version). |
| 74 | .SH "SEE ALSO" |
| 75 | .BR blkid (8), |
| 76 | .BR findfs (8) |
| 77 | .SH AVAILABILITY |
| 78 | libblkid is part of the util-linux package since version 2.15 and is available from |
| 79 | ftp://ftp.kernel.org/pub/linux/utils/util-linux/. |