Running out of disk space inside a virtual machine is a common problem. If you are using Ubuntu on VMware with LVM (Logical Volume Manager), First resize using ui at vmware increase vm whatever like you want maybe 100GB or something else and then you might notice that even after increasing the virtual disk size in VMware, your Ubuntu VM still shows the old size.
This guide is part of my broader infrastructure toolkit. See why I ditched Docker Compose for bare-metal ERP staging and how I built a $0/month blog stack from my home lab for complementary infrastructure reading.
In this guide, I’ll show you how to resize your Ubuntu VM disk safely and extend your root filesystem.
1. Check Current Disk Usage
Run the following to see your partitions and usage:
df -h
Example output before resizing:
/dev/mapper/ubuntu--vg-ubuntu--lv 490G 469G 0 100% /
2. Verify Partitions
Check the actual disk size Ubuntu sees:
lsblk
You should see something like:
sda 600G
├─sda1 1M
├─sda2 2G /boot
└─sda3 598G
└─ubuntu--vg-ubuntu--lv 498G /
Notice that the VMware disk is 600G, but the LVM volume is still 498G.
3. Resize the LVM Physical Volume
Run:
sudo pvresize /dev/sda3
This tells LVM to detect the new size of the partition.
4. Extend the Logical Volume
Now extend your root LV to use all available free space:
sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
5. Resize the Filesystem
Depending on your filesystem:
- For ext4:
sudo resize2fs /dev/ubuntu-vg/ubuntu-lv - For xfs:
sudo xfs_growfs /
6. Verify the New Size
Check again:
df -h
Example after resizing:
/dev/mapper/ubuntu--vg-ubuntu--lv 589G 469G 95G 84% /
Now your root filesystem has more free space.
Tips
- Always take a VMware snapshot or backup before resizing partitions.
- Monitor disk usage with tools like
ncduordu -sh /path/*to avoid hitting 100% again. - Consider setting up alerts (e.g., with
netdata,prometheus-node-exporter, ormonit) to warn you when your disk is almost full.
✅ That’s it! You’ve successfully resized your Ubuntu VM disk on VMware.
Discover more from Susiloharjo
Subscribe to get the latest posts sent to your email.