2012-01-21 03:25:30 +08:00
<?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;
2019-01-21 05:04:35 +08:00
<!ENTITY lvm2-download-http "https://sourceware.org/ftp/lvm2/LVM2.&lvm2-version;.tgz">
2023-10-16 03:43:08 +08:00
<!ENTITY lvm2-download-ftp " ">
2023-08-05 01:43:24 +08:00
<!ENTITY lvm2-md5sum "a97cf533222a5760225dbd26c3982ca6">
2022-11-16 15:17:43 +08:00
<!ENTITY lvm2-size "2.6 MB">
2023-08-05 01:43:24 +08:00
<!ENTITY lvm2-buildsize "38 MB (add 20 MB for tests; transient files can grow up to around 300 MB in the /tmp directory during tests)">
2020-08-11 15:52:15 +08:00
<!-- My build size was 124 MB with tests, but I'll leave this here. - renodr
2021-05-10 04:42:00 +08:00
The files in /tmp are transient. I monitor /tmp with a loop during
2023-08-27 16:04:08 +08:00
tests. -pierre, August 2020
2023-08-05 01:43:24 +08:00
Build size with tests was 58M. The largest size of /tmp I saw was 289MB.
### 412 tests: 245 passed, 155 skipped, 0 timed out, 1 warned, 11 failed
Aug 2023 LVM2.2.03.22 - bdubbs
-->
2023-04-23 05:49:15 +08:00
<!ENTITY lvm2-time "0.1 SBU (using parallelism=4; add 9 to 48 SBU for tests, depending on disk speed and whether ram block device is enabled in the kernel)">
2012-01-21 03:25:30 +08:00
]>
2012-08-01 07:44:40 +08:00
<sect1 id= "lvm2" xreflabel= "LVM2-&lvm2-version;" >
2012-01-21 03:25:30 +08:00
<?dbhtml filename="lvm2.html"?>
2012-08-01 07:44:40 +08:00
<title > LVM2-&lvm2-version; </title>
2012-01-21 03:25:30 +08:00
<indexterm zone= "lvm2" >
2012-08-01 07:44:40 +08:00
<primary sortas= "a-LVM2" > LVM2</primary>
2012-01-21 03:25:30 +08:00
</indexterm>
<sect2 role= "package" >
2012-08-01 07:44:40 +08:00
<title > Introduction to LVM2</title>
2012-01-21 03:25:30 +08:00
2012-08-01 07:44:40 +08:00
<para >
2015-10-25 19:23:37 +08:00
The <application > LVM2</application> package is a set of tools that manage
2012-08-01 07:44:40 +08:00
logical partitions. It allows spanning of file systems across multiple
physical disks and disk partitions and provides for dynamic growing or
2015-10-25 19:23:37 +08:00
shrinking of logical partitions, mirroring and low storage footprint
snapshots.
2012-08-01 07:44:40 +08:00
</para>
2012-01-21 03:25:30 +08:00
2023-08-17 13:43:52 +08:00
&lfs120_checked;
2012-01-21 03:25:30 +08:00
<bridgehead renderas= "sect3" > Package Information</bridgehead>
<itemizedlist spacing= "compact" >
2012-05-26 03:02:35 +08:00
<listitem >
2012-08-01 07:44:40 +08:00
<para >
Download (HTTP): <ulink url= "&lvm2-download-http;" />
</para>
2012-05-26 03:02:35 +08:00
</listitem>
2012-01-21 03:25:30 +08:00
<listitem >
2012-08-01 07:44:40 +08:00
<para >
Download (FTP): <ulink url= "&lvm2-download-ftp;" />
</para>
2012-01-21 03:25:30 +08:00
</listitem>
<listitem >
2012-08-01 07:44:40 +08:00
<para >
Download MD5 sum: &lvm2-md5sum;
</para>
2012-01-21 03:25:30 +08:00
</listitem>
<listitem >
2012-08-01 07:44:40 +08:00
<para >
Download size: &lvm2-size;
</para>
2012-01-21 03:25:30 +08:00
</listitem>
<listitem >
2012-08-01 07:44:40 +08:00
<para >
Estimated disk space required: &lvm2-buildsize;
</para>
2012-01-21 03:25:30 +08:00
</listitem>
<listitem >
2012-08-01 07:44:40 +08:00
<para >
Estimated build time: &lvm2-time;
</para>
2012-01-21 03:25:30 +08:00
</listitem>
</itemizedlist>
2013-08-28 01:06:41 +08:00
<bridgehead renderas= "sect3" > LVM2 Dependencies</bridgehead>
2018-10-16 07:02:27 +08:00
<bridgehead renderas= "sect4" > Required</bridgehead>
<para role= "required" >
2019-01-03 11:20:16 +08:00
<xref linkend= 'libaio' />
2018-10-16 07:02:27 +08:00
</para>
2013-08-28 01:06:41 +08:00
<bridgehead renderas= "sect4" > Optional</bridgehead>
<para role= "optional" >
2015-10-25 19:23:37 +08:00
<xref linkend= 'mdadm' /> ,
<xref linkend= 'valgrind' /> ,
<xref linkend= 'which' /> ,
2023-09-03 07:39:11 +08:00
<xref linkend= 'xfsprogs' /> (all four may be used, but are not required,
2021-01-12 09:58:11 +08:00
for tests),
2023-09-03 07:39:11 +08:00
<ulink
url='https://mirrors.edge.kernel.org/pub/linux/kernel/people/jeffm/reiserfsprogs/'>
reiserfsprogs</ulink> ,
2015-10-25 19:23:37 +08:00
<ulink url= 'https://github.com/jthornber/thin-provisioning-tools' >
2021-01-12 09:58:11 +08:00
thin-provisioning-tools</ulink> , and
<ulink url= "https://github.com/dm-vdo/vdo" > vdo</ulink>
2013-08-28 01:06:41 +08:00
</para>
2012-01-21 03:25:30 +08:00
</sect2>
2012-08-01 07:44:40 +08:00
<sect2 role= "kernel" id= "lvm2-kernel" >
2012-02-17 13:39:57 +08:00
<title > Kernel Configuration</title>
2012-08-01 07:44:40 +08:00
<para >
2014-12-01 02:10:25 +08:00
Enable the following options in the kernel configuration
2012-08-01 07:44:40 +08:00
and recompile the kernel:
</para>
2012-02-17 13:39:57 +08:00
2013-08-28 01:06:41 +08:00
<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.
2016-06-11 02:43:02 +08:00
The tests will all time out if Magic SysRq key is not enabled.
2013-08-28 01:06:41 +08:00
</para> </note>
2023-07-30 18:01:56 +08:00
<xi:include xmlns:xi= "http://www.w3.org/2001/XInclude"
href="lvm2-kernel.xml"/>
2012-02-17 13:39:57 +08:00
<indexterm zone= "lvm2 lvm2-kernel" >
<primary sortas= "d-lvm2" > lvm2</primary>
</indexterm>
</sect2>
2012-01-21 03:25:30 +08:00
<sect2 role= "installation" >
2012-08-01 07:44:40 +08:00
<title > Installation of LVM2</title>
2012-01-21 03:25:30 +08:00
2012-08-01 07:44:40 +08:00
<para >
Install <application > LVM2</application> by running the following
commands:
</para>
2012-01-21 03:25:30 +08:00
2021-06-27 16:43:19 +08:00
<screen > <userinput > PATH+=:/usr/sbin \
2015-11-01 01:46:51 +08:00
./configure --prefix=/usr \
2012-08-13 23:17:23 +08:00
--enable-cmdlib \
--enable-pkgconfig \
2014-08-12 08:44:56 +08:00
--enable-udev_sync & &
2021-07-07 07:45:30 +08:00
make</userinput> </screen>
2012-01-21 03:25:30 +08:00
2012-08-01 07:44:40 +08:00
<para >
2015-10-25 19:23:37 +08:00
The tests use <application > udev</application> for logical volume
2019-01-03 11:20:16 +08:00
synchronization, so the LVM udev rules and some utilities need to
2015-10-25 19:23:37 +08:00
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>
2019-08-13 21:50:16 +08:00
<screen role= "root"
remap="test"><userinput > make -C tools install_tools_dynamic & &
2022-11-23 02:12:38 +08:00
make -C udev install & &
2015-10-25 19:23:37 +08:00
make -C libdm install</userinput> </screen>
<para >
2019-08-13 21:50:16 +08:00
To test the results, issue, as the
<systemitem class= "username" > root</systemitem> user:
</para>
<screen role= "root"
2022-11-16 15:17:43 +08:00
remap="test"><userinput > LC_ALL=en_US.UTF-8 make check_local</userinput> </screen>
2019-08-13 21:50:16 +08:00
<para >
2022-11-16 15:17:43 +08:00
Some tests may hang. In this case they can be skipped by adding
<command > S=< testname> </command> to the <command > make</command>
command.
2019-08-13 21:50:16 +08:00
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.
2015-10-28 17:45:44 +08:00
</para>
2017-04-15 09:13:42 +08:00
2017-11-09 18:48:19 +08:00
<!-- Results for LVM2.2.02.176:
### 292 tests: 177 passed, 46 skipped, 0 timed out, 60 warned, 9 failed
2018-11-17 06:34:56 +08:00
Results for LVM2.2.03.01:
### 302 tests: 182 passed, 43 skipped, 0 timed out, 62 warned, 15 failed
2019-06-28 09:46:05 +08:00
Results for LVM2.2.03.05:
### 326 tests: 255 passed, 58 skipped, 0 timed out, 2 warned, 11 failed
2020-03-28 09:18:30 +08:00
Results for LVM2.2.03.09:
### 338 tests: 212 passed, 41 skipped, 0 timed out, 70 warned, 15 failed
2021-01-12 09:58:11 +08:00
Results for LVM2.2.03.11:
### 357 tests: 231 passed, 32 skipped, 0 timed out, 77 warned, 17 failed
2021-10-29 15:40:06 +08:00
Results for LVM2.2.03.14:
### 389 tests: 304 passed, 73 skipped, 0 timed out, 2 warned, 10 failed
2022-05-20 00:27:06 +08:00
Results for LVM2.2.03.16:
### 395 tests: 241 passed, 145 skipped, 0 timed out, 1 warned, 8 failed
2022-11-16 15:17:43 +08:00
Results for LVM2.2.03.17:
### 403 tests: 333 passed, 61 skipped, 0 timed out, 3 warned, 6 failed
2023-03-30 16:37:06 +08:00
Results for LVM2.2.03.20 [pierre]:
### 407 tests: 324 passed, 75 skipped, 0 timed out, 3 warned, 5 failed
2017-04-15 09:13:42 +08:00
-->
2015-10-28 17:45:44 +08:00
<para >
2018-01-10 18:44:47 +08:00
The tests do not implement the <quote > expected fail</quote> possibility,
2021-09-07 01:42:49 +08:00
and a small number of test failures is expected by upstream.
<!-- 1 --> More failures may happen because some kernel options are missing.
For example, the lack of the <emphasis > dm-delay</emphasis> device
mapper target explains some failures.
<!-- 2 --> Some tests may fail if there is insufficient free space available
in the partition with the /tmp directory. At least one test fails if 16 TB
2021-08-14 03:39:02 +08:00
is not available.
<!-- 3 --> Some tests are flagged <quote > warned</quote> if
2015-10-28 17:45:44 +08:00
<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 >
2019-01-21 05:04:35 +08:00
Some tests may hang. They can be removed if necessary, for example:
<command > rm test/shell/lvconvert-raid-reshape.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).
2018-01-14 08:20:34 +08:00
<note > <simpara > The checks create device nodes in the /tmp directory. The
2021-08-14 03:39:02 +08:00
tests will fail if /tmp is mounted with the nodev option.
</simpara> </note>
2012-08-01 07:44:40 +08:00
</para>
2012-01-21 03:25:30 +08:00
2012-08-01 07:44:40 +08:00
<para >
Now, as the <systemitem class= "username" > root</systemitem> user:
</para>
2012-01-21 03:25:30 +08:00
2021-10-29 21:01:35 +08:00
<screen role= "root" revision= "sysv" > <userinput > make install
2022-11-16 15:17:43 +08:00
rm -fv /usr/lib/udev/rules.d/69-dm-lvm.rules</userinput> </screen>
2020-06-29 15:38:45 +08:00
<screen role= "root" revision= "systemd" > <userinput > make install
make install_systemd_units</userinput> </screen>
2012-01-21 03:25:30 +08:00
</sect2>
<sect2 role= "commands" >
<title > Command Explanations</title>
2015-11-01 01:46:51 +08:00
<para >
2021-06-27 16:43:19 +08:00
<command > PATH+=:/usr/sbin</command> : The path
must contain
2015-11-01 01:46:51 +08:00
<filename class= 'directory' > /usr/sbin</filename> for proper system tool
2016-01-18 04:08:57 +08:00
detection by the <command > configure</command> script. This instruction
2016-01-31 06:29:20 +08:00
ensures that PATH is properly set even if you build as an unprivileged user.
2015-11-01 01:46:51 +08:00
</para>
2012-08-01 07:44:40 +08:00
<para >
2013-12-29 03:44:53 +08:00
<parameter > --enable-cmdlib</parameter> : This switch enables
2012-08-01 07:44:40 +08:00
building of the shared command library. It is required
when building the event daemon.
</para>
<para >
2013-12-29 03:44:53 +08:00
<parameter > --enable-pkgconfig</parameter> : This switch enables
2012-08-01 07:44:40 +08:00
installation of <command > pkg-config</command> support files.
</para>
<para >
2013-12-29 03:44:53 +08:00
<parameter > --enable-udev_sync</parameter> : This switch enables
2012-08-01 07:44:40 +08:00
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>
2012-01-21 03:25:30 +08:00
2021-10-29 21:01:35 +08:00
<para revision= "sysv" >
<command > rm .../69-dm-lvm.rules</command> : Under certain circumstances,
this udev rule calls <command > systemd-run</command> , which is not
available on sysv. It performs actions that are done by another boot
script anyway, so it is not needed.
</para>
2020-06-29 15:38:45 +08:00
<para revision= "systemd" >
<command > make install_systemd_units</command> : This is needed to install
a unit that activates logical volumes at boot. It is not installed
by default.
</para>
2012-01-21 03:25:30 +08:00
</sect2>
2022-04-08 05:48:45 +08:00
<sect2 role= "configuration" revision= "systemd" >
<title > Configuring LVM2</title>
<sect3 id= "lvm2-config" >
<title > Config File</title>
<para >
<filename > /etc/lvm/lvm.conf</filename>
</para>
<indexterm zone= "lvm2 lvm2-config" >
<primary
sortas="e-etc-lvm-lvm.conf">/etc/lvm/lvm.conf</primary>
</indexterm>
</sect3>
<sect3 > <title > Configuration Information</title>
<para >
The default configuration still references the obsolete <filename
class="directory">/var/lock</filename> directory. This creates
2022-04-08 06:26:06 +08:00
a deadlock at boot time. Change this (as the <systemitem
2022-04-08 05:48:45 +08:00
class="username">root</systemitem> user):
</para>
<screen role= "root" > <userinput > sed -e '/locking_dir =/{s/#//;s/var/run/}' \
-i /etc/lvm/lvm.conf</userinput> </screen>
</sect3>
</sect2>
2012-01-21 03:25:30 +08:00
<sect2 role= "content" >
<title > Contents</title>
<segmentedlist >
<segtitle > Installed Programs</segtitle>
<segtitle > Installed Libraries</segtitle>
2013-01-26 00:32:25 +08:00
<segtitle > Installed Directories</segtitle>
2012-01-21 03:25:30 +08:00
<seglistitem >
2012-08-01 07:44:40 +08:00
<seg >
2021-10-29 15:40:06 +08:00
blkdeactivate, dmeventd (optional), dmsetup, fsadm, lvm, lvmdump,
and lvm_import_vdo.
2019-06-28 09:46:05 +08:00
There are also numerous symbolic links to lvm that implement specific
2015-10-28 05:31:05 +08:00
functionalities
2012-08-01 07:44:40 +08:00
</seg>
<seg >
2019-06-28 09:46:05 +08:00
libdevmapper.so and liblvm2cmd.so; optional:
2013-11-15 00:25:22 +08:00
libdevmapper-event.so, libdevmapper-event-lvm2.so,
2020-08-11 15:52:15 +08:00
libdevmapper-event-lvm2mirror.so, libdevmapper-event-lvm2raid.so,
2021-10-29 15:40:06 +08:00
libdevmapper-event-lvm2snapshot.so, libdevmapper-event-lvm2thin.so,
and libdevmapper-event-lvm2vdo.so
2012-08-01 07:44:40 +08:00
</seg>
2013-01-26 00:32:25 +08:00
<seg >
2013-11-15 00:25:22 +08:00
/etc/lvm and
2021-10-29 15:40:06 +08:00
/usr/lib/device-mapper (optional)
2013-01-26 00:32:25 +08:00
</seg>
2012-01-21 03:25:30 +08:00
</seglistitem>
</segmentedlist>
<variablelist >
<bridgehead renderas= "sect3" > Short Descriptions</bridgehead>
<?dbfo list-presentation="list"?>
2014-06-27 18:04:17 +08:00
<?dbhtml list-presentation="table"?>
2012-01-21 03:25:30 +08:00
2014-01-23 09:39:32 +08:00
<varlistentry id= "blkdeactivate" >
<term > <command > blkdeactivate</command> </term>
<listitem >
<para >
2021-02-19 23:20:16 +08:00
is a utility to deactivate block devices
2014-01-23 09:39:32 +08:00
</para>
<indexterm zone= "lvm2 blkdeactivate" >
<primary sortas= "b-blkdeactivate" > blkdeactivate</primary>
</indexterm>
</listitem>
</varlistentry>
2013-11-15 00:25:22 +08:00
<varlistentry id= "dmeventd" >
<term > <command > dmeventd</command> </term>
<listitem >
<para >
2021-02-19 23:20:16 +08:00
(optional) is the Device Mapper event daemon
2013-11-15 00:25:22 +08:00
</para>
<indexterm zone= "lvm2 dmeventd" >
<primary sortas= "b-dmeventd" > dmeventd</primary>
</indexterm>
</listitem>
</varlistentry>
2012-01-21 03:25:30 +08:00
<varlistentry id= "dmsetup" >
<term > <command > dmsetup</command> </term>
<listitem >
2012-08-01 07:44:40 +08:00
<para >
2021-02-19 23:20:16 +08:00
is a low level logical volume management tool
2012-08-01 07:44:40 +08:00
</para>
2012-01-21 03:25:30 +08:00
<indexterm zone= "lvm2 dmsetup" >
<primary sortas= "b-dmsetup" > dmsetup</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id= "fsadm" >
<term > <command > fsadm</command> </term>
<listitem >
2012-08-01 07:44:40 +08:00
<para >
2021-02-19 23:20:16 +08:00
is a utility used to resize or check filesystem on a device
2012-08-01 07:44:40 +08:00
</para>
2012-01-21 03:25:30 +08:00
<indexterm zone= "lvm2 fsadm" >
<primary sortas= "b-fsadm" > fsadm</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id= "lvm" >
<term > <command > lvm</command> </term>
<listitem >
2012-08-01 07:44:40 +08:00
<para >
provides the command-line tools for <application > LVM2</application> .
2022-03-25 11:26:08 +08:00
Commands are implemented via symbolic links to this program to
2012-08-01 07:44:40 +08:00
manage physical devices (pv*), volume groups (vg*) and logical
2021-02-19 23:20:16 +08:00
volumes (lv*)
2012-08-01 07:44:40 +08:00
</para>
2012-01-21 03:25:30 +08:00
<indexterm zone= "lvm2 lvm" >
<primary sortas= "b-lvm" > lvm</primary>
</indexterm>
</listitem>
</varlistentry>
2019-06-28 09:46:05 +08:00
<!--
2012-01-21 03:25:30 +08:00
<varlistentry id= "lvmconf" >
<term > <command > lvmconf</command> </term>
<listitem >
2012-08-01 07:44:40 +08:00
<para >
2013-02-12 02:51:17 +08:00
is a script that modifies the locking configuration in
2012-08-01 07:44:40 +08:00
the <application > LVM2</application> configuration file.
</para>
2012-01-21 03:25:30 +08:00
<indexterm zone= "lvm2 lvmconf" >
<primary sortas= "b-lvmconf" > lvmconf</primary>
</indexterm>
</listitem>
</varlistentry>
2019-06-28 09:46:05 +08:00
-->
2012-01-21 03:25:30 +08:00
<varlistentry id= "lvmdump" >
<term > <command > lvmdump</command> </term>
<listitem >
2012-08-01 07:44:40 +08:00
<para >
is a tool used to dump various information concerning
2021-02-19 23:20:16 +08:00
<application > LVM2</application>
2012-08-01 07:44:40 +08:00
</para>
2012-01-21 03:25:30 +08:00
<indexterm zone= "lvm2 lvmdump" >
<primary sortas= "b-lvmdump" > lvmdump</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id= "vgimportclone" >
<term > <command > vgimportclone</command> </term>
<listitem >
2012-08-01 07:44:40 +08:00
<para >
2021-02-19 23:20:16 +08:00
is used to import a duplicated VG (e.g. hardware snapshot)
2012-08-01 07:44:40 +08:00
</para>
2012-01-21 03:25:30 +08:00
<indexterm zone= "lvm2 vgimportclone" >
<primary sortas= "b-vgimportclone" > vgimportclone</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id= "libdevmapper" >
2021-02-19 23:20:16 +08:00
<term > <filename class= "libraryfile" > libdevmapper.so</filename> </term>
2012-01-21 03:25:30 +08:00
<listitem >
2012-08-01 07:44:40 +08:00
<para >
contains the <application > Device Mapper</application> API
2021-02-19 23:20:16 +08:00
functions
2012-08-01 07:44:40 +08:00
</para>
2012-01-21 03:25:30 +08:00
<indexterm zone= "lvm2 libdevmapper" >
<primary sortas= "c-libdevmapper" > libdevmapper.so</primary>
</indexterm>
</listitem>
</varlistentry>
</variablelist>
</sect2>
</sect1>