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
Line 
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
7 <!ENTITY lvm2-download-http "https://sourceware.org/ftp/lvm2/LVM2.&lvm2-version;.tgz">
8 <!ENTITY lvm2-download-ftp "ftp://sourceware.org/pub/lvm2/LVM2.&lvm2-version;.tgz">
9 <!ENTITY lvm2-md5sum "a97cf533222a5760225dbd26c3982ca6">
10 <!ENTITY lvm2-size "2.6 MB">
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)">
12 <!-- My build size was 124 MB with tests, but I'll leave this here. -renodr
13 The files in /tmp are transient. I monitor /tmp with a loop during
14 tests. -pierre, August 2020
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 -->
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)">
21]>
22
23<sect1 id="lvm2" xreflabel="LVM2-&lvm2-version;">
24 <?dbhtml filename="lvm2.html"?>
25
26
27 <title>LVM2-&lvm2-version;</title>
28
29 <indexterm zone="lvm2">
30 <primary sortas="a-LVM2">LVM2</primary>
31 </indexterm>
32
33 <sect2 role="package">
34 <title>Introduction to LVM2</title>
35
36 <para>
37 The <application>LVM2</application> package is a set of tools that manage
38 logical partitions. It allows spanning of file systems across multiple
39 physical disks and disk partitions and provides for dynamic growing or
40 shrinking of logical partitions, mirroring and low storage footprint
41 snapshots.
42 </para>
43
44 &lfs120_checked;
45
46 <bridgehead renderas="sect3">Package Information</bridgehead>
47 <itemizedlist spacing="compact">
48 <listitem>
49 <para>
50 Download (HTTP): <ulink url="&lvm2-download-http;"/>
51 </para>
52 </listitem>
53 <listitem>
54 <para>
55 Download (FTP): <ulink url="&lvm2-download-ftp;"/>
56 </para>
57 </listitem>
58 <listitem>
59 <para>
60 Download MD5 sum: &lvm2-md5sum;
61 </para>
62 </listitem>
63 <listitem>
64 <para>
65 Download size: &lvm2-size;
66 </para>
67 </listitem>
68 <listitem>
69 <para>
70 Estimated disk space required: &lvm2-buildsize;
71 </para>
72 </listitem>
73 <listitem>
74 <para>
75 Estimated build time: &lvm2-time;
76 </para>
77 </listitem>
78 </itemizedlist>
79
80 <bridgehead renderas="sect3">LVM2 Dependencies</bridgehead>
81
82 <bridgehead renderas="sect4">Required</bridgehead>
83 <para role="required">
84 <xref linkend='libaio'/>
85 </para>
86
87 <bridgehead renderas="sect4">Optional</bridgehead>
88 <para role="optional">
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,
94 for tests),
95 <ulink url='https://github.com/jthornber/thin-provisioning-tools'>
96 thin-provisioning-tools</ulink>, and
97 <ulink url="https://github.com/dm-vdo/vdo">vdo</ulink>
98 </para>
99
100
101 </sect2>
102
103 <sect2 role="kernel" id="lvm2-kernel">
104 <title>Kernel Configuration</title>
105
106 <para>
107 Enable the following options in the kernel configuration
108 and recompile the kernel:
109 </para>
110
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.
115 The tests will all time out if Magic SysRq key is not enabled.
116 </para></note>
117
118 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
119 href="lvm2-kernel.xml"/>
120
121 <indexterm zone="lvm2 lvm2-kernel">
122 <primary sortas="d-lvm2">lvm2</primary>
123 </indexterm>
124
125 </sect2>
126
127 <sect2 role="installation">
128 <title>Installation of LVM2</title>
129
130 <para>
131 Install <application>LVM2</application> by running the following
132 commands:
133 </para>
134
135<screen><userinput>PATH+=:/usr/sbin \
136./configure --prefix=/usr \
137 --enable-cmdlib \
138 --enable-pkgconfig \
139 --enable-udev_sync &amp;&amp;
140make</userinput></screen>
141
142 <para>
143 The tests use <application>udev</application> for logical volume
144 synchronization, so the LVM udev rules and some utilities need to
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
152<screen role="root"
153 remap="test"><userinput>make -C tools install_tools_dynamic &amp;&amp;
154make -C udev install &amp;&amp;
155make -C libdm install</userinput></screen>
156
157 <para>
158 To test the results, issue, as the
159 <systemitem class="username">root</systemitem> user:
160 </para>
161
162<screen role="root"
163 remap="test"><userinput>LC_ALL=en_US.UTF-8 make check_local</userinput></screen>
164
165 <para>
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.
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.
172 </para>
173
174 <!-- Results for LVM2.2.02.176:
175 ### 292 tests: 177 passed, 46 skipped, 0 timed out, 60 warned, 9 failed
176
177 Results for LVM2.2.03.01:
178 ### 302 tests: 182 passed, 43 skipped, 0 timed out, 62 warned, 15 failed
179
180 Results for LVM2.2.03.05:
181 ### 326 tests: 255 passed, 58 skipped, 0 timed out, 2 warned, 11 failed
182
183 Results for LVM2.2.03.09:
184 ### 338 tests: 212 passed, 41 skipped, 0 timed out, 70 warned, 15 failed
185
186 Results for LVM2.2.03.11:
187 ### 357 tests: 231 passed, 32 skipped, 0 timed out, 77 warned, 17 failed
188
189 Results for LVM2.2.03.14:
190 ### 389 tests: 304 passed, 73 skipped, 0 timed out, 2 warned, 10 failed
191
192 Results for LVM2.2.03.16:
193 ### 395 tests: 241 passed, 145 skipped, 0 timed out, 1 warned, 8 failed
194
195 Results for LVM2.2.03.17:
196 ### 403 tests: 333 passed, 61 skipped, 0 timed out, 3 warned, 6 failed
197
198 Results for LVM2.2.03.20 [pierre]:
199 ### 407 tests: 324 passed, 75 skipped, 0 timed out, 3 warned, 5 failed
200 -->
201
202 <para>
203 The tests do not implement the <quote>expected fail</quote> possibility,
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
210 is not available.
211 <!-- 3 -->Some tests are flagged <quote>warned</quote> if
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>
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).
233
234 <note><simpara>The checks create device nodes in the /tmp directory. The
235 tests will fail if /tmp is mounted with the nodev option.
236 </simpara></note>
237 </para>
238
239 <para>
240 Now, as the <systemitem class="username">root</systemitem> user:
241 </para>
242
243<screen role="root" revision="sysv"><userinput>make install
244rm -fv /usr/lib/udev/rules.d/69-dm-lvm.rules</userinput></screen>
245
246<screen role="root" revision="systemd"><userinput>make install
247make install_systemd_units</userinput></screen>
248
249 </sect2>
250
251 <sect2 role="commands">
252 <title>Command Explanations</title>
253
254 <para>
255 <command>PATH+=:/usr/sbin</command>: The path
256 must contain
257 <filename class='directory'>/usr/sbin</filename> for proper system tool
258 detection by the <command>configure</command> script. This instruction
259 ensures that PATH is properly set even if you build as an unprivileged user.
260 </para>
261
262 <para>
263 <parameter>--enable-cmdlib</parameter>: This switch enables
264 building of the shared command library. It is required
265 when building the event daemon.
266 </para>
267
268 <para>
269 <parameter>--enable-pkgconfig</parameter>: This switch enables
270 installation of <command>pkg-config</command> support files.
271 </para>
272
273 <para>
274 <parameter>--enable-udev_sync</parameter>: This switch enables
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>
283
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
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
297 </sect2>
298
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
318 a deadlock at boot time. Change this (as the <systemitem
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
328 <sect2 role="content">
329 <title>Contents</title>
330
331 <segmentedlist>
332 <segtitle>Installed Programs</segtitle>
333 <segtitle>Installed Libraries</segtitle>
334 <segtitle>Installed Directories</segtitle>
335
336 <seglistitem>
337 <seg>
338 blkdeactivate, dmeventd (optional), dmsetup, fsadm, lvm, lvmdump,
339 and lvm_import_vdo.
340 There are also numerous symbolic links to lvm that implement specific
341 functionalities
342 </seg>
343 <seg>
344 libdevmapper.so and liblvm2cmd.so; optional:
345 libdevmapper-event.so, libdevmapper-event-lvm2.so,
346 libdevmapper-event-lvm2mirror.so, libdevmapper-event-lvm2raid.so,
347 libdevmapper-event-lvm2snapshot.so, libdevmapper-event-lvm2thin.so,
348 and libdevmapper-event-lvm2vdo.so
349 </seg>
350 <seg>
351 /etc/lvm and
352 /usr/lib/device-mapper (optional)
353 </seg>
354 </seglistitem>
355 </segmentedlist>
356
357 <variablelist>
358 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
359 <?dbfo list-presentation="list"?>
360
361 <?dbhtml list-presentation="table"?>
362
363 <varlistentry id="blkdeactivate">
364 <term><command>blkdeactivate</command></term>
365 <listitem>
366 <para>
367 is a utility to deactivate block devices
368 </para>
369 <indexterm zone="lvm2 blkdeactivate">
370 <primary sortas="b-blkdeactivate">blkdeactivate</primary>
371 </indexterm>
372 </listitem>
373 </varlistentry>
374
375 <varlistentry id="dmeventd">
376 <term><command>dmeventd</command></term>
377 <listitem>
378 <para>
379 (optional) is the Device Mapper event daemon
380 </para>
381 <indexterm zone="lvm2 dmeventd">
382 <primary sortas="b-dmeventd">dmeventd</primary>
383 </indexterm>
384 </listitem>
385 </varlistentry>
386
387 <varlistentry id="dmsetup">
388 <term><command>dmsetup</command></term>
389 <listitem>
390 <para>
391 is a low level logical volume management tool
392 </para>
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>
402 <para>
403 is a utility used to resize or check filesystem on a device
404 </para>
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>
414 <para>
415 provides the command-line tools for <application>LVM2</application>.
416 Commands are implemented via symbolic links to this program to
417 manage physical devices (pv*), volume groups (vg*) and logical
418 volumes (lv*)
419 </para>
420 <indexterm zone="lvm2 lvm">
421 <primary sortas="b-lvm">lvm</primary>
422 </indexterm>
423 </listitem>
424 </varlistentry>
425
426 <!--
427 <varlistentry id="lvmconf">
428 <term><command>lvmconf</command></term>
429 <listitem>
430 <para>
431 is a script that modifies the locking configuration in
432 the <application>LVM2</application> configuration file.
433 </para>
434 <indexterm zone="lvm2 lvmconf">
435 <primary sortas="b-lvmconf">lvmconf</primary>
436 </indexterm>
437 </listitem>
438 </varlistentry>
439 -->
440
441 <varlistentry id="lvmdump">
442 <term><command>lvmdump</command></term>
443 <listitem>
444 <para>
445 is a tool used to dump various information concerning
446 <application>LVM2</application>
447 </para>
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>
457 <para>
458 is used to import a duplicated VG (e.g. hardware snapshot)
459 </para>
460 <indexterm zone="lvm2 vgimportclone">
461 <primary sortas="b-vgimportclone">vgimportclone</primary>
462 </indexterm>
463 </listitem>
464 </varlistentry>
465
466 <varlistentry id="libdevmapper">
467 <term><filename class="libraryfile">libdevmapper.so</filename></term>
468 <listitem>
469 <para>
470 contains the <application>Device Mapper</application> API
471 functions
472 </para>
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.