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 " ">
|
---|
8 | <!ENTITY lvm2-download-ftp "ftp://sources.redhat.com/pub/lvm2/releases/LVM2.&lvm2-version;.tgz">
|
---|
9 | <!ENTITY lvm2-md5sum "839702f282977b3cc2e6ddc5ef9d9907">
|
---|
10 | <!ENTITY lvm2-size "2.0 MB">
|
---|
11 | <!ENTITY lvm2-buildsize "28 MB (add 19 MB for tests, however transient files can grow up to around 500 MB)">
|
---|
12 | <!ENTITY lvm2-time "0.4 SBU (add 6.0 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 | &lfs7a_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">Optional</bridgehead>
|
---|
79 | <para role="optional">
|
---|
80 | <xref linkend='mdadm'/>,
|
---|
81 | <xref linkend='reiserfs'/>,
|
---|
82 | <xref linkend='valgrind'/>,
|
---|
83 | <xref linkend='which'/>,
|
---|
84 | <xref linkend='xfsprogs'/> (all five may be used, but are not required,
|
---|
85 | for tests), and
|
---|
86 | <ulink url='https://github.com/jthornber/thin-provisioning-tools'>
|
---|
87 | thin-provisioning-tools</ulink>
|
---|
88 | </para>
|
---|
89 |
|
---|
90 | <para condition="html" role="usernotes">User Notes:
|
---|
91 | <ulink url="&blfs-wiki;/lvm2"/>
|
---|
92 | </para>
|
---|
93 |
|
---|
94 | <caution>
|
---|
95 | <para>
|
---|
96 | Kernel versions between 4.1 and 4.4.1 have a broken RAID
|
---|
97 | implementation. If you want to use RAID type LV's, you should install
|
---|
98 | kernel version 4.4.2 or above. Note that several tests use RAID logical
|
---|
99 | volumes, and can generate a <quote>kernel oops</quote> with the faulty
|
---|
100 | kernel version, which usually renders the system unusable.
|
---|
101 | </para>
|
---|
102 | </caution>
|
---|
103 | </sect2>
|
---|
104 |
|
---|
105 | <sect2 role="kernel" id="lvm2-kernel">
|
---|
106 | <title>Kernel Configuration</title>
|
---|
107 |
|
---|
108 | <para>
|
---|
109 | Enable the following options in the kernel configuration
|
---|
110 | and recompile the kernel:
|
---|
111 | </para>
|
---|
112 |
|
---|
113 | <note><para>
|
---|
114 | There are several other Device Mapper options in the kernel beyond those
|
---|
115 | listed below. In order to get reasonable results if running the
|
---|
116 | regression tests, all must be enabled either internally or as a module.
|
---|
117 | The tests will all time out if Magic SysRq key is not enabled.
|
---|
118 | </para></note>
|
---|
119 |
|
---|
120 | <screen><literal>Device Drivers --->
|
---|
121 | [*] Multiple devices driver support (RAID and LVM) ---> [CONFIG_MD]
|
---|
122 | <*/M> Device mapper support [CONFIG_BLK_DEV_DM]
|
---|
123 | <*/M/ > Crypt target support [CONFIG_DM_CRYPT]
|
---|
124 | <*/M/ > Snapshot target [CONFIG_DM_SNAPSHOT]
|
---|
125 | <*/M/ > Thin provisioning target [CONFIG_DM_THIN_PROVISIONING]
|
---|
126 | <*/M/ > Mirror target [CONFIG_DM_MIRROR]
|
---|
127 | Kernel hacking --->
|
---|
128 | [*] Magic SysRq key [CONFIG_MAGIC_SYSRQ]</literal></screen>
|
---|
129 |
|
---|
130 | <indexterm zone="lvm2 lvm2-kernel">
|
---|
131 | <primary sortas="d-lvm2">lvm2</primary>
|
---|
132 | </indexterm>
|
---|
133 |
|
---|
134 | </sect2>
|
---|
135 |
|
---|
136 | <sect2 role="installation">
|
---|
137 | <title>Installation of LVM2</title>
|
---|
138 |
|
---|
139 | <para>
|
---|
140 | Install <application>LVM2</application> by running the following
|
---|
141 | commands:
|
---|
142 | </para>
|
---|
143 |
|
---|
144 | <screen revision="sysv"><userinput>SAVEPATH=$PATH &&
|
---|
145 | PATH=$PATH:/sbin:/usr/sbin &&
|
---|
146 | ./configure --prefix=/usr \
|
---|
147 | --exec-prefix= \
|
---|
148 | --enable-applib \
|
---|
149 | --enable-cmdlib \
|
---|
150 | --enable-pkgconfig \
|
---|
151 | --enable-udev_sync &&
|
---|
152 | make &&
|
---|
153 | PATH=$SAVEPATH &&
|
---|
154 | unset SAVEPATH</userinput></screen>
|
---|
155 |
|
---|
156 | <screen revision="systemd"><userinput>SAVEPATH=$PATH &&
|
---|
157 | PATH=$PATH:/sbin:/usr/sbin &&
|
---|
158 | ./configure --prefix=/usr \
|
---|
159 | --exec-prefix= \
|
---|
160 | --with-confdir=/etc \
|
---|
161 | --enable-applib \
|
---|
162 | --enable-cmdlib \
|
---|
163 | --enable-pkgconfig \
|
---|
164 | --enable-udev_sync &&
|
---|
165 | make &&
|
---|
166 | PATH=$SAVEPATH &&
|
---|
167 | unset SAVEPATH</userinput></screen>
|
---|
168 |
|
---|
169 | <para>
|
---|
170 | The tests use <application>udev</application> for logical volume
|
---|
171 | synchronization, so that the LVM udev rules and some utilities need to
|
---|
172 | be installed before running the tests. If you are installing
|
---|
173 | <application>LVM2</application> for the first time, and do not
|
---|
174 | want to install the full package before running the tests, the minimal
|
---|
175 | set of utilities can be installed by running the following instructions
|
---|
176 | as the <systemitem class="username">root</systemitem> user:
|
---|
177 | </para>
|
---|
178 |
|
---|
179 | <screen role="root"><userinput>make -C tools install_dmsetup_dynamic &&
|
---|
180 | make -C udev install &&
|
---|
181 | make -C libdm install</userinput></screen>
|
---|
182 |
|
---|
183 | <para>
|
---|
184 | To test the results, issue: <command>make check_local</command> as the
|
---|
185 | <systemitem class="username">root</systemitem> user. Other targets are
|
---|
186 | available and can be listed with <command>make -C test help</command>.
|
---|
187 | The test timings are very dependent on the speed of the disk(s), and on
|
---|
188 | the number of enabled kernel options.
|
---|
189 | </para>
|
---|
190 | <para>
|
---|
191 | Those tests do not implement the <quote>expected fail</quote> possibility,
|
---|
192 | and a small number of test failures is expected by upstream. More
|
---|
193 | failures may happen because some kernel options are missing. For example,
|
---|
194 | the lack of the <emphasis>dm-delay</emphasis> device mapper target may
|
---|
195 | explain somefailures. Some tests are flagged
|
---|
196 | <quote>warned</quote> if
|
---|
197 | <ulink url='https://github.com/jthornber/thin-provisioning-tools'>
|
---|
198 | thin-provisioning-tools</ulink> are not installed. A workaround is to
|
---|
199 | add the following flags to <command>configure</command>:
|
---|
200 | </para>
|
---|
201 |
|
---|
202 | <screen role="nodump"><userinput> --with-thin-check= \
|
---|
203 | --with-thin-dump= \
|
---|
204 | --with-thin-repair= \
|
---|
205 | --with-thin-restore= \
|
---|
206 | --with-cache-check= \
|
---|
207 | --with-cache-dump= \
|
---|
208 | --with-cache-repair= \
|
---|
209 | --with-cache-restore= \</userinput></screen>
|
---|
210 |
|
---|
211 | <para>
|
---|
212 | Some tests may hang with kernel versions in the 4.1 and 4.2 series (see
|
---|
213 | above). They can be removed if necessary, for example: <command>rm
|
---|
214 | test/shell/lvcreate-large-raid.sh</command>. The tests generate a lot
|
---|
215 | of kernel messages, which may clutter your terminal. You can disable them
|
---|
216 | by issuing <command>dmesg -D</command> before running the tests (do not
|
---|
217 | forget to issue <command>dmesg -E</command> when tests are done).
|
---|
218 | </para>
|
---|
219 |
|
---|
220 | <para>
|
---|
221 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
222 | </para>
|
---|
223 |
|
---|
224 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
225 |
|
---|
226 | </sect2>
|
---|
227 |
|
---|
228 | <sect2 role="commands">
|
---|
229 | <title>Command Explanations</title>
|
---|
230 |
|
---|
231 | <para>
|
---|
232 | <command>PATH=$PATH:/sbin:/usr/sbin</command>: The path
|
---|
233 | must contain <filename class="directory">/sbin</filename> and
|
---|
234 | <filename class='directory'>/usr/sbin</filename> for proper system tool
|
---|
235 | detection by the <command>configure</command> script. This instruction
|
---|
236 | ensures that PATH is properly set even if you build as an unprivileged user.
|
---|
237 | </para>
|
---|
238 |
|
---|
239 | <para>
|
---|
240 | <parameter>--enable-applib</parameter>: This switch enables
|
---|
241 | building of the shared application library.
|
---|
242 | </para>
|
---|
243 |
|
---|
244 | <para>
|
---|
245 | <parameter>--enable-cmdlib</parameter>: This switch enables
|
---|
246 | building of the shared command library. It is required
|
---|
247 | when building the event daemon.
|
---|
248 | </para>
|
---|
249 |
|
---|
250 | <para>
|
---|
251 | <parameter>--enable-pkgconfig</parameter>: This switch enables
|
---|
252 | installation of <command>pkg-config</command> support files.
|
---|
253 | </para>
|
---|
254 |
|
---|
255 | <para>
|
---|
256 | <parameter>--enable-udev_sync</parameter>: This switch enables
|
---|
257 | synchronisation with <application>Udev</application> processing.
|
---|
258 | </para>
|
---|
259 |
|
---|
260 | <para>
|
---|
261 | <option>--enable-dmeventd</option>: This switch enables
|
---|
262 | building of the <application>Device Mapper</application>
|
---|
263 | event daemon.
|
---|
264 | </para>
|
---|
265 |
|
---|
266 | <para>
|
---|
267 | <option>--enable-lvmetad</option>: This switch enables
|
---|
268 | building of the <application>LVM</application> metadata daemon,
|
---|
269 | which avoids scanning all the filesystems when an lvm command is
|
---|
270 | run.
|
---|
271 | </para>
|
---|
272 |
|
---|
273 | </sect2>
|
---|
274 |
|
---|
275 | <sect2 role="content">
|
---|
276 | <title>Contents</title>
|
---|
277 |
|
---|
278 | <segmentedlist>
|
---|
279 | <segtitle>Installed Programs</segtitle>
|
---|
280 | <segtitle>Installed Libraries</segtitle>
|
---|
281 | <segtitle>Installed Directories</segtitle>
|
---|
282 |
|
---|
283 | <seglistitem>
|
---|
284 | <seg>
|
---|
285 | blkdeactivate, dmeventd (optional), dmsetup, fsadm, lvm, lvmconf,
|
---|
286 | lvmdump, lvmetad (optional), and vgimportclone. There are also
|
---|
287 | numerous symbolic links to lvm that implement specific
|
---|
288 | functionalities
|
---|
289 | </seg>
|
---|
290 | <seg>
|
---|
291 | libdevmapper.so, liblvm2app.so, and liblvm2cmd.so; optional:
|
---|
292 | libdevmapper-event.so, libdevmapper-event-lvm2.so,
|
---|
293 | libdevmapper-event-lvm2mirror.so, libdevmapper-event-lvm2snapshot.so,
|
---|
294 | libdevmapper-event-lvm2raid.so, and libdevmapper-event-lvm2thin.so
|
---|
295 | </seg>
|
---|
296 | <seg>
|
---|
297 | /etc/lvm and
|
---|
298 | /lib/device-mapper (optional)
|
---|
299 | </seg>
|
---|
300 | </seglistitem>
|
---|
301 | </segmentedlist>
|
---|
302 |
|
---|
303 | <variablelist>
|
---|
304 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
305 | <?dbfo list-presentation="list"?>
|
---|
306 |
|
---|
307 | <?dbhtml list-presentation="table"?>
|
---|
308 |
|
---|
309 | <varlistentry id="blkdeactivate">
|
---|
310 | <term><command>blkdeactivate</command></term>
|
---|
311 | <listitem>
|
---|
312 | <para>
|
---|
313 | is a utility to deactivate block device.
|
---|
314 | </para>
|
---|
315 | <indexterm zone="lvm2 blkdeactivate">
|
---|
316 | <primary sortas="b-blkdeactivate">blkdeactivate</primary>
|
---|
317 | </indexterm>
|
---|
318 | </listitem>
|
---|
319 | </varlistentry>
|
---|
320 |
|
---|
321 | <varlistentry id="dmeventd">
|
---|
322 | <term><command>dmeventd</command></term>
|
---|
323 | <listitem>
|
---|
324 | <para>
|
---|
325 | (optional) is the Device Mapper event daemon.
|
---|
326 | </para>
|
---|
327 | <indexterm zone="lvm2 dmeventd">
|
---|
328 | <primary sortas="b-dmeventd">dmeventd</primary>
|
---|
329 | </indexterm>
|
---|
330 | </listitem>
|
---|
331 | </varlistentry>
|
---|
332 |
|
---|
333 | <varlistentry id="dmsetup">
|
---|
334 | <term><command>dmsetup</command></term>
|
---|
335 | <listitem>
|
---|
336 | <para>
|
---|
337 | is a low level logical volume management tool.
|
---|
338 | </para>
|
---|
339 | <indexterm zone="lvm2 dmsetup">
|
---|
340 | <primary sortas="b-dmsetup">dmsetup</primary>
|
---|
341 | </indexterm>
|
---|
342 | </listitem>
|
---|
343 | </varlistentry>
|
---|
344 |
|
---|
345 | <varlistentry id="fsadm">
|
---|
346 | <term><command>fsadm</command></term>
|
---|
347 | <listitem>
|
---|
348 | <para>
|
---|
349 | is a utility used to resize or check filesystem on a device.
|
---|
350 | </para>
|
---|
351 | <indexterm zone="lvm2 fsadm">
|
---|
352 | <primary sortas="b-fsadm">fsadm</primary>
|
---|
353 | </indexterm>
|
---|
354 | </listitem>
|
---|
355 | </varlistentry>
|
---|
356 |
|
---|
357 | <varlistentry id="lvm">
|
---|
358 | <term><command>lvm</command></term>
|
---|
359 | <listitem>
|
---|
360 | <para>
|
---|
361 | provides the command-line tools for <application>LVM2</application>.
|
---|
362 | Commands are implemented via sympolic links to this program to
|
---|
363 | manage physical devices (pv*), volume groups (vg*) and logical
|
---|
364 | volumes (lv*).
|
---|
365 | </para>
|
---|
366 | <indexterm zone="lvm2 lvm">
|
---|
367 | <primary sortas="b-lvm">lvm</primary>
|
---|
368 | </indexterm>
|
---|
369 | </listitem>
|
---|
370 | </varlistentry>
|
---|
371 |
|
---|
372 | <varlistentry id="lvmconf">
|
---|
373 | <term><command>lvmconf</command></term>
|
---|
374 | <listitem>
|
---|
375 | <para>
|
---|
376 | is a script that modifies the locking configuration in
|
---|
377 | the <application>LVM2</application> configuration file.
|
---|
378 | </para>
|
---|
379 | <indexterm zone="lvm2 lvmconf">
|
---|
380 | <primary sortas="b-lvmconf">lvmconf</primary>
|
---|
381 | </indexterm>
|
---|
382 | </listitem>
|
---|
383 | </varlistentry>
|
---|
384 |
|
---|
385 | <varlistentry id="lvmdump">
|
---|
386 | <term><command>lvmdump</command></term>
|
---|
387 | <listitem>
|
---|
388 | <para>
|
---|
389 | is a tool used to dump various information concerning
|
---|
390 | <application>LVM2</application>.
|
---|
391 | </para>
|
---|
392 | <indexterm zone="lvm2 lvmdump">
|
---|
393 | <primary sortas="b-lvmdump">lvmdump</primary>
|
---|
394 | </indexterm>
|
---|
395 | </listitem>
|
---|
396 | </varlistentry>
|
---|
397 |
|
---|
398 | <varlistentry id="lvmetad">
|
---|
399 | <term><command>lvmetad</command></term>
|
---|
400 | <listitem>
|
---|
401 | <para>
|
---|
402 | (optional) is the LVM metadata daemon.
|
---|
403 | </para>
|
---|
404 | <indexterm zone="lvm2 lvmetad">
|
---|
405 | <primary sortas="b-lvmetad">lvmetad</primary>
|
---|
406 | </indexterm>
|
---|
407 | </listitem>
|
---|
408 | </varlistentry>
|
---|
409 |
|
---|
410 | <varlistentry id="vgimportclone">
|
---|
411 | <term><command>vgimportclone</command></term>
|
---|
412 | <listitem>
|
---|
413 | <para>
|
---|
414 | is used to import a duplicated VG (e.g. hardware snapshot).
|
---|
415 | </para>
|
---|
416 | <indexterm zone="lvm2 vgimportclone">
|
---|
417 | <primary sortas="b-vgimportclone">vgimportclone</primary>
|
---|
418 | </indexterm>
|
---|
419 | </listitem>
|
---|
420 | </varlistentry>
|
---|
421 |
|
---|
422 | <varlistentry id="libdevmapper">
|
---|
423 | <term><filename class='libraryfile'>libdevmapper.so</filename></term>
|
---|
424 | <listitem>
|
---|
425 | <para>
|
---|
426 | contains the <application>Device Mapper</application> API
|
---|
427 | functions.
|
---|
428 | </para>
|
---|
429 | <indexterm zone="lvm2 libdevmapper">
|
---|
430 | <primary sortas="c-libdevmapper">libdevmapper.so</primary>
|
---|
431 | </indexterm>
|
---|
432 | </listitem>
|
---|
433 | </varlistentry>
|
---|
434 |
|
---|
435 | </variablelist>
|
---|
436 |
|
---|
437 | </sect2>
|
---|
438 |
|
---|
439 | </sect1>
|
---|