Server

LVM: Grow a Filesystem Online, Safely

By Prabath Thalangama· October 24, 2026· 3 min read
#linux#lvm#storage#troubleshooting

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 (or partprobe, or for some setups echo 1 > /sys/class/scsi_device/*/device/rescan).
  • pvresize says the PV is already the right size but vgs VFree is 0 — the partition wasn't grown; do growpart first.
  • lvextend OK, df unchanged — you extended the LV but not the filesystem. Run resize2fs/xfs_growfs, or use lvextend -r next time.
  • xfs_growfs: /dev/vg0/lv_data is not a mounted XFS filesystem — xfs_growfs takes 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, then lvreduce). Never shrink XFS.
  • "Insufficient free space" on lvextend — the VG doesn't have that many free extents. vgs for VFree, 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).
PrabathStuck on something this site can't fix?Reach out to Prabath directly on LinkedIn.