General Information
Working with logical volumes.
Parition that is prepared for type LVM (8e00)
gdisk /dev/sdb n Partition number: 1 First sector: default Last sector: +30G Hex code type: 8e00 w
Create physical volume
pvcreate /dev/sdb1
Summary of physical volumes
pvs
Full display of physical volumes
pvdisplay
Assign physical volume to new volume group
vgcreate vglocal /dev/sdb1
Assign physical volume to existing volume group
vgextend vglocal /dev/sdb1
Summary of volume groups
vgs
Full display of volume groups
vgdisplay
Create logical volume
lvcreate --name lvhome --size 30G vglocal
Summary of logical volumes
lvs
Full display of logical volumes
vgdisplay
Create filesystem and mount logical volume
mkfs -t xfs /dev/mapper/vglocal-lvhome mount /dev/mapper/vglocal-lvhome /home
Delete logical volume
lvremove /dev/mapper/vglocal-lvhome
Remove a physical volume (/dev/sdb1) from a volume group (vglocal)
vgreduce vglocal /dev/sdb1
Delete volume group
vgremove vglocal
Remove physical volume
pvremove /dev/sdb1