Expanding disk space on Ubuntu virtual machine (provided by VMWare)
๐Ÿ’พ

Expanding disk space on Ubuntu virtual machine (provided by VMWare)

Tags
LVM
Ubuntu
VMWare
Published
August 15, 2023
Author
plazmius.dev
We deployed a small Docker Swarm cluster over 4 VMs the other day. Eventually, the space for our frontend VM was depleted and we could not deploy new versions of our docker container. We asked our DevOps to increase the disk space, and he did, yet the system keeps showing us the same free\unallocated disk space as before.
The following script helped a lot, it is easier to follow than most I have seen while I kept searching. Keep in mind that your device may differ (in our case, sda3)
parted /dev/sda print # Check you have exactly three partitions parted /dev/sda resizepart 3 100% # Extend the third parted /dev/sda print # Confirm the new partition size pvresize /dev/sda3 lvextend --size +10g --resizefs /dev/ubuntu-vg/ubuntu-lv
Visualizing this helped me to better understand LVM concept:
notion image
Credits to this answer:
Also, great article explaining LVM: