| 1 | <?xml version='1.0' encoding="UTF-8"?> |
1 | <?xml version='1.0' encoding="UTF-8"?> |
| 2 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/lvm2.xml,v 1.25 2009/02/11 06:42:14 nightmorph Exp $ --> |
2 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/lvm2.xml,v 1.26 2011/06/16 21:35:48 nightmorph Exp $ --> |
| 3 | <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
3 | <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
| 4 | |
4 | |
| 5 | <guide link="/doc/en/lvm2.xml"> |
5 | <guide> |
| 6 | <title>Gentoo LVM2 installation</title> |
6 | <title>Gentoo LVM2 installation</title> |
| 7 | |
7 | |
| 8 | <author title="Author"> |
8 | <author title="Author"> |
| 9 | <mail link="avi@CFFtechnologies.com">Avi Schwartz</mail> |
9 | <mail link="avi@CFFtechnologies.com">Avi Schwartz</mail> |
| 10 | </author> |
10 | </author> |
| … | |
… | |
| 22 | |
22 | |
| 23 | <!-- The content of this document is licensed under the CC-BY-SA license --> |
23 | <!-- The content of this document is licensed under the CC-BY-SA license --> |
| 24 | <!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
24 | <!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
| 25 | <license/> |
25 | <license/> |
| 26 | |
26 | |
| 27 | <version>2.7</version> |
27 | <version>3</version> |
| 28 | <date>2009-02-10</date> |
28 | <date>2011-06-16</date> |
| 29 | |
29 | |
| 30 | <chapter> |
30 | <chapter> |
| 31 | <title>Introduction</title> |
31 | <title>Introduction</title> |
| 32 | <section> |
32 | <section> |
| 33 | <body> |
33 | <body> |
| … | |
… | |
| 65 | supported as well. |
65 | supported as well. |
| 66 | </p> |
66 | </p> |
| 67 | |
67 | |
| 68 | <p> |
68 | <p> |
| 69 | If you install LVM2 on a currently running system with some spare hard disk |
69 | If you install LVM2 on a currently running system with some spare hard disk |
| 70 | space, you will need to enable the LVM2 module (<path>dm-mod</path>). This |
70 | space, you will need to enable the LVM2 module (<path>dm-mod</path>) in the |
| 71 | module is available in <path>gentoo-sources</path>. Compiling your kernel and |
71 | kernel. This module is available in <path>gentoo-sources</path>. Compiling |
| 72 | getting LVM2 to work is covered later in this guide. |
72 | your kernel and getting LVM2 to work is covered later in this guide. |
| 73 | </p> |
73 | </p> |
| 74 | |
74 | |
| 75 | <p> |
75 | <p> |
| 76 | Not all 2.4 kernels provided by Gentoo support LVM2! |
76 | Not all 2.4 kernels provided by Gentoo support LVM2! |
| 77 | </p> |
77 | </p> |
| … | |
… | |
| 174 | and create and activate the swap on <path>/dev/hda2</path> as described in the |
174 | and create and activate the swap on <path>/dev/hda2</path> as described in the |
| 175 | handbook. |
175 | handbook. |
| 176 | </p> |
176 | </p> |
| 177 | |
177 | |
| 178 | <p> |
178 | <p> |
| 179 | Load the LVM2 <path>dm-mod</path> module. |
179 | Start the lvm service. |
|
|
180 | </p> |
|
|
181 | |
|
|
182 | <pre caption="Starting the lvm service"> |
|
|
183 | # <i>rc-config start lvm</i> |
|
|
184 | </pre> |
|
|
185 | |
| 180 | </p> |
186 | <p> |
|
|
187 | It is recommended to add the lvm service to the boot runlevel. This way LVM2 |
|
|
188 | will be activated each time the system boots. |
|
|
189 | </p> |
| 181 | |
190 | |
| 182 | <pre caption="Loading the LVM2 module"> |
191 | <pre caption="Adding lvm to the boot runlevel"> |
| 183 | # <i>modprobe dm-mod</i> |
192 | # <i>rc-config add lvm boot</i> |
| 184 | </pre> |
193 | </pre> |
| 185 | |
194 | |
| 186 | <p> |
195 | <p> |
| 187 | Before scanning and activating LVM, you might want to edit |
196 | Before scanning and activating LVM, you might want to edit |
| 188 | <path>/etc/lvm/lvm.conf</path> to exclude some devices. By default, LVM2 will |
197 | <path>/etc/lvm/lvm.conf</path> to exclude some devices. By default, LVM2 will |
| … | |
… | |
| 352 | < > Mirror (RAID-1) support |
361 | < > Mirror (RAID-1) support |
| 353 | </pre> |
362 | </pre> |
| 354 | |
363 | |
| 355 | <pre caption="Selecting the LVM2 module in a 2.6.x kernel"> |
364 | <pre caption="Selecting the LVM2 module in a 2.6.x kernel"> |
| 356 | Device Drivers ---> |
365 | Device Drivers ---> |
| 357 | Multi-device support (RAID and LVM) ---> |
366 | Multiple devices driver support (RAID and LVM) ---> |
| 358 | [*] Multiple devices driver support (RAID and LVM) |
367 | [*] Multiple devices driver support (RAID and LVM) |
| 359 | < > RAID support |
368 | < > RAID support |
| 360 | <M> Device mapper support |
369 | <M> Device mapper support |
| 361 | </pre> |
370 | </pre> |
| 362 | |
371 | |
| 363 | <p> |
372 | <p> |
| 364 | The compiled module is called <path>dm-mod.ko</path> |
373 | The compiled module is called <path>dm-mod.ko</path> |
| 365 | </p> |
374 | </p> |
| 366 | |
|
|
| 367 | <p> |
|
|
| 368 | After you have built your kernel and installed its modules, add the following |
|
|
| 369 | line to your <path>/etc/modules.autoload.d/kernel-{KV}</path> where {KV} |
|
|
| 370 | represents your kernel version (2.4 or 2.6) so that the LVM2 module gets loaded |
|
|
| 371 | when your machine is booted: |
|
|
| 372 | </p> |
|
|
| 373 | |
|
|
| 374 | <pre caption="Adding the LVM2 module into /etc/modules.autoload.d/kernel-2.6"> |
|
|
| 375 | # <i>nano -w /etc/modules.autoload.d/kernel-2.6</i> |
|
|
| 376 | <comment>(Add the following line)</comment> |
|
|
| 377 | dm-mod |
|
|
| 378 | </pre> |
|
|
| 379 | |
375 | |
| 380 | <p> |
376 | <p> |
| 381 | Now, install the lvm2 package. |
377 | Now, install the lvm2 package. |
| 382 | </p> |
378 | </p> |
| 383 | |
379 | |