source: postlfs/filesystems/lvm2.xml@ e440af5

12.0 12.1 ken/TL2024 ken/tuningfonts lazarus plabs/newcss python3.11 rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18
Last change on this file since e440af5 was e440af5, checked in by Pierre Labastie <pierre.labastie@…>, 10 months ago

Remove trailing spaces and a few typos

  • Property mode set to 100644
File size: 16.0 KB
RevLine 
[8bc3edae]1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
[0dc5c2e1]7 <!ENTITY lvm2-download-http "https://sourceware.org/ftp/lvm2/LVM2.&lvm2-version;.tgz">
[e65320b]8 <!ENTITY lvm2-download-ftp "ftp://sourceware.org/pub/lvm2/LVM2.&lvm2-version;.tgz">
[e5e327a]9 <!ENTITY lvm2-md5sum "a97cf533222a5760225dbd26c3982ca6">
[213d18c]10 <!ENTITY lvm2-size "2.6 MB">
[e5e327a]11 <!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)">
[8ec0245]12 <!-- My build size was 124 MB with tests, but I'll leave this here. -renodr
[0936f56]13 The files in /tmp are transient. I monitor /tmp with a loop during
[e440af5]14 tests. -pierre, August 2020
[e5e327a]15
16 Build size with tests was 58M. The largest size of /tmp I saw was 289MB.
17 ### 412 tests: 245 passed, 155 skipped, 0 timed out, 1 warned, 11 failed
18 Aug 2023 LVM2.2.03.22 - bdubbs
19 -->
[ad95d18]20 <!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)">
[8bc3edae]21]>
22
[c627795]23<sect1 id="lvm2" xreflabel="LVM2-&lvm2-version;">
[8bc3edae]24 <?dbhtml filename="lvm2.html"?>
25
26
[c627795]27 <title>LVM2-&lvm2-version;</title>
[8bc3edae]28
29 <indexterm zone="lvm2">
[c627795]30 <primary sortas="a-LVM2">LVM2</primary>
[8bc3edae]31 </indexterm>
32
33 <sect2 role="package">
[c627795]34 <title>Introduction to LVM2</title>
[8bc3edae]35
[c627795]36 <para>
[99fcc47]37 The <application>LVM2</application> package is a set of tools that manage
[c627795]38 logical partitions. It allows spanning of file systems across multiple
39 physical disks and disk partitions and provides for dynamic growing or
[99fcc47]40 shrinking of logical partitions, mirroring and low storage footprint
41 snapshots.
[c627795]42 </para>
[8bc3edae]43
[2314cd7]44 &lfs120_checked;
[8bc3edae]45
46 <bridgehead renderas="sect3">Package Information</bridgehead>
47 <itemizedlist spacing="compact">
[f60cf4a]48 <listitem>
[c627795]49 <para>
50 Download (HTTP): <ulink url="&lvm2-download-http;"/>
51 </para>
[f60cf4a]52 </listitem>
[8bc3edae]53 <listitem>
[c627795]54 <para>
55 Download (FTP): <ulink url="&lvm2-download-ftp;"/>
56 </para>
[8bc3edae]57 </listitem>
58 <listitem>
[c627795]59 <para>
60 Download MD5 sum: &lvm2-md5sum;
61 </para>
[8bc3edae]62 </listitem>
63 <listitem>
[c627795]64 <para>
65 Download size: &lvm2-size;
66 </para>
[8bc3edae]67 </listitem>
68 <listitem>
[c627795]69 <para>
70 Estimated disk space required: &lvm2-buildsize;
71 </para>
[8bc3edae]72 </listitem>
73 <listitem>
[c627795]74 <para>
75 Estimated build time: &lvm2-time;
76 </para>
[8bc3edae]77 </listitem>
78 </itemizedlist>
79
[b5e8375]80 <bridgehead renderas="sect3">LVM2 Dependencies</bridgehead>
81
[3964f59]82 <bridgehead renderas="sect4">Required</bridgehead>
83 <para role="required">
[8991a7cb]84 <xref linkend='libaio'/>
[3964f59]85 </para>
86
[b5e8375]87 <bridgehead renderas="sect4">Optional</bridgehead>
88 <para role="optional">
[99fcc47]89 <xref linkend='mdadm'/>,
90 <xref linkend='reiserfs'/>,
91 <xref linkend='valgrind'/>,
92 <xref linkend='which'/>,
93 <xref linkend='xfsprogs'/> (all five may be used, but are not required,
[d5f6e8e]94 for tests),
[99fcc47]95 <ulink url='https://github.com/jthornber/thin-provisioning-tools'>
[d5f6e8e]96 thin-provisioning-tools</ulink>, and
97 <ulink url="https://github.com/dm-vdo/vdo">vdo</ulink>
[b5e8375]98 </para>
99
[09765cf]100
[8bc3edae]101 </sect2>
102
[c627795]103 <sect2 role="kernel" id="lvm2-kernel">
[7e1df8f9]104 <title>Kernel Configuration</title>
105
[c627795]106 <para>
[421128a1]107 Enable the following options in the kernel configuration
[c627795]108 and recompile the kernel:
109 </para>
[7e1df8f9]110
[b5e8375]111 <note><para>
112 There are several other Device Mapper options in the kernel beyond those
113 listed below. In order to get reasonable results if running the
114 regression tests, all must be enabled either internally or as a module.
[302a619]115 The tests will all time out if Magic SysRq key is not enabled.
[b5e8375]116 </para></note>
117
[d67d543]118 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
119 href="lvm2-kernel.xml"/>
[7e1df8f9]120
121 <indexterm zone="lvm2 lvm2-kernel">
122 <primary sortas="d-lvm2">lvm2</primary>
123 </indexterm>
124
125 </sect2>
126
[8bc3edae]127 <sect2 role="installation">
[c627795]128 <title>Installation of LVM2</title>
[8bc3edae]129
[c627795]130 <para>
131 Install <application>LVM2</application> by running the following
132 commands:
133 </para>
[8bc3edae]134
[22e249a]135<screen><userinput>PATH+=:/usr/sbin \
[e94d178]136./configure --prefix=/usr \
[4591404]137 --enable-cmdlib \
138 --enable-pkgconfig \
[46a9711b]139 --enable-udev_sync &amp;&amp;
[c470ab9]140make</userinput></screen>
[8bc3edae]141
[c627795]142 <para>
[99fcc47]143 The tests use <application>udev</application> for logical volume
[8991a7cb]144 synchronization, so the LVM udev rules and some utilities need to
[99fcc47]145 be installed before running the tests. If you are installing
146 <application>LVM2</application> for the first time, and do not
147 want to install the full package before running the tests, the minimal
148 set of utilities can be installed by running the following instructions
149 as the <systemitem class="username">root</systemitem> user:
150 </para>
151
[06908bf6]152<screen role="root"
153 remap="test"><userinput>make -C tools install_tools_dynamic &amp;&amp;
[1ba8e5ee]154make -C udev install &amp;&amp;
[99fcc47]155make -C libdm install</userinput></screen>
156
157 <para>
[06908bf6]158 To test the results, issue, as the
159 <systemitem class="username">root</systemitem> user:
160 </para>
161
162<screen role="root"
[213d18c]163 remap="test"><userinput>LC_ALL=en_US.UTF-8 make check_local</userinput></screen>
[06908bf6]164
165 <para>
[213d18c]166 Some tests may hang. In this case they can be skipped by adding
167 <command>S=&lt;testname&gt;</command> to the <command>make</command>
168 command.
[06908bf6]169 Other targets are available and can be listed with
170 <command>make -C test help</command>. The test timings are very dependent
171 on the speed of the disk(s), and on the number of enabled kernel options.
[f9431b6]172 </para>
[20c731a]173
[6c6f393]174 <!-- Results for LVM2.2.02.176:
175 ### 292 tests: 177 passed, 46 skipped, 0 timed out, 60 warned, 9 failed
[5d01724]176
177 Results for LVM2.2.03.01:
178 ### 302 tests: 182 passed, 43 skipped, 0 timed out, 62 warned, 15 failed
[23ed085]179
180 Results for LVM2.2.03.05:
181 ### 326 tests: 255 passed, 58 skipped, 0 timed out, 2 warned, 11 failed
[1c6b54be]182
183 Results for LVM2.2.03.09:
184 ### 338 tests: 212 passed, 41 skipped, 0 timed out, 70 warned, 15 failed
[d5f6e8e]185
186 Results for LVM2.2.03.11:
187 ### 357 tests: 231 passed, 32 skipped, 0 timed out, 77 warned, 17 failed
[51ba03e]188
189 Results for LVM2.2.03.14:
190 ### 389 tests: 304 passed, 73 skipped, 0 timed out, 2 warned, 10 failed
[f9478ee]191
192 Results for LVM2.2.03.16:
193 ### 395 tests: 241 passed, 145 skipped, 0 timed out, 1 warned, 8 failed
[213d18c]194
195 Results for LVM2.2.03.17:
196 ### 403 tests: 333 passed, 61 skipped, 0 timed out, 3 warned, 6 failed
[187200ac]197
198 Results for LVM2.2.03.20 [pierre]:
199 ### 407 tests: 324 passed, 75 skipped, 0 timed out, 3 warned, 5 failed
[20c731a]200 -->
201
[f9431b6]202 <para>
[af8a78d]203 The tests do not implement the <quote>expected fail</quote> possibility,
[8558044]204 and a small number of test failures is expected by upstream.
205 <!-- 1 -->More failures may happen because some kernel options are missing.
206 For example, the lack of the <emphasis>dm-delay</emphasis> device
207 mapper target explains some failures.
208 <!-- 2 -->Some tests may fail if there is insufficient free space available
209 in the partition with the /tmp directory. At least one test fails if 16 TB
[e43a4270]210 is not available.
211 <!-- 3 -->Some tests are flagged <quote>warned</quote> if
[f9431b6]212 <ulink url='https://github.com/jthornber/thin-provisioning-tools'>
213 thin-provisioning-tools</ulink> are not installed. A workaround is to
214 add the following flags to <command>configure</command>:
215 </para>
216
217<screen role="nodump"><userinput> --with-thin-check= \
218 --with-thin-dump= \
219 --with-thin-repair= \
220 --with-thin-restore= \
221 --with-cache-check= \
222 --with-cache-dump= \
223 --with-cache-repair= \
224 --with-cache-restore= \</userinput></screen>
225
226 <para>
[0dc5c2e1]227 Some tests may hang. They can be removed if necessary, for example:
228 <command>rm test/shell/lvconvert-raid-reshape.sh</command>. The tests
229 generate a lot of kernel messages, which may clutter your terminal. You
230 can disable them by issuing <command>dmesg -D</command> before running
231 the tests (do not forget to issue <command>dmesg -E</command> when tests
232 are done).
[fbcb3846]233
234 <note><simpara>The checks create device nodes in the /tmp directory. The
[e43a4270]235 tests will fail if /tmp is mounted with the nodev option.
236 </simpara></note>
[c627795]237 </para>
[8bc3edae]238
[c627795]239 <para>
240 Now, as the <systemitem class="username">root</systemitem> user:
241 </para>
[8bc3edae]242
[bbc76b21]243<screen role="root" revision="sysv"><userinput>make install
[213d18c]244rm -fv /usr/lib/udev/rules.d/69-dm-lvm.rules</userinput></screen>
[55dc313]245
246<screen role="root" revision="systemd"><userinput>make install
247make install_systemd_units</userinput></screen>
[8bc3edae]248
249 </sect2>
250
251 <sect2 role="commands">
252 <title>Command Explanations</title>
253
[e94d178]254 <para>
[22e249a]255 <command>PATH+=:/usr/sbin</command>: The path
256 must contain
[e94d178]257 <filename class='directory'>/usr/sbin</filename> for proper system tool
[41d504a]258 detection by the <command>configure</command> script. This instruction
[41e2bf5]259 ensures that PATH is properly set even if you build as an unprivileged user.
[e94d178]260 </para>
261
[c627795]262 <para>
[2800af7]263 <parameter>--enable-cmdlib</parameter>: This switch enables
[c627795]264 building of the shared command library. It is required
265 when building the event daemon.
266 </para>
267
268 <para>
[2800af7]269 <parameter>--enable-pkgconfig</parameter>: This switch enables
[c627795]270 installation of <command>pkg-config</command> support files.
271 </para>
272
273 <para>
[2800af7]274 <parameter>--enable-udev_sync</parameter>: This switch enables
[c627795]275 synchronisation with <application>Udev</application> processing.
276 </para>
277
278 <para>
279 <option>--enable-dmeventd</option>: This switch enables
280 building of the <application>Device Mapper</application>
281 event daemon.
282 </para>
[8bc3edae]283
[bbc76b21]284 <para revision="sysv">
285 <command>rm .../69-dm-lvm.rules</command>: Under certain circumstances,
286 this udev rule calls <command>systemd-run</command>, which is not
287 available on sysv. It performs actions that are done by another boot
288 script anyway, so it is not needed.
289 </para>
290
[55dc313]291 <para revision="systemd">
292 <command>make install_systemd_units</command>: This is needed to install
293 a unit that activates logical volumes at boot. It is not installed
294 by default.
295 </para>
296
[8bc3edae]297 </sect2>
298
[ff12c0f]299 <sect2 role="configuration" revision="systemd">
300 <title>Configuring LVM2</title>
301
302 <sect3 id="lvm2-config">
303 <title>Config File</title>
304 <para>
305 <filename>/etc/lvm/lvm.conf</filename>
306 </para>
307
308 <indexterm zone="lvm2 lvm2-config">
309 <primary
310 sortas="e-etc-lvm-lvm.conf">/etc/lvm/lvm.conf</primary>
311 </indexterm>
312 </sect3>
313
314 <sect3><title>Configuration Information</title>
315 <para>
316 The default configuration still references the obsolete <filename
317 class="directory">/var/lock</filename> directory. This creates
[9169ed5d]318 a deadlock at boot time. Change this (as the <systemitem
[ff12c0f]319 class="username">root</systemitem> user):
320 </para>
321
322<screen role="root"><userinput>sed -e '/locking_dir =/{s/#//;s/var/run/}' \
323 -i /etc/lvm/lvm.conf</userinput></screen>
324
325 </sect3>
326 </sect2>
327
[8bc3edae]328 <sect2 role="content">
329 <title>Contents</title>
330
331 <segmentedlist>
332 <segtitle>Installed Programs</segtitle>
333 <segtitle>Installed Libraries</segtitle>
[c3c56b2]334 <segtitle>Installed Directories</segtitle>
[8bc3edae]335
336 <seglistitem>
[c627795]337 <seg>
[51ba03e]338 blkdeactivate, dmeventd (optional), dmsetup, fsadm, lvm, lvmdump,
339 and lvm_import_vdo.
[23ed085]340 There are also numerous symbolic links to lvm that implement specific
[09765cf]341 functionalities
[c627795]342 </seg>
343 <seg>
[23ed085]344 libdevmapper.so and liblvm2cmd.so; optional:
[a037dab]345 libdevmapper-event.so, libdevmapper-event-lvm2.so,
[8ec0245]346 libdevmapper-event-lvm2mirror.so, libdevmapper-event-lvm2raid.so,
[51ba03e]347 libdevmapper-event-lvm2snapshot.so, libdevmapper-event-lvm2thin.so,
348 and libdevmapper-event-lvm2vdo.so
[c627795]349 </seg>
[c3c56b2]350 <seg>
[a037dab]351 /etc/lvm and
[51ba03e]352 /usr/lib/device-mapper (optional)
[c3c56b2]353 </seg>
[8bc3edae]354 </seglistitem>
355 </segmentedlist>
356
357 <variablelist>
358 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
359 <?dbfo list-presentation="list"?>
[61b95ac4]360
361 <?dbhtml list-presentation="table"?>
[8bc3edae]362
[8ed30d52]363 <varlistentry id="blkdeactivate">
364 <term><command>blkdeactivate</command></term>
365 <listitem>
366 <para>
[4c24eb0a]367 is a utility to deactivate block devices
[8ed30d52]368 </para>
369 <indexterm zone="lvm2 blkdeactivate">
370 <primary sortas="b-blkdeactivate">blkdeactivate</primary>
371 </indexterm>
372 </listitem>
373 </varlistentry>
374
[a037dab]375 <varlistentry id="dmeventd">
376 <term><command>dmeventd</command></term>
377 <listitem>
378 <para>
[4c24eb0a]379 (optional) is the Device Mapper event daemon
[a037dab]380 </para>
381 <indexterm zone="lvm2 dmeventd">
382 <primary sortas="b-dmeventd">dmeventd</primary>
383 </indexterm>
384 </listitem>
385 </varlistentry>
386
[8bc3edae]387 <varlistentry id="dmsetup">
388 <term><command>dmsetup</command></term>
389 <listitem>
[c627795]390 <para>
[4c24eb0a]391 is a low level logical volume management tool
[c627795]392 </para>
[8bc3edae]393 <indexterm zone="lvm2 dmsetup">
394 <primary sortas="b-dmsetup">dmsetup</primary>
395 </indexterm>
396 </listitem>
397 </varlistentry>
398
399 <varlistentry id="fsadm">
400 <term><command>fsadm</command></term>
401 <listitem>
[c627795]402 <para>
[4c24eb0a]403 is a utility used to resize or check filesystem on a device
[c627795]404 </para>
[8bc3edae]405 <indexterm zone="lvm2 fsadm">
406 <primary sortas="b-fsadm">fsadm</primary>
407 </indexterm>
408 </listitem>
409 </varlistentry>
410
411 <varlistentry id="lvm">
412 <term><command>lvm</command></term>
413 <listitem>
[c627795]414 <para>
415 provides the command-line tools for <application>LVM2</application>.
[b9c353b]416 Commands are implemented via symbolic links to this program to
[c627795]417 manage physical devices (pv*), volume groups (vg*) and logical
[4c24eb0a]418 volumes (lv*)
[c627795]419 </para>
[8bc3edae]420 <indexterm zone="lvm2 lvm">
421 <primary sortas="b-lvm">lvm</primary>
422 </indexterm>
423 </listitem>
424 </varlistentry>
425
[23ed085]426 <!--
[8bc3edae]427 <varlistentry id="lvmconf">
428 <term><command>lvmconf</command></term>
429 <listitem>
[c627795]430 <para>
[0d7900a]431 is a script that modifies the locking configuration in
[c627795]432 the <application>LVM2</application> configuration file.
433 </para>
[8bc3edae]434 <indexterm zone="lvm2 lvmconf">
435 <primary sortas="b-lvmconf">lvmconf</primary>
436 </indexterm>
437 </listitem>
438 </varlistentry>
[23ed085]439 -->
[8bc3edae]440
441 <varlistentry id="lvmdump">
442 <term><command>lvmdump</command></term>
443 <listitem>
[c627795]444 <para>
445 is a tool used to dump various information concerning
[4c24eb0a]446 <application>LVM2</application>
[c627795]447 </para>
[8bc3edae]448 <indexterm zone="lvm2 lvmdump">
449 <primary sortas="b-lvmdump">lvmdump</primary>
450 </indexterm>
451 </listitem>
452 </varlistentry>
453
454 <varlistentry id="vgimportclone">
455 <term><command>vgimportclone</command></term>
456 <listitem>
[c627795]457 <para>
[4c24eb0a]458 is used to import a duplicated VG (e.g. hardware snapshot)
[c627795]459 </para>
[8bc3edae]460 <indexterm zone="lvm2 vgimportclone">
461 <primary sortas="b-vgimportclone">vgimportclone</primary>
462 </indexterm>
463 </listitem>
464 </varlistentry>
465
466 <varlistentry id="libdevmapper">
[4c24eb0a]467 <term><filename class="libraryfile">libdevmapper.so</filename></term>
[8bc3edae]468 <listitem>
[c627795]469 <para>
470 contains the <application>Device Mapper</application> API
[4c24eb0a]471 functions
[c627795]472 </para>
[8bc3edae]473 <indexterm zone="lvm2 libdevmapper">
474 <primary sortas="c-libdevmapper">libdevmapper.so</primary>
475 </indexterm>
476 </listitem>
477 </varlistentry>
478
479 </variablelist>
480
481 </sect2>
482
483</sect1>
Note: See TracBrowser for help on using the repository browser.