Linux System Administration
Logical Volume Manager (LVM)
The next step is to create a Logical Volume from the Volume Group.
We can partition the volume group into logical volumes with the
lvcreate
command.
While hard disks are divided into blocks of data, logical volumes are divided into units called
physical extents
(PEs).
You'll have to know the number of available PEs before creating the logical volume.
This is done with the
vgdisplay
command using the new
lvm-hdb
volume group as the argument.
sh-2.05b# vgdisplay lvm-hdb
--- Volume group ---
VG Name lvm-hdb
VG Access read/write
VG Status available/resizable
VG # 0
MAX LV 256
Cur LV 0
Open LV 0
MAX LV Size 255.99 GB
Max PV 256
Cur PV 2
Act PV 2
VG Size 848 MB
PE Size 4 MB
Total PE 212
Alloc PE / Size 0 / 0
Free PE / Size 212 / 848 MB
VG UUID W7bgLB-lAFW-wtKi-wZET-jDJF-8VYD-snUaSZ
sh-2.05b#
As you can see, 212 PEs are available as free.
We can now use all 212 of them to create a logical volume named
lvm0
from volume group
lvm-hdb
.
sh-2.05b#
lvcreate -l 212 lvm-hdb -n lvm0
Logical volume "lvm0" created
sh-2.05b#
Prev
Page 7
Next