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 "ffce8d4e86c74d8d44098a530410e843">
|
---|
10 | <!ENTITY lvm2-size "2.4 MB">
|
---|
11 | <!ENTITY lvm2-buildsize "34 MB (add 22 MB for tests; transient files can grow up to around 800 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 transcient. I monitor /tmp with a loop during
|
---|
14 | tests. -pierre, August 2020 -->
|
---|
15 | <!ENTITY lvm2-time "0.2 SBU (using parallelism=4; add 16 to 45 SBU for tests, depending on disk speed)">
|
---|
16 | ]>
|
---|
17 |
|
---|
18 | <sect1 id="lvm2" xreflabel="LVM2-&lvm2-version;">
|
---|
19 | <?dbhtml filename="lvm2.html"?>
|
---|
20 |
|
---|
21 | <sect1info>
|
---|
22 | <othername>$LastChangedBy$</othername>
|
---|
23 | <date>$Date$</date>
|
---|
24 | </sect1info>
|
---|
25 |
|
---|
26 | <title>LVM2-&lvm2-version;</title>
|
---|
27 |
|
---|
28 | <indexterm zone="lvm2">
|
---|
29 | <primary sortas="a-LVM2">LVM2</primary>
|
---|
30 | </indexterm>
|
---|
31 |
|
---|
32 | <sect2 role="package">
|
---|
33 | <title>Introduction to LVM2</title>
|
---|
34 |
|
---|
35 | <para>
|
---|
36 | The <application>LVM2</application> package is a set of tools that manage
|
---|
37 | logical partitions. It allows spanning of file systems across multiple
|
---|
38 | physical disks and disk partitions and provides for dynamic growing or
|
---|
39 | shrinking of logical partitions, mirroring and low storage footprint
|
---|
40 | snapshots.
|
---|
41 | </para>
|
---|
42 |
|
---|
43 | &lfs91_checked;
|
---|
44 |
|
---|
45 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
46 | <itemizedlist spacing="compact">
|
---|
47 | <listitem>
|
---|
48 | <para>
|
---|
49 | Download (HTTP): <ulink url="&lvm2-download-http;"/>
|
---|
50 | </para>
|
---|
51 | </listitem>
|
---|
52 | <listitem>
|
---|
53 | <para>
|
---|
54 | Download (FTP): <ulink url="&lvm2-download-ftp;"/>
|
---|
55 | </para>
|
---|
56 | </listitem>
|
---|
57 | <listitem>
|
---|
58 | <para>
|
---|
59 | Download MD5 sum: &lvm2-md5sum;
|
---|
60 | </para>
|
---|
61 | </listitem>
|
---|
62 | <listitem>
|
---|
63 | <para>
|
---|
64 | Download size: &lvm2-size;
|
---|
65 | </para>
|
---|
66 | </listitem>
|
---|
67 | <listitem>
|
---|
68 | <para>
|
---|
69 | Estimated disk space required: &lvm2-buildsize;
|
---|
70 | </para>
|
---|
71 | </listitem>
|
---|
72 | <listitem>
|
---|
73 | <para>
|
---|
74 | Estimated build time: &lvm2-time;
|
---|
75 | </para>
|
---|
76 | </listitem>
|
---|
77 | </itemizedlist>
|
---|
78 |
|
---|
79 | <bridgehead renderas="sect3">LVM2 Dependencies</bridgehead>
|
---|
80 |
|
---|
81 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
82 | <para role="required">
|
---|
83 | <xref linkend='libaio'/>
|
---|
84 | </para>
|
---|
85 |
|
---|
86 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
87 | <para role="optional">
|
---|
88 | <xref linkend='mdadm'/>,
|
---|
89 | <xref linkend='reiserfs'/>,
|
---|
90 | <xref linkend='valgrind'/>,
|
---|
91 | <xref linkend='which'/>,
|
---|
92 | <xref linkend='xfsprogs'/> (all five may be used, but are not required,
|
---|
93 | for tests), and
|
---|
94 | <ulink url='https://github.com/jthornber/thin-provisioning-tools'>
|
---|
95 | thin-provisioning-tools</ulink>
|
---|
96 | </para>
|
---|
97 |
|
---|
98 | <para condition="html" role="usernotes">User Notes:
|
---|
99 | <ulink url="&blfs-wiki;/lvm2"/>
|
---|
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 | <screen><literal>Device Drivers --->
|
---|
120 | [*] Multiple devices driver support (RAID and LVM) ---> [CONFIG_MD]
|
---|
121 | <*/M> Device mapper support [CONFIG_BLK_DEV_DM]
|
---|
122 | <*/M/ > Crypt target support [CONFIG_DM_CRYPT]
|
---|
123 | <*/M/ > Snapshot target [CONFIG_DM_SNAPSHOT]
|
---|
124 | <*/M/ > Thin provisioning target [CONFIG_DM_THIN_PROVISIONING]
|
---|
125 | <*/M/ > Mirror target [CONFIG_DM_MIRROR]
|
---|
126 | Kernel hacking --->
|
---|
127 | [*] Magic SysRq key [CONFIG_MAGIC_SYSRQ]</literal></screen>
|
---|
128 |
|
---|
129 | <indexterm zone="lvm2 lvm2-kernel">
|
---|
130 | <primary sortas="d-lvm2">lvm2</primary>
|
---|
131 | </indexterm>
|
---|
132 |
|
---|
133 | </sect2>
|
---|
134 |
|
---|
135 | <sect2 role="installation">
|
---|
136 | <title>Installation of LVM2</title>
|
---|
137 |
|
---|
138 | <para>
|
---|
139 | Install <application>LVM2</application> by running the following
|
---|
140 | commands:
|
---|
141 | </para>
|
---|
142 |
|
---|
143 | <screen><userinput>SAVEPATH=$PATH &&
|
---|
144 | PATH=$PATH:/sbin:/usr/sbin &&
|
---|
145 | ./configure --prefix=/usr \
|
---|
146 | --exec-prefix= \
|
---|
147 | --enable-cmdlib \
|
---|
148 | --enable-pkgconfig \
|
---|
149 | --enable-udev_sync &&
|
---|
150 | make &&
|
---|
151 | PATH=$SAVEPATH &&
|
---|
152 | unset SAVEPATH</userinput></screen>
|
---|
153 |
|
---|
154 | <para>
|
---|
155 | The tests use <application>udev</application> for logical volume
|
---|
156 | synchronization, so the LVM udev rules and some utilities need to
|
---|
157 | be installed before running the tests. If you are installing
|
---|
158 | <application>LVM2</application> for the first time, and do not
|
---|
159 | want to install the full package before running the tests, the minimal
|
---|
160 | set of utilities can be installed by running the following instructions
|
---|
161 | as the <systemitem class="username">root</systemitem> user:
|
---|
162 | </para>
|
---|
163 |
|
---|
164 | <screen role="root"
|
---|
165 | remap="test"><userinput>make -C tools install_tools_dynamic &&
|
---|
166 | make -C udev install &&
|
---|
167 | make -C libdm install</userinput></screen>
|
---|
168 |
|
---|
169 | <para>
|
---|
170 | To test the results, issue, as the
|
---|
171 | <systemitem class="username">root</systemitem> user:
|
---|
172 | </para>
|
---|
173 |
|
---|
174 | <screen role="root"
|
---|
175 | remap="test"><userinput>make S=shell/thin-flags.sh check_local</userinput></screen>
|
---|
176 |
|
---|
177 | <para>
|
---|
178 | The <command>S=...</command> option allows to skip tests. The
|
---|
179 | <command>shell/thin-flags.sh</command> test has been reported to freeze
|
---|
180 | the computer.
|
---|
181 | Other targets are available and can be listed with
|
---|
182 | <command>make -C test help</command>. The test timings are very dependent
|
---|
183 | on the speed of the disk(s), and on the number of enabled kernel options.
|
---|
184 | </para>
|
---|
185 |
|
---|
186 | <!-- Results for LVM2.2.02.176:
|
---|
187 | ### 292 tests: 177 passed, 46 skipped, 0 timed out, 60 warned, 9 failed
|
---|
188 |
|
---|
189 | Results for LVM2.2.03.01:
|
---|
190 | ### 302 tests: 182 passed, 43 skipped, 0 timed out, 62 warned, 15 failed
|
---|
191 |
|
---|
192 | Results for LVM2.2.03.05:
|
---|
193 | ### 326 tests: 255 passed, 58 skipped, 0 timed out, 2 warned, 11 failed
|
---|
194 |
|
---|
195 | Results for LVM2.2.03.09:
|
---|
196 | ### 338 tests: 212 passed, 41 skipped, 0 timed out, 70 warned, 15 failed
|
---|
197 | -->
|
---|
198 |
|
---|
199 | <para>
|
---|
200 | The tests do not implement the <quote>expected fail</quote> possibility,
|
---|
201 | and a small number of test failures is expected by upstream. More
|
---|
202 | failures may happen because some kernel options are missing. For example,
|
---|
203 | the lack of the <emphasis>dm-delay</emphasis> device mapper target may
|
---|
204 | explain some failures. Some tests are flagged
|
---|
205 | <quote>warned</quote> if
|
---|
206 | <ulink url='https://github.com/jthornber/thin-provisioning-tools'>
|
---|
207 | thin-provisioning-tools</ulink> are not installed. A workaround is to
|
---|
208 | add the following flags to <command>configure</command>:
|
---|
209 | </para>
|
---|
210 |
|
---|
211 | <screen role="nodump"><userinput> --with-thin-check= \
|
---|
212 | --with-thin-dump= \
|
---|
213 | --with-thin-repair= \
|
---|
214 | --with-thin-restore= \
|
---|
215 | --with-cache-check= \
|
---|
216 | --with-cache-dump= \
|
---|
217 | --with-cache-repair= \
|
---|
218 | --with-cache-restore= \</userinput></screen>
|
---|
219 |
|
---|
220 | <para>
|
---|
221 | Some tests may hang. They can be removed if necessary, for example:
|
---|
222 | <command>rm test/shell/lvconvert-raid-reshape.sh</command>. The tests
|
---|
223 | generate a lot of kernel messages, which may clutter your terminal. You
|
---|
224 | can disable them by issuing <command>dmesg -D</command> before running
|
---|
225 | the tests (do not forget to issue <command>dmesg -E</command> when tests
|
---|
226 | are done).
|
---|
227 |
|
---|
228 | <note><simpara>The checks create device nodes in the /tmp directory. The
|
---|
229 | tests will fail if /tmp is mounted with the nodev
|
---|
230 | option.</simpara></note>
|
---|
231 | </para>
|
---|
232 |
|
---|
233 | <para>
|
---|
234 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
235 | </para>
|
---|
236 |
|
---|
237 | <screen role="root" revision="sysv"><userinput>make install</userinput></screen>
|
---|
238 |
|
---|
239 | <screen role="root" revision="systemd"><userinput>make install
|
---|
240 | make install_systemd_units</userinput></screen>
|
---|
241 |
|
---|
242 | </sect2>
|
---|
243 |
|
---|
244 | <sect2 role="commands">
|
---|
245 | <title>Command Explanations</title>
|
---|
246 |
|
---|
247 | <para>
|
---|
248 | <command>PATH=$PATH:/sbin:/usr/sbin</command>: The path
|
---|
249 | must contain <filename class="directory">/sbin</filename> and
|
---|
250 | <filename class='directory'>/usr/sbin</filename> for proper system tool
|
---|
251 | detection by the <command>configure</command> script. This instruction
|
---|
252 | ensures that PATH is properly set even if you build as an unprivileged user.
|
---|
253 | </para>
|
---|
254 |
|
---|
255 | <para>
|
---|
256 | <parameter>--enable-cmdlib</parameter>: This switch enables
|
---|
257 | building of the shared command library. It is required
|
---|
258 | when building the event daemon.
|
---|
259 | </para>
|
---|
260 |
|
---|
261 | <para>
|
---|
262 | <parameter>--enable-pkgconfig</parameter>: This switch enables
|
---|
263 | installation of <command>pkg-config</command> support files.
|
---|
264 | </para>
|
---|
265 |
|
---|
266 | <para>
|
---|
267 | <parameter>--enable-udev_sync</parameter>: This switch enables
|
---|
268 | synchronisation with <application>Udev</application> processing.
|
---|
269 | </para>
|
---|
270 |
|
---|
271 | <para>
|
---|
272 | <option>--enable-dmeventd</option>: This switch enables
|
---|
273 | building of the <application>Device Mapper</application>
|
---|
274 | event daemon.
|
---|
275 | </para>
|
---|
276 |
|
---|
277 | <para revision="systemd">
|
---|
278 | <command>make install_systemd_units</command>: This is needed to install
|
---|
279 | a unit that activates logical volumes at boot. It is not installed
|
---|
280 | by default.
|
---|
281 | </para>
|
---|
282 |
|
---|
283 | </sect2>
|
---|
284 |
|
---|
285 | <sect2 role="content">
|
---|
286 | <title>Contents</title>
|
---|
287 |
|
---|
288 | <segmentedlist>
|
---|
289 | <segtitle>Installed Programs</segtitle>
|
---|
290 | <segtitle>Installed Libraries</segtitle>
|
---|
291 | <segtitle>Installed Directories</segtitle>
|
---|
292 |
|
---|
293 | <seglistitem>
|
---|
294 | <seg>
|
---|
295 | blkdeactivate, dmeventd (optional), dmsetup, fsadm, lvm, and lvmdump.
|
---|
296 | There are also numerous symbolic links to lvm that implement specific
|
---|
297 | functionalities
|
---|
298 | </seg>
|
---|
299 | <seg>
|
---|
300 | libdevmapper.so and liblvm2cmd.so; optional:
|
---|
301 | libdevmapper-event.so, libdevmapper-event-lvm2.so,
|
---|
302 | libdevmapper-event-lvm2mirror.so, libdevmapper-event-lvm2raid.so,
|
---|
303 | libdevmapper-event-lvm2snapshot.so, and libdevmapper-event-lvm2thin.so
|
---|
304 | </seg>
|
---|
305 | <seg>
|
---|
306 | /etc/lvm and
|
---|
307 | /lib/device-mapper (optional)
|
---|
308 | </seg>
|
---|
309 | </seglistitem>
|
---|
310 | </segmentedlist>
|
---|
311 |
|
---|
312 | <variablelist>
|
---|
313 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
314 | <?dbfo list-presentation="list"?>
|
---|
315 |
|
---|
316 | <?dbhtml list-presentation="table"?>
|
---|
317 |
|
---|
318 | <varlistentry id="blkdeactivate">
|
---|
319 | <term><command>blkdeactivate</command></term>
|
---|
320 | <listitem>
|
---|
321 | <para>
|
---|
322 | is a utility to deactivate block devices.
|
---|
323 | </para>
|
---|
324 | <indexterm zone="lvm2 blkdeactivate">
|
---|
325 | <primary sortas="b-blkdeactivate">blkdeactivate</primary>
|
---|
326 | </indexterm>
|
---|
327 | </listitem>
|
---|
328 | </varlistentry>
|
---|
329 |
|
---|
330 | <varlistentry id="dmeventd">
|
---|
331 | <term><command>dmeventd</command></term>
|
---|
332 | <listitem>
|
---|
333 | <para>
|
---|
334 | (optional) is the Device Mapper event daemon.
|
---|
335 | </para>
|
---|
336 | <indexterm zone="lvm2 dmeventd">
|
---|
337 | <primary sortas="b-dmeventd">dmeventd</primary>
|
---|
338 | </indexterm>
|
---|
339 | </listitem>
|
---|
340 | </varlistentry>
|
---|
341 |
|
---|
342 | <varlistentry id="dmsetup">
|
---|
343 | <term><command>dmsetup</command></term>
|
---|
344 | <listitem>
|
---|
345 | <para>
|
---|
346 | is a low level logical volume management tool.
|
---|
347 | </para>
|
---|
348 | <indexterm zone="lvm2 dmsetup">
|
---|
349 | <primary sortas="b-dmsetup">dmsetup</primary>
|
---|
350 | </indexterm>
|
---|
351 | </listitem>
|
---|
352 | </varlistentry>
|
---|
353 |
|
---|
354 | <varlistentry id="fsadm">
|
---|
355 | <term><command>fsadm</command></term>
|
---|
356 | <listitem>
|
---|
357 | <para>
|
---|
358 | is a utility used to resize or check filesystem on a device.
|
---|
359 | </para>
|
---|
360 | <indexterm zone="lvm2 fsadm">
|
---|
361 | <primary sortas="b-fsadm">fsadm</primary>
|
---|
362 | </indexterm>
|
---|
363 | </listitem>
|
---|
364 | </varlistentry>
|
---|
365 |
|
---|
366 | <varlistentry id="lvm">
|
---|
367 | <term><command>lvm</command></term>
|
---|
368 | <listitem>
|
---|
369 | <para>
|
---|
370 | provides the command-line tools for <application>LVM2</application>.
|
---|
371 | Commands are implemented via sympolic links to this program to
|
---|
372 | manage physical devices (pv*), volume groups (vg*) and logical
|
---|
373 | volumes (lv*).
|
---|
374 | </para>
|
---|
375 | <indexterm zone="lvm2 lvm">
|
---|
376 | <primary sortas="b-lvm">lvm</primary>
|
---|
377 | </indexterm>
|
---|
378 | </listitem>
|
---|
379 | </varlistentry>
|
---|
380 |
|
---|
381 | <!--
|
---|
382 | <varlistentry id="lvmconf">
|
---|
383 | <term><command>lvmconf</command></term>
|
---|
384 | <listitem>
|
---|
385 | <para>
|
---|
386 | is a script that modifies the locking configuration in
|
---|
387 | the <application>LVM2</application> configuration file.
|
---|
388 | </para>
|
---|
389 | <indexterm zone="lvm2 lvmconf">
|
---|
390 | <primary sortas="b-lvmconf">lvmconf</primary>
|
---|
391 | </indexterm>
|
---|
392 | </listitem>
|
---|
393 | </varlistentry>
|
---|
394 | -->
|
---|
395 |
|
---|
396 | <varlistentry id="lvmdump">
|
---|
397 | <term><command>lvmdump</command></term>
|
---|
398 | <listitem>
|
---|
399 | <para>
|
---|
400 | is a tool used to dump various information concerning
|
---|
401 | <application>LVM2</application>.
|
---|
402 | </para>
|
---|
403 | <indexterm zone="lvm2 lvmdump">
|
---|
404 | <primary sortas="b-lvmdump">lvmdump</primary>
|
---|
405 | </indexterm>
|
---|
406 | </listitem>
|
---|
407 | </varlistentry>
|
---|
408 |
|
---|
409 | <varlistentry id="vgimportclone">
|
---|
410 | <term><command>vgimportclone</command></term>
|
---|
411 | <listitem>
|
---|
412 | <para>
|
---|
413 | is used to import a duplicated VG (e.g. hardware snapshot).
|
---|
414 | </para>
|
---|
415 | <indexterm zone="lvm2 vgimportclone">
|
---|
416 | <primary sortas="b-vgimportclone">vgimportclone</primary>
|
---|
417 | </indexterm>
|
---|
418 | </listitem>
|
---|
419 | </varlistentry>
|
---|
420 |
|
---|
421 | <varlistentry id="libdevmapper">
|
---|
422 | <term><filename class='libraryfile'>libdevmapper.so</filename></term>
|
---|
423 | <listitem>
|
---|
424 | <para>
|
---|
425 | contains the <application>Device Mapper</application> API
|
---|
426 | functions.
|
---|
427 | </para>
|
---|
428 | <indexterm zone="lvm2 libdevmapper">
|
---|
429 | <primary sortas="c-libdevmapper">libdevmapper.so</primary>
|
---|
430 | </indexterm>
|
---|
431 | </listitem>
|
---|
432 | </varlistentry>
|
---|
433 |
|
---|
434 | </variablelist>
|
---|
435 |
|
---|
436 | </sect2>
|
---|
437 |
|
---|
438 | </sect1>
|
---|