LVM

LVM functions by layering abstractions on top of physical storage devices. The basic layers that LVM uses, starting with the most primitive, are.

Create a volume group

pvcreate /dev/sda1 /dev/sdb1
vgcreate vol_group_name /dev/sda1 /dev/sdb1
lvcreate -l 100%FREE -n drive_name vol_group_name

View info on group

pvscan
pvdisplay
vgdisplay
lvdisplay

Mount Hidden LVM (Perfect for rescue env)

pvscan                 
vgscan                 
vgchange -ay           
lvscan    
mount /dev/VolGroup00/LogVol00 /mnt

Grow XFS/EXT4 GPT LVM

Create new partition

GDisk
n
– Create a new partition
Verify partition start
Verify partition end
8E00
– Set the partition type to Linux LVM
w
– Write the changes to disk

Refresh partition

partprobe

Set new partition as LVM

pvcreate /dev/<partitionDeviceName>

 

Extend volume group

vgextend <volumeGroupName> /dev/<partitionDeviceName>

Increase volume

lvextend -l +100%FREE /dev/<volumeGroupName>/<logicalVolumeName>

Grow XFS

xfs_grow /dev/<volumeGroupName>/<logicalVolumeName>

or

Grow EXT4

resize2fs /dev/<volumeGroupName>/<logicalVolumeName>

Other Doc:

 


Revision #6
Created 13 May 2018 05:32:19 by Dave
Updated 15 July 2019 04:49:24 by Dave