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='valgrind'/>,
|
---|
91 | <xref linkend='which'/>,
|
---|
92 | <xref linkend='xfsprogs'/> (all four may be used, but are not required,
|
---|
93 | for tests),
|
---|
94 | <ulink
|
---|
95 | url='https://mirrors.edge.kernel.org/pub/linux/kernel/people/jeffm/reiserfsprogs/'>
|
---|
96 | reiserfsprogs</ulink>,
|
---|
97 | <ulink url='https://github.com/jthornber/thin-provisioning-tools'>
|
---|
98 | thin-provisioning-tools</ulink>, and
|
---|
99 | <ulink url="https://github.com/dm-vdo/vdo">vdo</ulink>
|
---|
100 | </para>
|
---|
101 |
|
---|
102 | </sect2>
|
---|
103 |
|
---|
104 | <sect2 role="kernel" id="lvm2-kernel">
|
---|
105 | <title>Kernel Configuration</title>
|
---|
106 |
|
---|
107 | <para>
|
---|
108 | Enable the following options in the kernel configuration
|
---|
109 | and recompile the kernel:
|
---|
110 | </para>
|
---|
111 |
|
---|
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.
|
---|
116 | The tests will all time out if Magic SysRq key is not enabled.
|
---|
117 | </para></note>
|
---|
118 |
|
---|
119 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
120 | href="lvm2-kernel.xml"/>
|
---|
121 |
|
---|
122 | <indexterm zone="lvm2 lvm2-kernel">
|
---|
123 | <primary sortas="d-lvm2">lvm2</primary>
|
---|
124 | </indexterm>
|
---|
125 |
|
---|
126 | </sect2>
|
---|
127 |
|
---|
128 | <sect2 role="installation">
|
---|
129 | <title>Installation of LVM2</title>
|
---|
130 |
|
---|
131 | <para>
|
---|
132 | Install <application>LVM2</application> by running the following
|
---|
133 | commands:
|
---|
134 | </para>
|
---|
135 |
|
---|
136 | <screen><userinput>PATH+=:/usr/sbin \
|
---|
137 | ./configure --prefix=/usr \
|
---|
138 | --enable-cmdlib \
|
---|
139 | --enable-pkgconfig \
|
---|
140 | --enable-udev_sync &&
|
---|
141 | make</userinput></screen>
|
---|
142 |
|
---|
143 | <para>
|
---|
144 | The tests use <application>udev</application> for logical volume
|
---|
145 | synchronization, so the LVM udev rules and some utilities need to
|
---|
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 |
|
---|
153 | <screen role="root"
|
---|
154 | remap="test"><userinput>make -C tools install_tools_dynamic &&
|
---|
155 | make -C udev install &&
|
---|
156 | make -C libdm install</userinput></screen>
|
---|
157 |
|
---|
158 | <para>
|
---|
159 | To test the results, issue, as the
|
---|
160 | <systemitem class="username">root</systemitem> user:
|
---|
161 | </para>
|
---|
162 |
|
---|
163 | <screen role="root"
|
---|
164 | remap="test"><userinput>LC_ALL=en_US.UTF-8 make check_local</userinput></screen>
|
---|
165 |
|
---|
166 | <para>
|
---|
167 | Some tests may hang. In this case they can be skipped by adding
|
---|
168 | <command>S=<testname></command> to the <command>make</command>
|
---|
169 | command.
|
---|
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.
|
---|
173 | </para>
|
---|
174 |
|
---|
175 | <!-- Results for LVM2.2.02.176:
|
---|
176 | ### 292 tests: 177 passed, 46 skipped, 0 timed out, 60 warned, 9 failed
|
---|
177 |
|
---|
178 | Results for LVM2.2.03.01:
|
---|
179 | ### 302 tests: 182 passed, 43 skipped, 0 timed out, 62 warned, 15 failed
|
---|
180 |
|
---|
181 | Results for LVM2.2.03.05:
|
---|
182 | ### 326 tests: 255 passed, 58 skipped, 0 timed out, 2 warned, 11 failed
|
---|
183 |
|
---|
184 | Results for LVM2.2.03.09:
|
---|
185 | ### 338 tests: 212 passed, 41 skipped, 0 timed out, 70 warned, 15 failed
|
---|
186 |
|
---|
187 | Results for LVM2.2.03.11:
|
---|
188 | ### 357 tests: 231 passed, 32 skipped, 0 timed out, 77 warned, 17 failed
|
---|
189 |
|
---|
190 | Results for LVM2.2.03.14:
|
---|
191 | ### 389 tests: 304 passed, 73 skipped, 0 timed out, 2 warned, 10 failed
|
---|
192 |
|
---|
193 | Results for LVM2.2.03.16:
|
---|
194 | ### 395 tests: 241 passed, 145 skipped, 0 timed out, 1 warned, 8 failed
|
---|
195 |
|
---|
196 | Results for LVM2.2.03.17:
|
---|
197 | ### 403 tests: 333 passed, 61 skipped, 0 timed out, 3 warned, 6 failed
|
---|
198 |
|
---|
199 | Results for LVM2.2.03.20 [pierre]:
|
---|
200 | ### 407 tests: 324 passed, 75 skipped, 0 timed out, 3 warned, 5 failed
|
---|
201 | -->
|
---|
202 |
|
---|
203 | <para>
|
---|
204 | The tests do not implement the <quote>expected fail</quote> possibility,
|
---|
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
|
---|
211 | is not available.
|
---|
212 | <!-- 3 -->Some tests are flagged <quote>warned</quote> if
|
---|
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>
|
---|
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).
|
---|
234 |
|
---|
235 | <note><simpara>The checks create device nodes in the /tmp directory. The
|
---|
236 | tests will fail if /tmp is mounted with the nodev option.
|
---|
237 | </simpara></note>
|
---|
238 | </para>
|
---|
239 |
|
---|
240 | <para>
|
---|
241 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
242 | </para>
|
---|
243 |
|
---|
244 | <screen role="root" revision="sysv"><userinput>make install
|
---|
245 | rm -fv /usr/lib/udev/rules.d/69-dm-lvm.rules</userinput></screen>
|
---|
246 |
|
---|
247 | <screen role="root" revision="systemd"><userinput>make install
|
---|
248 | make install_systemd_units</userinput></screen>
|
---|
249 |
|
---|
250 | </sect2>
|
---|
251 |
|
---|
252 | <sect2 role="commands">
|
---|
253 | <title>Command Explanations</title>
|
---|
254 |
|
---|
255 | <para>
|
---|
256 | <command>PATH+=:/usr/sbin</command>: The path
|
---|
257 | must contain
|
---|
258 | <filename class='directory'>/usr/sbin</filename> for proper system tool
|
---|
259 | detection by the <command>configure</command> script. This instruction
|
---|
260 | ensures that PATH is properly set even if you build as an unprivileged user.
|
---|
261 | </para>
|
---|
262 |
|
---|
263 | <para>
|
---|
264 | <parameter>--enable-cmdlib</parameter>: This switch enables
|
---|
265 | building of the shared command library. It is required
|
---|
266 | when building the event daemon.
|
---|
267 | </para>
|
---|
268 |
|
---|
269 | <para>
|
---|
270 | <parameter>--enable-pkgconfig</parameter>: This switch enables
|
---|
271 | installation of <command>pkg-config</command> support files.
|
---|
272 | </para>
|
---|
273 |
|
---|
274 | <para>
|
---|
275 | <parameter>--enable-udev_sync</parameter>: This switch enables
|
---|
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>
|
---|
284 |
|
---|
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 |
|
---|
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 |
|
---|
298 | </sect2>
|
---|
299 |
|
---|
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
|
---|
319 | a deadlock at boot time. Change this (as the <systemitem
|
---|
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 |
|
---|
329 | <sect2 role="content">
|
---|
330 | <title>Contents</title>
|
---|
331 |
|
---|
332 | <segmentedlist>
|
---|
333 | <segtitle>Installed Programs</segtitle>
|
---|
334 | <segtitle>Installed Libraries</segtitle>
|
---|
335 | <segtitle>Installed Directories</segtitle>
|
---|
336 |
|
---|
337 | <seglistitem>
|
---|
338 | <seg>
|
---|
339 | blkdeactivate, dmeventd (optional), dmsetup, fsadm, lvm, lvmdump,
|
---|
340 | and lvm_import_vdo.
|
---|
341 | There are also numerous symbolic links to lvm that implement specific
|
---|
342 | functionalities
|
---|
343 | </seg>
|
---|
344 | <seg>
|
---|
345 | libdevmapper.so and liblvm2cmd.so; optional:
|
---|
346 | libdevmapper-event.so, libdevmapper-event-lvm2.so,
|
---|
347 | libdevmapper-event-lvm2mirror.so, libdevmapper-event-lvm2raid.so,
|
---|
348 | libdevmapper-event-lvm2snapshot.so, libdevmapper-event-lvm2thin.so,
|
---|
349 | and libdevmapper-event-lvm2vdo.so
|
---|
350 | </seg>
|
---|
351 | <seg>
|
---|
352 | /etc/lvm and
|
---|
353 | /usr/lib/device-mapper (optional)
|
---|
354 | </seg>
|
---|
355 | </seglistitem>
|
---|
356 | </segmentedlist>
|
---|
357 |
|
---|
358 | <variablelist>
|
---|
359 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
360 | <?dbfo list-presentation="list"?>
|
---|
361 |
|
---|
362 | <?dbhtml list-presentation="table"?>
|
---|
363 |
|
---|
364 | <varlistentry id="blkdeactivate">
|
---|
365 | <term><command>blkdeactivate</command></term>
|
---|
366 | <listitem>
|
---|
367 | <para>
|
---|
368 | is a utility to deactivate block devices
|
---|
369 | </para>
|
---|
370 | <indexterm zone="lvm2 blkdeactivate">
|
---|
371 | <primary sortas="b-blkdeactivate">blkdeactivate</primary>
|
---|
372 | </indexterm>
|
---|
373 | </listitem>
|
---|
374 | </varlistentry>
|
---|
375 |
|
---|
376 | <varlistentry id="dmeventd">
|
---|
377 | <term><command>dmeventd</command></term>
|
---|
378 | <listitem>
|
---|
379 | <para>
|
---|
380 | (optional) is the Device Mapper event daemon
|
---|
381 | </para>
|
---|
382 | <indexterm zone="lvm2 dmeventd">
|
---|
383 | <primary sortas="b-dmeventd">dmeventd</primary>
|
---|
384 | </indexterm>
|
---|
385 | </listitem>
|
---|
386 | </varlistentry>
|
---|
387 |
|
---|
388 | <varlistentry id="dmsetup">
|
---|
389 | <term><command>dmsetup</command></term>
|
---|
390 | <listitem>
|
---|
391 | <para>
|
---|
392 | is a low level logical volume management tool
|
---|
393 | </para>
|
---|
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>
|
---|
403 | <para>
|
---|
404 | is a utility used to resize or check filesystem on a device
|
---|
405 | </para>
|
---|
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>
|
---|
415 | <para>
|
---|
416 | provides the command-line tools for <application>LVM2</application>.
|
---|
417 | Commands are implemented via symbolic links to this program to
|
---|
418 | manage physical devices (pv*), volume groups (vg*) and logical
|
---|
419 | volumes (lv*)
|
---|
420 | </para>
|
---|
421 | <indexterm zone="lvm2 lvm">
|
---|
422 | <primary sortas="b-lvm">lvm</primary>
|
---|
423 | </indexterm>
|
---|
424 | </listitem>
|
---|
425 | </varlistentry>
|
---|
426 |
|
---|
427 | <!--
|
---|
428 | <varlistentry id="lvmconf">
|
---|
429 | <term><command>lvmconf</command></term>
|
---|
430 | <listitem>
|
---|
431 | <para>
|
---|
432 | is a script that modifies the locking configuration in
|
---|
433 | the <application>LVM2</application> configuration file.
|
---|
434 | </para>
|
---|
435 | <indexterm zone="lvm2 lvmconf">
|
---|
436 | <primary sortas="b-lvmconf">lvmconf</primary>
|
---|
437 | </indexterm>
|
---|
438 | </listitem>
|
---|
439 | </varlistentry>
|
---|
440 | -->
|
---|
441 |
|
---|
442 | <varlistentry id="lvmdump">
|
---|
443 | <term><command>lvmdump</command></term>
|
---|
444 | <listitem>
|
---|
445 | <para>
|
---|
446 | is a tool used to dump various information concerning
|
---|
447 | <application>LVM2</application>
|
---|
448 | </para>
|
---|
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>
|
---|
458 | <para>
|
---|
459 | is used to import a duplicated VG (e.g. hardware snapshot)
|
---|
460 | </para>
|
---|
461 | <indexterm zone="lvm2 vgimportclone">
|
---|
462 | <primary sortas="b-vgimportclone">vgimportclone</primary>
|
---|
463 | </indexterm>
|
---|
464 | </listitem>
|
---|
465 | </varlistentry>
|
---|
466 |
|
---|
467 | <varlistentry id="libdevmapper">
|
---|
468 | <term><filename class="libraryfile">libdevmapper.so</filename></term>
|
---|
469 | <listitem>
|
---|
470 | <para>
|
---|
471 | contains the <application>Device Mapper</application> API
|
---|
472 | functions
|
---|
473 | </para>
|
---|
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>
|
---|