134 lines
4.2 KiB
HTML
134 lines
4.2 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of LIBBLKID</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>LIBBLKID</H1>
|
|
Section: Programmer's Manual (3)<BR>Updated: May 2009<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
libblkid - block device identification library
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>#include <<A HREF="file:///usr/include/blkid.h">blkid.h</A>></B>
|
|
|
|
<P>
|
|
<B>cc</B>
|
|
|
|
<I>file.c</I>
|
|
|
|
<B>-lblkid</B>
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
The
|
|
<B>libblkid</B>
|
|
|
|
library is used to identify block devices (disks) as to their content (e.g.
|
|
filesystem type) as well as extracting additional information such as
|
|
filesystem labels/volume names, unique identifiers/serial numbers.
|
|
A common use is to allow use of LABEL= and UUID= tags instead of hard-coding
|
|
specific block device names into configuration files.
|
|
<P>
|
|
|
|
The low-level part of the library also allows to extract information about
|
|
partitions and block device topology.
|
|
<P>
|
|
|
|
The high-level part of the library keeps information about block devices in a
|
|
cache file and is verified to still be valid before being returned to the user
|
|
(if the user has read permission on the raw block device, otherwise not).
|
|
The cache file also allows unprivileged users (normally anyone other
|
|
than root, or those not in the "disk" group) to locate devices by label/id.
|
|
The standard location of the cache file can be overridden by the
|
|
environment variable BLKID_FILE.
|
|
<P>
|
|
|
|
In situations where one is getting information about a single known device, it
|
|
does not impact performance whether the cache is used or not (unless you are
|
|
not able to read the block device directly).
|
|
<P>
|
|
|
|
The high-level part of the library supports two methods to evaluate LABEL/UUID.
|
|
It reads information directly from a block device or read information from
|
|
/dev/disk/by-* udev symlinks. The udev is preferred method by default.
|
|
<P>
|
|
|
|
If you are dealing with
|
|
multiple devices, use of the cache is highly recommended (even if empty) as
|
|
devices will be scanned at most one time and the on-disk cache will be
|
|
updated if possible.
|
|
<P>
|
|
|
|
In some cases (modular kernels), block devices are not even visible until
|
|
after they are accessed the first time, so it is critical that there is
|
|
some way to locate these devices without enumerating only visible devices,
|
|
so the use of the cache file is
|
|
<B>required</B>
|
|
|
|
in this situation.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>CONFIGURATION FILE</H2>
|
|
|
|
The standard location of the
|
|
<I>/etc/blkid.conf</I>
|
|
|
|
config file can be overridden by the environment variable BLKID_CONF. For more
|
|
details about the config file see
|
|
<B><A HREF="/cgi-bin/man/man2html?8+blkid">blkid</A></B>(8)
|
|
|
|
man page.
|
|
<A NAME="lbAF"> </A>
|
|
<H2>AUTHOR</H2>
|
|
|
|
<B>libblkid</B>
|
|
|
|
was written by Andreas Dilger for the ext2 filesystem utilities, with input
|
|
from Ted Ts'o. The library was subsequently heavily modified by Ted Ts'o.
|
|
<P>
|
|
The low-level probing code was rewritten by Karel Zak.
|
|
<A NAME="lbAG"> </A>
|
|
<H2>COPYING</H2>
|
|
|
|
<B>libblkid</B>
|
|
|
|
is available under the terms of the GNU Library General Public License (LGPL),
|
|
version 2 (or at your discretion any later version).
|
|
<A NAME="lbAH"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+blkid">blkid</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+findfs">findfs</A></B>(8)
|
|
|
|
<A NAME="lbAI"> </A>
|
|
<H2>AVAILABILITY</H2>
|
|
|
|
libblkid is part of the util-linux package since version 2.15 and is available from
|
|
<A HREF="https://www.kernel.org/pub/linux/utils/util-linux/.">https://www.kernel.org/pub/linux/utils/util-linux/.</A>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="2"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="3"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="4"><A HREF="#lbAE">CONFIGURATION FILE</A><DD>
|
|
<DT id="5"><A HREF="#lbAF">AUTHOR</A><DD>
|
|
<DT id="6"><A HREF="#lbAG">COPYING</A><DD>
|
|
<DT id="7"><A HREF="#lbAH">SEE ALSO</A><DD>
|
|
<DT id="8"><A HREF="#lbAI">AVAILABILITY</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:47 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|