/[gentoo]/xml/htdocs/doc/en/lvm2.xml
Gentoo

Diff of /xml/htdocs/doc/en/lvm2.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.16 Revision 1.17
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.16 2005/10/03 22:49:15 rane Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/lvm2.xml,v 1.17 2006/01/20 11:42:43 neysx 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 link="/doc/en/lvm2.xml">
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.0.11</version> 27<version>2.1</version>
28<date>2005-08-17</date> 28<date>2006-01-20</date>
29 29
30<chapter> 30<chapter>
31<title>Introduction</title> 31<title>Introduction</title>
32<section> 32<section>
33<body> 33<body>
60<p> 60<p>
61If you do a fresh install of Gentoo, you will need to use a bootable CD with 61If you do a fresh install of Gentoo, you will need to use a bootable CD with
62LVM2 support such as a Gentoo Installation CD. You can find the Installation CDs for an x86 62LVM2 support such as a Gentoo Installation CD. You can find the Installation CDs for an x86
63architecture on our <uri 63architecture on our <uri
64link="/main/en/mirrors.xml">mirrors</uri> under 64link="/main/en/mirrors.xml">mirrors</uri> under
65<path>/releases/x86/2005.1/installcd</path>. Other architectures might 65<path>/releases/x86/2005.1-r1/installcd</path>. Other architectures might
66be supported as well. 66be supported as well.
67</p> 67</p>
68 68
69<p> 69<p>
70If you install LVM2 on a currently running system with some spare hard disk 70If you install LVM2 on a currently running system with some spare hard disk
132mentioned above as an example. It is only <e>an example</e>, adapt it to your 132mentioned above as an example. It is only <e>an example</e>, adapt it to your
133own needs. 133own needs.
134</p> 134</p>
135 135
136<p> 136<p>
137Create a small physical /boot partition (hda1). In this example, /boot will be 137Create a small physical <path>/boot</path> partition (hda1). In this example,
138not managed by LVM2. This partition will contain your bootloader and your 138<path>/boot</path> will be not managed by LVM2. This partition will contain
139kernel(s). A 64MB partition should be well enough for quite a few kernel 139your bootloader and your kernel(s). A 64MB partition should be well enough for
140generations. 140quite a few kernel generations.
141</p>
142
143<p> 141</p>
144Create a swap partition (hda2) and activate it. 142
145</p> 143<p>
146 144Create a swap partition (hda2).
147<pre caption="Activating the swap partition">
148# <i>mkswap /dev/hda2</i>
149# <i>swapon /dev/hda2</i>
150</pre> 145</p>
151 146
152<p> 147<p>
153Create a / (root) partition (hda3). If you are interested in trying to put your 148Create a / (root) partition (hda3). If you are interested in trying to put your
154root partition under LVM management (which we do not recommend), see the 149root partition under LVM management (which we do not recommend), see the
155resources section at the end of this guide for a link to a mini-howto on how to 150resources section at the end of this guide for a link to a mini-howto on how to
165This way, you would still be able to log into your system (crippled, but 160This way, you would still be able to log into your system (crippled, but
166still somewhat usable, as root) if something goes terribly wrong. 161still somewhat usable, as root) if something goes terribly wrong.
167</note> 162</note>
168 163
169<p> 164<p>
170Assuming the /boot, swap and root partitions do not use the whole physical disk, 165Assuming the <path>/boot</path>, swap and root partitions do not use the whole
171create a fourth partition on this disk and set it to type 8e (Linux LVM). 166physical disk, create a fourth partition on this disk and set it to type 8e
172If you have more physical drives you would like to use with LVM, create 167(Linux LVM). If you have more physical drives you would like to use with LVM,
173one partition on each and give them the same type (8e). 168create one partition on each and give them the same type (8e).
174</p> 169</p>
175 170
176<note> 171<note>
177Considering the huge size of current disks, you might consider splitting your 172Considering the huge size of current disks, you might consider splitting your
178hard disks into smaller partitions instead of creating a big partition that 173hard disks into smaller partitions instead of creating a big partition that
182until you know you need it. As an example, one contributor had split his 177until you know you need it. As an example, one contributor had split his
183160&nbsp;Gb hard disk into 8 partitions of 20&nbsp;Gb each. 178160&nbsp;Gb hard disk into 8 partitions of 20&nbsp;Gb each.
184</note> 179</note>
185 180
186<p> 181<p>
182Create the filesystems on <path>/dev/hda1</path> and <path>/dev/hda3</path>,
183and create and activate the swap on <path>/dev/hda2</path> as described in the
184handbook.
185</p>
186
187<p>
187Load the LVM2 <path>dm-mod</path> module. 188Load the LVM2 <path>dm-mod</path> module.
188</p> 189</p>
189 190
190<pre caption="Loading the LVM2 module"> 191<pre caption="Loading the LVM2 module">
191# <i>modprobe dm-mod</i> 192# <i>modprobe dm-mod</i>
192</pre> 193</pre>
193 194
194<p> 195<p>
195Scan and activate LVM: 196Before scanning and activating LVM, you might want to edit
197<path>/etc/lvm/lvm.conf</path> to exclude some devices. By default, LVM2 will
198scan all devices, even your CDROM which can generate error messages. In the
199following exemple, the line that allows scanning of all devices is replaced by
200one that rejects every device but our two IDE disks.
196</p> 201</p>
197 202
198<pre caption="Activating LVM"> 203<pre caption="Activating LVM">
199<comment>(Avoid scanning your cdrom)</comment> 204<comment>(Avoid scanning all devices but our disks)</comment>
200# <i>mkdir -p /etc/lvm</i> 205# <i>nano -w /etc/lvm/lvm.conf</i>
201# <i>echo 'devices { filter=["r/cdrom/"] }' >/etc/lvm/lvm.conf</i> 206<comment>(Look for the following line)</comment>
207 filter = [ "a/.*/" ]
208<comment>(Replace it with the following one to scan
209/dev/hda and /dev/hdb and reject anything else)</comment>
210 filter = [ "a|/dev/hd[ab]|", "r/.*/" ]
211<comment>(Save the file and quit nano)</comment>
202# <i>vgscan</i> 212# <i>vgscan</i>
203 Reading all physical volumes. This may take a while... 213 Reading all physical volumes. This may take a while...
204 No volume groups found 214 No volume groups found
205<comment>(Make any previously set up volume groups available)</comment> 215<comment>(Make any previously set up volume groups available)</comment>
206# <i>vgchange -a y</i> 216# <i>vgchange -a y</i>
387<path>/usr/src/linux/include/linux</path>. 397<path>/usr/src/linux/include/linux</path>.
388</impo> 398</impo>
389 399
390<pre caption="Emerging the LVM2 package"> 400<pre caption="Emerging the LVM2 package">
391# <i>emerge lvm2</i> 401# <i>emerge lvm2</i>
392<comment>(At the time of writing, the stable version is 2.00.08. 402</pre>
393With version 2.00.08, prevent lvm2 from probing your cdrom by doing:</comment>
394# <i>echo 'devices { filter=["r/cdrom/"] }' >> /etc/lvm/lvm.conf</i>
395 403
396<comment>(Versions 2.00.15 and later come with a /etc/lvm/lvm.conf 404<p>
397Edit your /etc/lvm/lvm.conf and follow the comments</comment> 405Edit <path>/etc/lvm/lvm.conf</path> as described <uri
398# <i>nano -w /etc/lvm/lvm.conf</i> 406link="#doc_chap2_pre2">earlier</uri>. The file you previously edited is part of
407your installation environment and will disappear after the next reboot. This
408time, you edit the real one inside your new Gentoo install.
399</pre> 409</p>
400 410
401<p> 411<p>
402When editing your <path>/etc/fstab</path> file, follow the handbook and add 412When editing your <path>/etc/fstab</path> file, follow the handbook and add
403your LVM2 logical volumes as needed. Again, here are a few lines needed for 413your LVM2 logical volumes as needed. Again, here are a few lines needed for
404our example: 414our example:
479 </li> 489 </li>
480 <li> 490 <li>
481 The <uri link="http://tldp.org/HOWTO/LVM-HOWTO">LVM Howto</uri> 491 The <uri link="http://tldp.org/HOWTO/LVM-HOWTO">LVM Howto</uri>
482 </li> 492 </li>
483 <li> 493 <li>
484 Daniel Robbins's articles on LVM at IBM's DeveloperWorks: 494 Daniel Robbins's articles on LVM for IBM's DeveloperWorks: <uri
485 <uri>http://www-106.ibm.com/developerworks/linux/library/l-lvm/?dwzone=linux</uri> 495 link="/doc/en/articles/lvm-p1.xml">Part 1</uri> and <uri
486 and 496 link="/doc/en/articles/lvm-p2.xml">Part 2</uri>
487 <uri>http://www-106.ibm.com/developerworks/linux/library/l-lvm2.html?dwzone=linux</uri>
488 </li> 497 </li>
489 <li> 498 <li>
490 How to boot your root FS off of LVM1: 499 How to boot your root FS off of LVM1:
491 <uri>http://www.the-infinite.org/archive/docs/lvm/howto-boot-off-root-lv.txt</uri> 500 <uri>http://www.the-infinite.org/archive/docs/lvm/howto-boot-off-root-lv.txt</uri>
492 </li> 501 </li>

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.20