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>
${test}
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 <found path>
  • Expand the ext4 filesystem on it

Sources:

Add disk: https://tylersguides.com/guides/how-to-add-a-disk-to-lvm/ Extend FS: https://www.systutorials.com/extending-a-mounted-ext4-file-system-on-lvm-in-linux/