source: postlfs/filesystems/lvm2.xml@ 55dc313

10.0 10.1 11.0 ken/refactor-virt lazarus qt5new trunk xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since 55dc313 was 55dc313, checked in by Pierre Labastie <pieere@…>, 16 months ago

Add instructions to activate and mount lvm volume in systemd. ticket 13730

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@23342 af4574ff-66df-0310-9fd7-8a98e5e911e0

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