Introduction
Expanding an Ubuntu LVM partition after increasing a virtual disk is a common maintenance task for Linux administrators. However, many users discover that the root filesystem still reports its original size even after the virtual disk has been expanded.
You expand the virtual disk in VMware, Proxmox, Hyper-V, KVM, or your VPS provider‘s control panel, reboot the VM, run df -h, and… nothing changed.
This usually happens because Ubuntu is installed using LVM (Logical Volume Manager). Increasing the virtual disk only makes additional space available at the disk level. You still need to expand the partition, resize the LVM physical volume, extend the logical volume, and finally grow the filesystem.
If you need to expand an Ubuntu LVM partition after increasing a virtual disk, you may find that the root filesystem still reports its original size. This happens because the partition, LVM physical volume, logical volume, and filesystem must each be expanded separately.
This guide walks through the complete process we recently used while helping a customer expand their Ubuntu server.
How to Expand an Ubuntu LVM Partition After a Disk Resize
Symptoms
You increase the VM’s disk from 50 GB to 100 GB, but the server still reports approximately 50 GB available.
Typical output looks something like this:
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/ubuntu--vg-ubuntu--lv 49G 41G 5.8G 88% /
Code language: PHP (php)
Meanwhile, lsblk may show something similar:
$ lsblk
NAME SIZE TYPE MOUNTPOINT
vda 100G disk
├─vda1 1M part
├─vda2 2G part /boot
└─vda3 98G part
└─ubuntu--vg-ubuntu--lv 49G lvm /
Notice the important detail:
- The virtual disk is now 100 GB.
- The LVM logical volume is still only 49 GB.
Why This Happens
An Ubuntu LVM installation typically has four layers:
Virtual Disk
↓
Partition (vda3)
↓
LVM Physical Volume (PV)
↓
Volume Group (VG)
↓
Logical Volume (LV)
↓
Filesystem (ext4 or XFS)
Expanding the virtual disk only changes the top layer.
Each lower layer must be expanded before Linux can actually use the new space.
Step 1: Verify the Current Layout
Start by checking what you’re working with.
View disks and partitions
lsblk
Check mounted filesystem sizes
df -h
View LVM Physical Volumes
pvs
Example:
PV VG Fmt Attr PSize PFree
/dev/vda3 ubuntu-vg lvm2 a-- 98.0g 49g
View Volume Groups
vgs
Example:
VG #PV #LV VSize VFree
ubuntu-vg 1 1 98.0g 49g
Code language: CSS (css)
View Logical Volumes
lvs
Example:
LV VG Attr LSize
ubuntu-lv ubuntu-vg -wi-ao---- 49.0g
Code language: CSS (css)
These commands tell you exactly where the unused space exists.
Step 2: Expand the Partition
If the partition itself doesn’t already occupy the new disk space, you’ll need to grow it first.
Option 1: Using growpart (recommended)
If installed:
sudo growpart /dev/vda 3
This tells growpart to expand partition 3 on disk /dev/vda.
If the utility isn’t installed:
sudo apt update
sudo apt install cloud-guest-utils
Option 2: Using parted
If growpart isn’t available:
sudo parted /dev/vda
Inside parted:
print
resizepart 3 100%
quit
Code language: PHP (php)
This safely extends partition 3 to the end of the disk.
Afterward, verify:
lsblk
You should now see the partition occupying the newly expanded disk.
Step 3: Resize the LVM Physical Volume
Now tell LVM that its underlying partition has grown.
sudo pvresize /dev/vda3
Example output:
Physical volume "/dev/vda3" changed
1 physical volume(s) resized.
Code language: JavaScript (javascript)
Verify:
pvs
You should now see free space available in the Volume Group.
Step 4: Extend the Logical Volume
Now allocate the newly available space to your root logical volume.
To use all available free space:
sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
Or, on many Ubuntu systems:
sudo lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
What this command does:
lvextendgrows the logical volume.-l +100%FREEtells LVM to use all remaining free extents in the volume group.
You can also extend by a specific amount, for example:
sudo lvextend -L +20G /dev/ubuntu-vg/ubuntu-lv
Step 5: Grow the Filesystem
The logical volume is now larger, but the filesystem still needs to be expanded.
First determine the filesystem type:
df -Th
If using ext4
sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
If using XFS
sudo xfs_growfs /
Most Ubuntu server installations use ext4, while XFS is more common on some enterprise distributions.
Step 6: Verify Everything Worked
Finally, verify the new capacity.
df -h
Example:
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/ubuntu--vg-ubuntu--lv 98G 41G 53G 44% /
Code language: PHP (php)
Also verify:
lsblk
pvs
vgs
lvs
Everything should now report the expected sizes.
Troubleshooting
pvresize says there is no additional space
The partition probably wasn’t expanded successfully.
Check:
lsblk
If the partition size hasn’t changed, revisit Step 2.
growpart not found
Install it:
sudo apt install cloud-guest-utils
lvextend reports no free extents
Run:
vgs
If VFree is zero, the physical volume hasn’t been resized yet.
resize2fs says the filesystem is already the requested size
The logical volume likely wasn’t extended.
Verify:
lvs
Wrong filesystem command
Using:
resize2fs
on XFS won’t work.
Using:
xfs_growfs
on ext4 won’t work either.
Always verify first:
df -Th
Lessons Learned
The biggest takeaway is that expanding a virtual disk is only the first step.
With an LVM-based Ubuntu installation, there are multiple layers that each need to know about the additional space:
- Virtual disk
- Partition
- Physical Volume (PV)
- Volume Group (VG)
- Logical Volume (LV)
- Filesystem
If you skip any one of these layers, Linux won’t be able to use the newly allocated storage.
Taking a minute to inspect the layout with lsblk, pvs, vgs, and lvs before making changes can quickly show where the process stopped.
Final Takeaway
If your Ubuntu root partition is still full after increasing the virtual disk size, don’t assume the resize failed. In most cases, the additional capacity is already available—it just hasn’t been propagated through LVM yet.
The overall workflow is straightforward:
- Verify the current disk and LVM layout.
- Expand the partition with
growpartorparted. - Resize the LVM physical volume with
pvresize. - Extend the logical volume using
lvextend. - Grow the filesystem with
resize2fsorxfs_growfs. - Confirm the results with
df -h.
Once you understand how these layers fit together, extending an Ubuntu LVM disk becomes a quick maintenance task instead of a frustrating troubleshooting session.