11.7. Creating a logical volume

To create a 1500MB linear LV named 'testlv' and its block device special '/dev/testvg/testlv':

# lvcreate -L1500 -ntestlv testvg
        

To create a 100 LE large logical volume with 2 stripes and stripe size 4 KB.

# lvcreate -i2 -I4 -l100 -nanothertestlv testvg
        

If you want to create an LV that uses the entire VG, use vgdisplay to find the "Total PE" size, then use that when running lvcreate.

# vgdisplay testvg | grep "Total PE"
Total PE              10230
# lvcreate -l 10230 testvg -n mylv
        
This will create an LV called mylv filling the testvg VG.

If you want the logical volume to be allocated from a specific physical volume in the volume group, specify the PV or PVs at the end of the lvcreate command line.

# lvcreate -L 1500 -ntestlv testvg /dev/sdg