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 "5fc07da5461a3794a751dcfc355827d5">
|
---|
10 | <!ENTITY lvm2-size "2.3 MB">
|
---|
11 | <!ENTITY lvm2-buildsize "33 MB (add at least 594 MB for tests in the /tmp directory; additionally transient files can grow up to around 500 MB)">
|
---|
12 | <!ENTITY lvm2-time "0.2 SBU (using parallelism=4; add 14 SBU for tests)">
|
---|
13 | ]>
|
---|
14 |
|
---|
15 | <sect1 id="lvm2" xreflabel="LVM2-&lvm2-version;">
|
---|
16 | <?dbhtml filename="lvm2.html"?>
|
---|
17 |
|
---|
18 | <sect1info>
|
---|
19 | <othername>$LastChangedBy$</othername>
|
---|
20 | <date>$Date$</date>
|
---|
21 | </sect1info>
|
---|
22 |
|
---|
23 | <title>LVM2-&lvm2-version;</title>
|
---|
24 |
|
---|
25 | <indexterm zone="lvm2">
|
---|
26 | <primary sortas="a-LVM2">LVM2</primary>
|
---|
27 | </indexterm>
|
---|
28 |
|
---|
29 | <sect2 role="package">
|
---|
30 | <title>Introduction to LVM2</title>
|
---|
31 |
|
---|
32 | <para>
|
---|
33 | The <application>LVM2</application> package is a set of tools that manage
|
---|
34 | logical partitions. It allows spanning of file systems across multiple
|
---|
35 | physical disks and disk partitions and provides for dynamic growing or
|
---|
36 | shrinking of logical partitions, mirroring and low storage footprint
|
---|
37 | snapshots.
|
---|
38 | </para>
|
---|
39 |
|
---|
40 | &lfs84_checked;
|
---|
41 |
|
---|
42 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
43 | <itemizedlist spacing="compact">
|
---|
44 | <listitem>
|
---|
45 | <para>
|
---|
46 | Download (HTTP): <ulink url="&lvm2-download-http;"/>
|
---|
47 | </para>
|
---|
48 | </listitem>
|
---|
49 | <listitem>
|
---|
50 | <para>
|
---|
51 | Download (FTP): <ulink url="&lvm2-download-ftp;"/>
|
---|
52 | </para>
|
---|
53 | </listitem>
|
---|
54 | <listitem>
|
---|
55 | <para>
|
---|
56 | Download MD5 sum: &lvm2-md5sum;
|
---|
57 | </para>
|
---|
58 | </listitem>
|
---|
59 | <listitem>
|
---|
60 | <para>
|
---|
61 | Download size: &lvm2-size;
|
---|
62 | </para>
|
---|
63 | </listitem>
|
---|
64 | <listitem>
|
---|
65 | <para>
|
---|
66 | Estimated disk space required: &lvm2-buildsize;
|
---|
67 | </para>
|
---|
68 | </listitem>
|
---|
69 | <listitem>
|
---|
70 | <para>
|
---|
71 | Estimated build time: &lvm2-time;
|
---|
72 | </para>
|
---|
73 | </listitem>
|
---|
74 | </itemizedlist>
|
---|
75 |
|
---|
76 | <bridgehead renderas="sect3">LVM2 Dependencies</bridgehead>
|
---|
77 |
|
---|
78 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
79 | <para role="required">
|
---|
80 | <xref linkend='libaio'/>
|
---|
81 | </para>
|
---|
82 |
|
---|
83 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
84 | <para role="optional">
|
---|
85 | <xref linkend='mdadm'/>,
|
---|
86 | <xref linkend='reiserfs'/>,
|
---|
87 | <xref linkend='valgrind'/>,
|
---|
88 | <xref linkend='which'/>,
|
---|
89 | <xref linkend='xfsprogs'/> (all five may be used, but are not required,
|
---|
90 | for tests), and
|
---|
91 | <ulink url='https://github.com/jthornber/thin-provisioning-tools'>
|
---|
92 | thin-provisioning-tools</ulink>
|
---|
93 | </para>
|
---|
94 |
|
---|
95 | <para condition="html" role="usernotes">User Notes:
|
---|
96 | <ulink url="&blfs-wiki;/lvm2"/>
|
---|
97 | </para>
|
---|
98 |
|
---|
99 | <!-- This shouldn't be needed any more now that we are up to 4.19+
|
---|
100 | <caution>
|
---|
101 | <para>
|
---|
102 | Kernel versions between 4.1 and 4.4.1 have a broken RAID
|
---|
103 | implementation. If you want to use RAID type LV's, you should install
|
---|
104 | kernel version 4.4.2 or above. Note that several tests use RAID logical
|
---|
105 | volumes, and can generate a <quote>kernel oops</quote> with the faulty
|
---|
106 | kernel version, which usually renders the system unusable.
|
---|
107 | </para>
|
---|
108 | </caution> -->
|
---|
109 | </sect2>
|
---|
110 |
|
---|
111 | <sect2 role="kernel" id="lvm2-kernel">
|
---|
112 | <title>Kernel Configuration</title>
|
---|
113 |
|
---|
114 | <para>
|
---|
115 | Enable the following options in the kernel configuration
|
---|
116 | and recompile the kernel:
|
---|
117 | </para>
|
---|
118 |
|
---|
119 | <note><para>
|
---|
120 | There are several other Device Mapper options in the kernel beyond those
|
---|
121 | listed below. In order to get reasonable results if running the
|
---|
122 | regression tests, all must be enabled either internally or as a module.
|
---|
123 | The tests will all time out if Magic SysRq key is not enabled.
|
---|
124 | </para></note>
|
---|
125 |
|
---|
126 | <screen><literal>Device Drivers --->
|
---|
127 | [*] Multiple devices driver support (RAID and LVM) ---> [CONFIG_MD]
|
---|
128 | <*/M> Device mapper support [CONFIG_BLK_DEV_DM]
|
---|
129 | <*/M/ > Crypt target support [CONFIG_DM_CRYPT]
|
---|
130 | <*/M/ > Snapshot target [CONFIG_DM_SNAPSHOT]
|
---|
131 | <*/M/ > Thin provisioning target [CONFIG_DM_THIN_PROVISIONING]
|
---|
132 | <*/M/ > Mirror target [CONFIG_DM_MIRROR]
|
---|
133 | Kernel hacking --->
|
---|
134 | [*] Magic SysRq key [CONFIG_MAGIC_SYSRQ]</literal></screen>
|
---|
135 |
|
---|
136 | <indexterm zone="lvm2 lvm2-kernel">
|
---|
137 | <primary sortas="d-lvm2">lvm2</primary>
|
---|
138 | </indexterm>
|
---|
139 |
|
---|
140 | </sect2>
|
---|
141 |
|
---|
142 | <sect2 role="installation">
|
---|
143 | <title>Installation of LVM2</title>
|
---|
144 |
|
---|
145 | <para>
|
---|
146 | Install <application>LVM2</application> by running the following
|
---|
147 | commands:
|
---|
148 | </para>
|
---|
149 |
|
---|
150 | <screen revision="sysv"><userinput>SAVEPATH=$PATH &&
|
---|
151 | PATH=$PATH:/sbin:/usr/sbin &&
|
---|
152 | ./configure --prefix=/usr \
|
---|
153 | --exec-prefix= \
|
---|
154 | --enable-cmdlib \
|
---|
155 | --enable-pkgconfig \
|
---|
156 | --enable-udev_sync &&
|
---|
157 | make &&
|
---|
158 | PATH=$SAVEPATH &&
|
---|
159 | unset SAVEPATH</userinput></screen>
|
---|
160 |
|
---|
161 | <screen revision="systemd"><userinput>SAVEPATH=$PATH &&
|
---|
162 | PATH=$PATH:/sbin:/usr/sbin &&
|
---|
163 | ./configure --prefix=/usr \
|
---|
164 | --exec-prefix= \
|
---|
165 | --with-confdir=/etc \
|
---|
166 | --enable-cmdlib \
|
---|
167 | --enable-pkgconfig \
|
---|
168 | --enable-udev_sync &&
|
---|
169 | make &&
|
---|
170 | PATH=$SAVEPATH &&
|
---|
171 | unset SAVEPATH</userinput></screen>
|
---|
172 |
|
---|
173 | <para>
|
---|
174 | The tests use <application>udev</application> for logical volume
|
---|
175 | synchronization, so the LVM udev rules and some utilities need to
|
---|
176 | be installed before running the tests. If you are installing
|
---|
177 | <application>LVM2</application> for the first time, and do not
|
---|
178 | want to install the full package before running the tests, the minimal
|
---|
179 | set of utilities can be installed by running the following instructions
|
---|
180 | as the <systemitem class="username">root</systemitem> user:
|
---|
181 | </para>
|
---|
182 |
|
---|
183 | <screen role="root"><userinput>make -C tools install_dmsetup_dynamic &&
|
---|
184 | make -C udev install &&
|
---|
185 | make -C libdm install</userinput></screen>
|
---|
186 |
|
---|
187 | <para>
|
---|
188 | To test the results, issue: <command>make check_local</command> as the
|
---|
189 | <systemitem class="username">root</systemitem> user. Other targets are
|
---|
190 | available and can be listed with <command>make -C test help</command>.
|
---|
191 | The test timings are very dependent on the speed of the disk(s), and on
|
---|
192 | the number of enabled kernel options.
|
---|
193 | </para>
|
---|
194 |
|
---|
195 | <!-- Results for LVM2.2.02.176:
|
---|
196 | ### 292 tests: 177 passed, 46 skipped, 0 timed out, 60 warned, 9 failed
|
---|
197 |
|
---|
198 | Results for LVM2.2.03.01:
|
---|
199 | ### 302 tests: 182 passed, 43 skipped, 0 timed out, 62 warned, 15 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. More
|
---|
205 | failures may happen because some kernel options are missing. For example,
|
---|
206 | the lack of the <emphasis>dm-delay</emphasis> device mapper target may
|
---|
207 | explain some failures. Some tests are flagged
|
---|
208 | <quote>warned</quote> if
|
---|
209 | <ulink url='https://github.com/jthornber/thin-provisioning-tools'>
|
---|
210 | thin-provisioning-tools</ulink> are not installed. A workaround is to
|
---|
211 | add the following flags to <command>configure</command>:
|
---|
212 | </para>
|
---|
213 |
|
---|
214 | <screen role="nodump"><userinput> --with-thin-check= \
|
---|
215 | --with-thin-dump= \
|
---|
216 | --with-thin-repair= \
|
---|
217 | --with-thin-restore= \
|
---|
218 | --with-cache-check= \
|
---|
219 | --with-cache-dump= \
|
---|
220 | --with-cache-repair= \
|
---|
221 | --with-cache-restore= \</userinput></screen>
|
---|
222 |
|
---|
223 | <para>
|
---|
224 | Some tests may hang. They can be removed if necessary, for example:
|
---|
225 | <command>rm test/shell/lvconvert-raid-reshape.sh</command>. The tests
|
---|
226 | generate a lot of kernel messages, which may clutter your terminal. You
|
---|
227 | can disable them by issuing <command>dmesg -D</command> before running
|
---|
228 | the tests (do not forget to issue <command>dmesg -E</command> when tests
|
---|
229 | are done).
|
---|
230 |
|
---|
231 | <note><simpara>The checks create device nodes in the /tmp directory. The
|
---|
232 | tests will fail if /tmp is mounted with the nodev
|
---|
233 | option.</simpara></note>
|
---|
234 | </para>
|
---|
235 |
|
---|
236 | <para>
|
---|
237 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
238 | </para>
|
---|
239 |
|
---|
240 | <screen role="root"><userinput>make install</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 | </sect2>
|
---|
278 |
|
---|
279 | <sect2 role="content">
|
---|
280 | <title>Contents</title>
|
---|
281 |
|
---|
282 | <segmentedlist>
|
---|
283 | <segtitle>Installed Programs</segtitle>
|
---|
284 | <segtitle>Installed Libraries</segtitle>
|
---|
285 | <segtitle>Installed Directories</segtitle>
|
---|
286 |
|
---|
287 | <seglistitem>
|
---|
288 | <seg>
|
---|
289 | blkdeactivate, dmeventd (optional), dmsetup, fsadm, lvm, lvmconf,
|
---|
290 | and lvmdump. There are also
|
---|
291 | numerous symbolic links to lvm that implement specific
|
---|
292 | functionalities
|
---|
293 | </seg>
|
---|
294 | <seg>
|
---|
295 | libdevmapper.so, liblvm2app.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 | <varlistentry id="lvmconf">
|
---|
377 | <term><command>lvmconf</command></term>
|
---|
378 | <listitem>
|
---|
379 | <para>
|
---|
380 | is a script that modifies the locking configuration in
|
---|
381 | the <application>LVM2</application> configuration file.
|
---|
382 | </para>
|
---|
383 | <indexterm zone="lvm2 lvmconf">
|
---|
384 | <primary sortas="b-lvmconf">lvmconf</primary>
|
---|
385 | </indexterm>
|
---|
386 | </listitem>
|
---|
387 | </varlistentry>
|
---|
388 |
|
---|
389 | <varlistentry id="lvmdump">
|
---|
390 | <term><command>lvmdump</command></term>
|
---|
391 | <listitem>
|
---|
392 | <para>
|
---|
393 | is a tool used to dump various information concerning
|
---|
394 | <application>LVM2</application>.
|
---|
395 | </para>
|
---|
396 | <indexterm zone="lvm2 lvmdump">
|
---|
397 | <primary sortas="b-lvmdump">lvmdump</primary>
|
---|
398 | </indexterm>
|
---|
399 | </listitem>
|
---|
400 | </varlistentry>
|
---|
401 |
|
---|
402 | <varlistentry id="vgimportclone">
|
---|
403 | <term><command>vgimportclone</command></term>
|
---|
404 | <listitem>
|
---|
405 | <para>
|
---|
406 | is used to import a duplicated VG (e.g. hardware snapshot).
|
---|
407 | </para>
|
---|
408 | <indexterm zone="lvm2 vgimportclone">
|
---|
409 | <primary sortas="b-vgimportclone">vgimportclone</primary>
|
---|
410 | </indexterm>
|
---|
411 | </listitem>
|
---|
412 | </varlistentry>
|
---|
413 |
|
---|
414 | <varlistentry id="libdevmapper">
|
---|
415 | <term><filename class='libraryfile'>libdevmapper.so</filename></term>
|
---|
416 | <listitem>
|
---|
417 | <para>
|
---|
418 | contains the <application>Device Mapper</application> API
|
---|
419 | functions.
|
---|
420 | </para>
|
---|
421 | <indexterm zone="lvm2 libdevmapper">
|
---|
422 | <primary sortas="c-libdevmapper">libdevmapper.so</primary>
|
---|
423 | </indexterm>
|
---|
424 | </listitem>
|
---|
425 | </varlistentry>
|
---|
426 |
|
---|
427 | </variablelist>
|
---|
428 |
|
---|
429 | </sect2>
|
---|
430 |
|
---|
431 | </sect1>
|
---|