source: postlfs/filesystems/lvm2.xml@ 92ec951

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 92ec951 was b643f16b, checked in by Bruce Dubbs <bdubbs@…>, 10 months ago

Archive reiserfsprogs.

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