Skip to main content

LVM - Add new disk and extend FS

LVM add "physical" disk and extend FS

  • Make sure there is a Partition Table and a Partition for LVM
fdisk /dev/<disk>
>> create new gpt table: g
>> create new partition: n
>> set type of partition to lvm: t 
>> show partition codes: L
>> insert type: <type from L (Linux LVM)>
>> write changes: w
  • Expand existing LVM VG
pvcreate /dev/<disk-partition>
vgextend <existing-vg> /dev/<disk-partition>
  • Expand existing LVM LV
# find the correct logical volume
lvdisplay | grep Path 

# expand found lv
lvresize -l +100%free <lv path>
  • Expand the ext4 filesystem on it
resize2fs <lv path>

Sources: