Extend LVM Volume Size

Check Disk Size

df -lh
Filesystem Size Used Avail Use% Mounted on
udev 967M 0 967M 0% /dev
tmpfs 200M 1.2M 199M 1% /run
/dev/mapper/ubuntu–vg-ubuntu–lv 3.9G 3.6G 107M 98% /
tmpfs 997M 0 997M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 997M 0 997M 0% /sys/fs/cgroup
/dev/loop0 98M 98M 0 100% /snap/docker/384
/dev/loop1 89M 89M 0 100% /snap/core/7270
/dev/sda2 976M 212M 698M 24% /boot
/dev/loop2 90M 90M 0 100% /snap/core/8039
tmpfs 200M 0 200M 0% /run/user/1000
/dev/loop3 123M 123M 0 100% /snap/docker/418

Display Volume Group

server2:~$ sudo vgdisplay
 Volume group 
VG Name ubuntu-vg
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 2
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size <79.00 GiB
PE Size 4.00 MiB
Total PE 20223
Alloc PE / Size 1024 / 4.00 GiB
Free PE / Size 19199 / <75.00 GiB
VG UUID fU0TVP-fXBW-WbfE-jJUU-mlPF-x0Oh-2VS2wm

Display Logical Volume

Extend Logical Volume

Display Volume Group again

  • It still has 4GB free

Extend it again, but this time use + to specify additional space

Display Volume Group

Resize File System

Check Disk Size again

Troubleshooting

  • If pvgroup doesn't see new space, need to extend the physical partition: growpart

  • Then rescan the physical volume: pvscan

  • Then extend logical volume: lvextend

  • Finally Resize File System: resize2fs

Last updated