glfs/postlfs/filesystems/lvm2.xml
Bruce Dubbs 82e1be512d Update to cryptsetup-2.0.4.
Update to xfsprogs-4.17.0. 
Tags.



git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@20311 af4574ff-66df-0310-9fd7-8a98e5e911e0
2018-08-16 01:24:48 +00:00

449 lines
15 KiB
XML

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../../general.ent">
%general-entities;
<!ENTITY lvm2-download-http "https://sourceware.org/ftp/lvm2/releases/LVM2.&lvm2-version;.tgz">
<!ENTITY lvm2-download-ftp "ftp://sourceware.org/pub/lvm2/releases/LVM2.&lvm2-version;.tgz">
<!ENTITY lvm2-md5sum "ee6cfbc5a0c5696ffae79dac04ee7a2b">
<!ENTITY lvm2-size "2.3 MB">
<!ENTITY lvm2-buildsize "33 MB (add 60 MB for tests, however transient files can grow up to around 500 MB)">
<!ENTITY lvm2-time "0.2 SBU (using parallelism=4; add 21 SBU for tests)">
]>
<sect1 id="lvm2" xreflabel="LVM2-&lvm2-version;">
<?dbhtml filename="lvm2.html"?>
<sect1info>
<othername>$LastChangedBy$</othername>
<date>$Date$</date>
</sect1info>
<title>LVM2-&lvm2-version;</title>
<indexterm zone="lvm2">
<primary sortas="a-LVM2">LVM2</primary>
</indexterm>
<sect2 role="package">
<title>Introduction to LVM2</title>
<para>
The <application>LVM2</application> package is a set of tools that manage
logical partitions. It allows spanning of file systems across multiple
physical disks and disk partitions and provides for dynamic growing or
shrinking of logical partitions, mirroring and low storage footprint
snapshots.
</para>
&lfs83_checked;
<bridgehead renderas="sect3">Package Information</bridgehead>
<itemizedlist spacing="compact">
<listitem>
<para>
Download (HTTP): <ulink url="&lvm2-download-http;"/>
</para>
</listitem>
<listitem>
<para>
Download (FTP): <ulink url="&lvm2-download-ftp;"/>
</para>
</listitem>
<listitem>
<para>
Download MD5 sum: &lvm2-md5sum;
</para>
</listitem>
<listitem>
<para>
Download size: &lvm2-size;
</para>
</listitem>
<listitem>
<para>
Estimated disk space required: &lvm2-buildsize;
</para>
</listitem>
<listitem>
<para>
Estimated build time: &lvm2-time;
</para>
</listitem>
</itemizedlist>
<bridgehead renderas="sect3">LVM2 Dependencies</bridgehead>
<bridgehead renderas="sect4">Optional</bridgehead>
<para role="optional">
<xref linkend='mdadm'/>,
<xref linkend='reiserfs'/>,
<xref linkend='valgrind'/>,
<xref linkend='which'/>,
<xref linkend='xfsprogs'/> (all five may be used, but are not required,
for tests), and
<ulink url='https://github.com/jthornber/thin-provisioning-tools'>
thin-provisioning-tools</ulink>
</para>
<para condition="html" role="usernotes">User Notes:
<ulink url="&blfs-wiki;/lvm2"/>
</para>
<caution>
<para>
Kernel versions between 4.1 and 4.4.1 have a broken RAID
implementation. If you want to use RAID type LV's, you should install
kernel version 4.4.2 or above. Note that several tests use RAID logical
volumes, and can generate a <quote>kernel oops</quote> with the faulty
kernel version, which usually renders the system unusable.
</para>
</caution>
</sect2>
<sect2 role="kernel" id="lvm2-kernel">
<title>Kernel Configuration</title>
<para>
Enable the following options in the kernel configuration
and recompile the kernel:
</para>
<note><para>
There are several other Device Mapper options in the kernel beyond those
listed below. In order to get reasonable results if running the
regression tests, all must be enabled either internally or as a module.
The tests will all time out if Magic SysRq key is not enabled.
</para></note>
<screen><literal>Device Drivers ---&gt;
[*] Multiple devices driver support (RAID and LVM) ---&gt; [CONFIG_MD]
&lt;*/M&gt; Device mapper support [CONFIG_BLK_DEV_DM]
&lt;*/M/ &gt; Crypt target support [CONFIG_DM_CRYPT]
&lt;*/M/ &gt; Snapshot target [CONFIG_DM_SNAPSHOT]
&lt;*/M/ &gt; Thin provisioning target [CONFIG_DM_THIN_PROVISIONING]
&lt;*/M/ &gt; Mirror target [CONFIG_DM_MIRROR]
Kernel hacking ---&gt;
[*] Magic SysRq key [CONFIG_MAGIC_SYSRQ]</literal></screen>
<indexterm zone="lvm2 lvm2-kernel">
<primary sortas="d-lvm2">lvm2</primary>
</indexterm>
</sect2>
<sect2 role="installation">
<title>Installation of LVM2</title>
<para>
Install <application>LVM2</application> by running the following
commands:
</para>
<screen revision="sysv"><userinput>SAVEPATH=$PATH &amp;&amp;
PATH=$PATH:/sbin:/usr/sbin &amp;&amp;
./configure --prefix=/usr \
--exec-prefix= \
--enable-applib \
--enable-cmdlib \
--enable-pkgconfig \
--enable-udev_sync &amp;&amp;
make &amp;&amp;
PATH=$SAVEPATH &amp;&amp;
unset SAVEPATH</userinput></screen>
<screen revision="systemd"><userinput>SAVEPATH=$PATH &amp;&amp;
PATH=$PATH:/sbin:/usr/sbin &amp;&amp;
./configure --prefix=/usr \
--exec-prefix= \
--with-confdir=/etc \
--enable-applib \
--enable-cmdlib \
--enable-pkgconfig \
--enable-udev_sync &amp;&amp;
make &amp;&amp;
PATH=$SAVEPATH &amp;&amp;
unset SAVEPATH</userinput></screen>
<para>
The tests use <application>udev</application> for logical volume
synchronization, so that the LVM udev rules and some utilities need to
be installed before running the tests. If you are installing
<application>LVM2</application> for the first time, and do not
want to install the full package before running the tests, the minimal
set of utilities can be installed by running the following instructions
as the <systemitem class="username">root</systemitem> user:
</para>
<screen role="root"><userinput>make -C tools install_dmsetup_dynamic &amp;&amp;
make -C udev install &amp;&amp;
make -C libdm install</userinput></screen>
<para>
To test the results, issue: <command>make check_local</command> as the
<systemitem class="username">root</systemitem> user. Other targets are
available and can be listed with <command>make -C test help</command>.
The test timings are very dependent on the speed of the disk(s), and on
the number of enabled kernel options.
</para>
<!-- Results for LVM2.2.02.176:
### 292 tests: 177 passed, 46 skipped, 0 timed out, 60 warned, 9 failed
-->
<para>
The tests do not implement the <quote>expected fail</quote> possibility,
and a small number of test failures is expected by upstream. More
failures may happen because some kernel options are missing. For example,
the lack of the <emphasis>dm-delay</emphasis> device mapper target may
explain some failures. Some tests are flagged
<quote>warned</quote> if
<ulink url='https://github.com/jthornber/thin-provisioning-tools'>
thin-provisioning-tools</ulink> are not installed. A workaround is to
add the following flags to <command>configure</command>:
</para>
<screen role="nodump"><userinput> --with-thin-check= \
--with-thin-dump= \
--with-thin-repair= \
--with-thin-restore= \
--with-cache-check= \
--with-cache-dump= \
--with-cache-repair= \
--with-cache-restore= \</userinput></screen>
<para>
Some tests may hang with kernel versions in the 4.1 and 4.2 series (see
above). They can be removed if necessary, for example: <command>rm
test/shell/lvcreate-large-raid.sh</command>. The tests generate a lot
of kernel messages, which may clutter your terminal. You can disable them
by issuing <command>dmesg -D</command> before running the tests (do not
forget to issue <command>dmesg -E</command> when tests are done).
<note><simpara>The checks create device nodes in the /tmp directory. The
tests will fail if /tmp is mounted with the nodev
option.</simpara></note>
</para>
<para>
Now, as the <systemitem class="username">root</systemitem> user:
</para>
<screen role="root"><userinput>make install</userinput></screen>
</sect2>
<sect2 role="commands">
<title>Command Explanations</title>
<para>
<command>PATH=$PATH:/sbin:/usr/sbin</command>: The path
must contain <filename class="directory">/sbin</filename> and
<filename class='directory'>/usr/sbin</filename> for proper system tool
detection by the <command>configure</command> script. This instruction
ensures that PATH is properly set even if you build as an unprivileged user.
</para>
<para>
<parameter>--enable-applib</parameter>: This switch enables
building of the shared application library.
</para>
<para>
<parameter>--enable-cmdlib</parameter>: This switch enables
building of the shared command library. It is required
when building the event daemon.
</para>
<para>
<parameter>--enable-pkgconfig</parameter>: This switch enables
installation of <command>pkg-config</command> support files.
</para>
<para>
<parameter>--enable-udev_sync</parameter>: This switch enables
synchronisation with <application>Udev</application> processing.
</para>
<para>
<option>--enable-dmeventd</option>: This switch enables
building of the <application>Device Mapper</application>
event daemon.
</para>
<para>
<option>--enable-lvmetad</option>: This switch enables
building of the <application>LVM</application> metadata daemon,
which avoids scanning all the filesystems when an lvm command is
run.
</para>
</sect2>
<sect2 role="content">
<title>Contents</title>
<segmentedlist>
<segtitle>Installed Programs</segtitle>
<segtitle>Installed Libraries</segtitle>
<segtitle>Installed Directories</segtitle>
<seglistitem>
<seg>
blkdeactivate, dmeventd (optional), dmsetup, fsadm, lvm, lvmconf,
lvmdump, and lvmetad (optional). There are also
numerous symbolic links to lvm that implement specific
functionalities
</seg>
<seg>
libdevmapper.so, liblvm2app.so, and liblvm2cmd.so; optional:
libdevmapper-event.so, libdevmapper-event-lvm2.so,
libdevmapper-event-lvm2mirror.so, libdevmapper-event-lvm2snapshot.so,
libdevmapper-event-lvm2raid.so, and libdevmapper-event-lvm2thin.so
</seg>
<seg>
/etc/lvm and
/lib/device-mapper (optional)
</seg>
</seglistitem>
</segmentedlist>
<variablelist>
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
<?dbfo list-presentation="list"?>
<?dbhtml list-presentation="table"?>
<varlistentry id="blkdeactivate">
<term><command>blkdeactivate</command></term>
<listitem>
<para>
is a utility to deactivate block device.
</para>
<indexterm zone="lvm2 blkdeactivate">
<primary sortas="b-blkdeactivate">blkdeactivate</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="dmeventd">
<term><command>dmeventd</command></term>
<listitem>
<para>
(optional) is the Device Mapper event daemon.
</para>
<indexterm zone="lvm2 dmeventd">
<primary sortas="b-dmeventd">dmeventd</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="dmsetup">
<term><command>dmsetup</command></term>
<listitem>
<para>
is a low level logical volume management tool.
</para>
<indexterm zone="lvm2 dmsetup">
<primary sortas="b-dmsetup">dmsetup</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="fsadm">
<term><command>fsadm</command></term>
<listitem>
<para>
is a utility used to resize or check filesystem on a device.
</para>
<indexterm zone="lvm2 fsadm">
<primary sortas="b-fsadm">fsadm</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="lvm">
<term><command>lvm</command></term>
<listitem>
<para>
provides the command-line tools for <application>LVM2</application>.
Commands are implemented via sympolic links to this program to
manage physical devices (pv*), volume groups (vg*) and logical
volumes (lv*).
</para>
<indexterm zone="lvm2 lvm">
<primary sortas="b-lvm">lvm</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="lvmconf">
<term><command>lvmconf</command></term>
<listitem>
<para>
is a script that modifies the locking configuration in
the <application>LVM2</application> configuration file.
</para>
<indexterm zone="lvm2 lvmconf">
<primary sortas="b-lvmconf">lvmconf</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="lvmdump">
<term><command>lvmdump</command></term>
<listitem>
<para>
is a tool used to dump various information concerning
<application>LVM2</application>.
</para>
<indexterm zone="lvm2 lvmdump">
<primary sortas="b-lvmdump">lvmdump</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="lvmetad">
<term><command>lvmetad</command></term>
<listitem>
<para>
(optional) is the LVM metadata daemon.
</para>
<indexterm zone="lvm2 lvmetad">
<primary sortas="b-lvmetad">lvmetad</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="vgimportclone">
<term><command>vgimportclone</command></term>
<listitem>
<para>
is used to import a duplicated VG (e.g. hardware snapshot).
</para>
<indexterm zone="lvm2 vgimportclone">
<primary sortas="b-vgimportclone">vgimportclone</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="libdevmapper">
<term><filename class='libraryfile'>libdevmapper.so</filename></term>
<listitem>
<para>
contains the <application>Device Mapper</application> API
functions.
</para>
<indexterm zone="lvm2 libdevmapper">
<primary sortas="c-libdevmapper">libdevmapper.so</primary>
</indexterm>
</listitem>
</varlistentry>
</variablelist>
</sect2>
</sect1>