Extend Ubuntu Root Partition After Installation (Ubuntu 22.04 & 24.04)

If you missed allocating 100% of your hard disk while installing Ubuntu, don’t worry—it’s a common mistake. Many users unintentionally assign limited space to the root (/) partition, leaving the rest of the disk unused.

This step-by-step guide will help you extend your Ubuntu root partition using LVM (Logical Volume Management), tested on Ubuntu 22.04 and 24.04 systems.


🔍 How to Know You’re Affected

Run:

df -h

If your root partition shows only a portion of the total disk, like:

/dev/mapper/ubuntu--vg-ubuntu--lv   98G   73G   21G  /

And lsblk shows much more available:

sda                         238.5G  
└─sda3 236.5G
└─ubuntu--vg-ubuntu--lv 100G /

Then you have unallocated space.


✅ How to Extend Ubuntu Root Partition (LVM)

1. Check Free Space in Volume Group

sudo vgdisplay

Find: Free PE / Size → Should show unused space.

2. Extend Logical Volume

sudo lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv

3. Resize the Filesystem

sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv

(Use xfs_growfs, if using XFS.)

4. Verify with:

df -h

Your root (/) should now reflect full disk usage.


🧠 Summary

You’ve now fully utilized your disk space without reinstalling. This is a must-know for developers or sysadmins using LVM.


📌 Related Reading

Scroll to Top