1 AUTHOR: Wee Teck <weeteck at en.com.sg>
5 LICENSE: GNU Free Documentation License Version 1.2
7 SYNOPSIS: Logical Volume Manager (LVM 2) on LFS
11 Simple hint for setting up LVM on LFS. For more complete information on
12 using LVM, please visit http://www.tldp.org/HOWTO/LVM-HOWTO/
14 Only simple HOW-TO is covered in this hints.
16 Comments are prefixed with <--
20 ftp://sources.redhat.com/pub/dm/device-mapper.1.02.10.tgz
21 ftp://sources.redhat.com/pub/lvm2/LVM2.2.02.10.tgz
25 - Filesystem supporting programs.
26 Eg. e2fsprogs, xfsprogs etc..
27 - Understanding of LVM
34 -> Installing device-mapper (dm) (Required for LVM 2)
35 Get the latest device-mapper from redhat, latest as of writing is 1.02.10
36 tar zxf device-mapper.1.02.10.tgz
37 cd device-mapper.1.02.10
38 ./configure --prefix=/usr --sbindir=/sbin --libdir=/lib && make && make install
41 Get the latest LVM2 from redhat, latest as of writing is 2.02.10
42 tar zxf LVM2.2.02.10.tgz
44 ./configure --prefix=/usr --sysconfdir=/etc && make && make install
48 [*] Multiple devices driver support (RAID and LVM)
49 <*> Device mapper support
56 -> For full complete guide please refer to http://www.tldp.org/HOWTO/LVM-HOWTO/
58 -> Preparing disk for LVM (PV)
59 There is 2 ways to activate LVM; by parition, by drive.
60 Example quoted using diskname hdc
63 set partition's system id to 8e
64 eg. /dev/hdc3 1014 77545 38572128 8e Linux LVM
65 Activate the partition for LVM use.
68 # Physical volume "/dev/hdc3" successfully created
71 You will need to remove partition table on the drive
75 The following commands will destroy the partition table on the disk being
76 operated on. Be very sure it is the correct disk.
78 # dd if=/dev/zero of=/dev/hdc bs=1k count=1
79 # blockdev --rereadpt /dev/hdc
81 Activate the partition for LVM use.
84 # Physical volume "/dev/hdc" successfully created
86 -> managing Volume Group (VG)
87 Assuming to have LVM partition on hdc
88 Example using volume group name "vg0"
90 # vgcreate vg0 /dev/hdc
91 # Volume group "vg0" successfully created
93 You can extend (aka Add) the volume group with more disk/partition
95 # vgextend vg0 /dev/hdb1
96 # Volume group "vg0" successfully extended
99 -> managing Logical Volume (LV)
101 Creating a 10GB LV named "database" with VG "vg0"
103 # lvcreate -L10G -ndatabase vg0
104 # Logical volume "database" created
107 -> creating filesystem on top of Logical Volume (LV)
109 You have successfully created a 'partition' with the addressing
113 Create your favourite filesystem on top of it. In this case,
114 I shall use Reiser4 (Please refer to LFS Hints on Reiser4 by myself)
116 # mkfs.reiser4 /dev/vg0/database
118 Mounting it to the location needed
120 # mount /dev/vg0/database /mnt
122 You should see something like this
125 reiser4 37G 1.4M 37G 1% /mnt
130 Some changes are required for your bootscript
132 To de-activate your LVM BEFORE shutting down your system
134 # 0 logical volume(s) in volume group "vg0" now active
136 To re-activate your LVM AFTER rebooting your system
138 # 1 logical volume(s) in volume group "vg0" now active
144 Q: How do I display information about VG, LV and PV
145 A: Commands are "vgdisplay" "lvdisplay" "pvdisplay".
146 Please read up on the LVM Documentation instead.
148 Q: How do I use Reiser4.
149 A: http://www.linuxfromscratch.org/hints/downloads/files/reiser4-on-2.6.txt
151 Q: Where should I de/re-activate the LVM?
152 A: I believe each LFS comes in their own variant and preferences, therefore,
153 it is almost impossible for me to know where.
155 For those using BSD-style bootscript, here's my setup.
157 activate LVM after remounting root rw
161 "/bin/mount -n -v -o remount,rw /"
163 .... mount your LV after here ....
165 deactivate LVM before remounting root ro
170 .... unmount all LV .....
171 "/bin/mount -n -o remount,ro /"
173 Q: Can you help me setup LVM on my LFS system?
174 A: No/Yes, personally I have no time for that.
175 But i'm available for outsource, my contact is above.
179 * TLDP - LVM HOWTO http://www.tldp.org/HOWTO/LVM-HOWTO/