Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 1141 Details for
Bug 3025
LVM installation howto by Avi Schwartz
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
the xml source
gentoo LVM Installation.xml (text/plain), 8.24 KB, created by
Thilo Bangert (RETIRED) (RETIRED)
on 2002-05-25 10:46:16 UTC
(
hide
)
Description:
the xml source
Filename:
MIME Type:
Creator:
Thilo Bangert (RETIRED) (RETIRED)
Created:
2002-05-25 10:46:16 UTC
Size:
8.24 KB
patch
obsolete
><?xml version='1.0'?> ><guide> ><title>Gentoo LVM installation</title> ><author title="Author"><mail link="avi@CFFtechnologies.com">Avi Schwartz</mail></author> > ><abstract>In this guide I describe how I setup my Gentoo machine using the Logical Volume Manager(LVM). >While all examples are from my specific installation, it may serve as a starting >point to your own installation. ></abstract> > ><version>1.0</version> ><date>4 May 2002</date> > ><chapter> > <title>Preface</title> > <body> > <p>This guide describes my experience in setting up my specific Gentoo > system using the Logical Volume Manager (LVM). This means that you > will more then likely need to change the drive, partition names and > partition sizes to match your own setup and needs.</p> > > <impo> > This document is not intended to be an LVM tutorial. It serves as a > supplement to the Gentoo installation document and as such it references > steps in the general installation guide. Make sure to read the Gentoo > Installation Guide <b>before</b> you start your installation process. > </impo> > > <note>For a complete LVM HOWTO point your browser to > <uri>http://www.sistina.com/lvm_howtos/lvm_howto</uri>/</note> > </body> > > <section> > <title>Partitions</title> > <body> > <p>I have 2 SCSI drives, each 36 GB in size and a third drive which > is IDE and is 100 GB in size. In this example, I am not using the > IDE drive since my plan is to move its data to LVM before I > reformat it and add it to the volume group.</p> > > <p>The partition names on my system are:</p> > > <ul> > <li>/dev/sda1 -- /boot</li> > <li>/dev/sda2 -- /</li> > <li>/dev/sda3 -- Will be used by LVM</li> > <li>/dev/sdb1 -- Will be used by LVM</li> > </ul> > > <p>OK, time to start...</p> > </body> > </section> ></chapter> > ><chapter><title>Installation</title> ><body> ><ol> > <p><li> > Go through steps 1 - 5 of the installation guide. > </li></p> > > <p><li> > Steps 3 - 9 of this document replace step 6 (Set up partitions) of the installation guide. > </li></p> > > <p><li> > Create a small physical /boot partition. In this example, /boot will be > not managed by LVM. This partition will contain your booting kernel and > Grub. I created a 100 MB partition, enough for quite a few kernel > generations. > </li></p> > > <p><li> > Create a / (root) partition. If you are interested in trying to put your > root partition under LVM management, see the resources section at the end > for a link to a mini-howto on how to do this. The size of the root > partition need not be large if you will keep /opt /usr /home /var and > /tmp in an LVM Volume Group (vg). > > <note> > I would also recommend NOT to put the following directories in an > LVM partition: > <ul> > <li>/etc</li> > <li>/lib</li> > <li>/mnt</li> > <li>/proc</li> > <li>/sbin</li> > <li>/dev</li> > <li>/root</li> > </ul> > > <p>This way, you would still be able to log into your system (crippled, but > still somewhat usable, as root) if something goes terribly wrong.</p> > </note> > </li></p> > > <p><li> > Assuming the /boot and root partitions do not use the whole physical disk, > create a third partition on this disk and set it to type 8e (Linux LVM). > If you have more physical drives you would like to use with LVM, create > one partition on each and give them the same type (8e). > > <note>You can also prepare a whole device instead of a partition.</note> > </li></p> > > <p><li> > Prepare the partitions. > ><pre> >pvcreate /dev/sda3 >pvcreate /dev/sdb1 ></pre> > </li></p> > > <p><li> > Setup a volume group. > <impo> > vgcreate does not recognize links pointing to the physical > partition therefore use > ><pre> >ls -l /dev/hd* and or /dev/sd* ></pre> > > to find out the actual devices. > </impo> > > <p>In my case /dev/sda1 and /dev/sda2 are > the /boot and root partitions so I care only about /dev/sda3 and /dev/sdb1. > /dev/sda3 points to /dev/scsi/host1/bus0/target0/lun0/part3 and > /dev/sdb1 points to /dev/scsi/host1/bus0/target1/lun0/part1. Therefore my > vgcreate will look as follows:</p> > ><pre> >vgcreate vg /dev/scsi/host1/bus0/target0/lun0/part2 \ > /dev/scsi/host1/bus0/target1/lun0/part1 ></pre> > </li></p> > > <p><li> > Create the logical volumes. Logical volumes are the equivalent of > partitions you create using fdisk in a non LVM environment. In my example > I create the following partitions: > > <table> > <tr> > <th>Directory</th> > <th>Size</th> > </tr> > <tr> > <ti>/usr</ti><ti>10 GB</ti> > </tr> > <tr> > <ti>/home</ti><ti>5 GB</ti> > </tr> > <tr> > <ti>/opt</ti><ti>5 GB</ti> > </tr> > <tr> > <ti>/var</ti><ti>10 GB</ti> > </tr> > <tr> > <ti>/tmp</ti><ti>2 GB</ti> > </tr> > </table> > > <p>Since I was going to use LVM, I didn't worry too much about partition > sizes since I can always move space around as needed.</p> > > <note> > Terje Kvernes commented correctly, that it is easier to increase the > size of a partition then to shrink it. You might want therefore to start > with smaller partitions and increase their size as needed. > </note> > > <note> > I also created a swap partition on LVM. You will be probably better off > not using LVM for swap, but I felt I had to try it :-) > </note> > ><pre> >lvcreate -L10G -nusr vg >lvcreate -L5G -nhome vg >... >lvcreate -L2G -ntmp vg ></pre> > </li></p> > > <p><li> > Format the logical volumes the same way you format a regular partition: > > <p>First, lets take care of the swap logical volume:</p> > ><pre> > mkswap /dev/vg/swap ></pre> > > <p>I am using ext3 on the rest of the logical volumes:</p> > ><pre> > mke2fs -j /dev/vg/usr > ... ></pre> > > <note> > The rest of the installation document is mostly unchanged so I will not > walk you through it again except to point differences. > </note> > </li></p> > > <p><li> > Follow step 7 (Mount partitions) of the installation document exchanging > /dev/vg/partition_name for /dev/hdxx (except of course for the boot and > root partitions since they are not on a LVM). > </li></p> > > <p><li> > Step 14 (Final steps: kernel and system logger) - Make sure to configure > your kernel to support LVM. You can find this option in the entry named > > <p>Multi-device support (RAID and LVM)</p> > > <p>also make sure to merge the lvm-user package.</p> > </li></p> > > <p><li> > Step 16 (Final steps: /etc/fstab) - Add your LVM partitions to /etc/fstab > as needed. Again, here are few lines from my machine: > ><pre> >/dev/sda1 /boot ext3 noauto,noatime 1 1 >/dev/sda2 / ext3 noatime 0 0 >/dev/vg/opt /opt ext3 noatime 0 0 >/dev/vg/usr /usr ext3 noatime 0 0 >... ></pre> > > <p>If you configured LVM as a module when you configured the kernel, add to > your /etc/modules.autoload the line</p> > ><pre> >lvm-mod ></pre> > </li></p> > > <p><li> > Step 17 (Installation complete!) - Don't forget to umount all your LVM > partitions as well and for a good measure run the following command before > you reboot: > ><pre> >vgchange -an ></pre> > </li></p> > > <p><li> > Reboot your machine, but be warned that the boot process will likely give > you many error messages since the localmount script will fail to > recognize the fact that LVM is in use. Once you log into your system, > issue the following command: > ><pre> >vgscan ></pre> > > This will generate the /etc/lvmtab that the localmount script uses to > check if it should start LVM. Restart your machine and now all > partitions should be visible and mounted. > </li></p> ></ol> ></body> ></chapter> > ><chapter> > <title>Resources</title> > <body> > <p>The LVM Howto: > <uri>http://www.sistina.com/lvm_howtos/lvm_howto/</uri></p> > <p>Daniel Robbins' articles on LVM at IBM's DeveloperWorks: > <uri>http://www-106.ibm.com/developerworks/linux/library/l-lvm/?dwzone=linux</uri> > <uri>http://www-106.ibm.com/developerworks/linux/library/l-lvm2.html?dwzone=linux</uri></p> > <p>How to boot your root FS off of LVM: > <uri>http://www.the-infinite.org/archive/docs/lvm/howto-boot-off-root-lv.txt</uri></p> ></body> ></chapter> > ><chapter> > <title>Acknowledgements</title> > <body> > I would like to thank <mail link="bangert@gentoo.org">Thilo Bangert</mail> > and <mail link="terjekv@math.uio.no">Terje Kvernes</mail> for their help > and comments on this document. > </body> ></chapter> ></guide>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 3025
: 1141