LVM: Grow a Filesystem Online, Safely
Introduction¶
"The disk is full" on an LVM system is usually a five-minute online fix. The confusion is the layers: filesystem on a logical volume, on a volume group, on physical volumes, on partitions, on disks. You extend from the bottom up.
The model¶
filesystem (ext4/xfs)
└── LV /dev/vg0/lv_data (lvextend)
└── VG vg0 (needs free extents, from...)
└── PV /dev/sda3 (pvresize, after growing...)
└── partition /dev/sda3 (growpart / parted)
└── disk /dev/sda (resize in the hypervisor/SAN)
Check where you actually are:
lsblk -f
df -h /data
sudo vgs # VFree column — is there unused space in the VG?
sudo pvs
sudo lvs -o +devices
Case 1: the VG already has free space¶
Easiest. Just extend the LV and the filesystem:
# Add 20G to the LV
sudo lvextend -L +20G /dev/vg0/lv_data
# Grow the filesystem to fill it — the -r flag on lvextend does this for you:
sudo lvextend -r -L +20G /dev/vg0/lv_data # -r = resize FS too (ext4 or xfs)
Or grow the filesystem manually:
sudo resize2fs /dev/vg0/lv_data # ext4 — online grow is fine
sudo xfs_growfs /data # XFS — takes the MOUNT POINT, not the device
XFS can only grow, never shrink. ext4 can shrink but only offline.
Case 2: the VG is full — add space to a PV¶
The underlying disk grew (you enlarged a cloud volume, expanded a VMDK, or the SAN LUN got bigger). Now grow up the stack.
# 1. Make the kernel see the new disk size (no reboot)
echo 1 | sudo tee /sys/class/block/sda/device/rescan
lsblk # /dev/sda should now show the new size
# 2. Grow the partition
sudo growpart /dev/sda 3 # from cloud-utils; or use parted resizepart
# 3. Grow the PV to fill the bigger partition
sudo pvresize /dev/sda3
sudo vgs # VFree should now show the new space
# 4. Extend LV + FS (as Case 1)
sudo lvextend -r -l +100%FREE /dev/vg0/lv_data
-l +100%FREE uses all remaining VG space.
Case 3: add a whole new disk¶
sudo pvcreate /dev/sdb
sudo vgextend vg0 /dev/sdb
sudo lvextend -r -l +100%FREE /dev/vg0/lv_data
Verification¶
df -h /data # new size reflected
lsblk -f
sudo lvs
Troubleshooting¶
growpart: NOCHANGE: partition 3 is size ... it cannot be grown— the kernel doesn't see the bigger disk yet. Re-run the/sys/.../rescan(orpartprobe, or for some setupsecho 1 > /sys/class/scsi_device/*/device/rescan).pvresizesays the PV is already the right size butvgsVFree is 0 — the partition wasn't grown; dogrowpartfirst.lvextendOK,dfunchanged — you extended the LV but not the filesystem. Runresize2fs/xfs_growfs, or uselvextend -rnext time.xfs_growfs: /dev/vg0/lv_data is not a mounted XFS filesystem—xfs_growfstakes the mount point (/data), not the device.resize2fs: New size ... smaller than minimum— you're trying to shrink; ext4 shrink is offline only (umount,e2fsck -f,resize2fs, thenlvreduce). Never shrink XFS.- "Insufficient free space" on
lvextend— the VG doesn't have that many free extents.vgsforVFree, then Case ⅔. - Root filesystem is on LVM and full — the same steps work online for
/on modern kernels; no rescue media needed for a grow (shrink is different). - Boot/EFI partition full (not LVM) — that's a plain partition; LVM doesn't
help. Clean old kernels (
dnf remove --oldinstallonly/apt autoremove).
Related tools and reading¶
- On-site: Subnet Calculator, Linux commands reference.
- Related posts: Disk full but df says otherwise, The Linux boot process, explained.
Stuck on something this site can't fix?Reach out to Prabath directly on LinkedIn.More in Linux & Sysadmin
resolv.conf and systemd-resolved
On modern distros /etc/resolv.conf points at a stub resolver managed by systemd-resolved. Editing it directly usually does nothing — here's the real model.
October 24, 2026Tuning Open File Limits on Linux
Four different limits control how many files a process can open. 'Too many open files' means you're hitting one specific one — here's how to find and raise it.
October 24, 2026ss and conntrack for Connection Debugging
ss shows you every socket and its send/receive queues; conntrack shows what the firewall is tracking. Together they explain most 'connection refused' and 'no buffer space' problems.
October 24, 2026