When a logical volume (LV) on Linux runs low on space, lvextend pulls free extents from the volume group (VG) and attaches them to the LV. That is only half the job: the filesystem inside the LV must grow too, or df will still show the old size. This guide walks through pre-checks, every lvextend size style we use in production, filesystem growth for ext4 and XFS, post-checks, and the cases that trip people up when the VG is already full.
The commands below are the same ones we have used on test systems; terminal output is shown in text fences so you can compare your host line by line.
Tested on: Ubuntu with LVM2 (
lvm2package);lvextendandresize2fs1.45.x-era output.
Before you extend: pre-checks
Run these checks before you change anything. They take a minute and prevent resizing the wrong LV.
Confirm the LV path and current size
List logical volumes with lvs or lvdisplay. Note the VG/LV name and LSize:
lvsLV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
lvol vol_grp -wi-a----- 48.00m
lvol0 vol_grp -wi-a----- 20.00m
lvol1 vol_grp -wi-a----- 60.00m
lvol2 vol_grp -wi-a----- 52.00mDevice paths look like /dev/vol_grp/lvol1 or /dev/mapper/vol_grp-lvol1.
Confirm free space in the volume group
lvextend only reallocates extents that are already free in the VG. Check with vgs or vgdisplay:
vgsVG #PV #LV #SN Attr VSize VFree
vol_grp 1 4 0 wz--n- 508.00m 356.00mVFree must cover the growth you plan. If it is 0, see When the volume group has no free space before running lvextend.
Note the filesystem type and mount point
The grow tool depends on the filesystem:
| Filesystem | Grow command | Typical target |
|---|---|---|
| ext2, ext3, ext4 | resize2fs |
LV device (/dev/vol_grp/lvol1) |
| XFS | xfs_growfs |
Mount point (/data), not the raw device |
| Btrfs on LVM | btrfs filesystem resize |
Mount point |
Use df -Th or lsblk -f on the mount point you care about.
Snapshot and backup
You need root (or sudo). For a deeper LVM refresher, see Understand LVM Architecture and Manage Logical Volume in Linux.
Things to consider
- Live expansion. You do not need to reboot or drop to rescue mode to extend a data LV, and many root LVs grow online as well. The filesystem must be grown after
lvextendunless you use-r(see the hint below). - LV size ≠ usable disk space.
lvextendchanges the block device size. Untilresize2fs,xfs_growfs, or the Btrfs resize command runs, applications anddfstill see the old filesystem size. +means add; no+means set total size.lvextend -L +48Madds 48 MiB.lvextend -L 100Msets the LV to 100 MiB total (must be larger than now). The same rule applies to-lextents.- Mounted vs unmounted. ext4 and XFS usually support online grow on mounted filesystems. If
resize2fsasks fore2fsck -ffirst, run the check, then resize—see the workflow section. - Shrinking is a different guide. This article only covers grow. To reduce an LV safely, see shrink an LVM logical volume.
lvextend -r (or --resizefs) can extend the LV and grow a supported filesystem in one step on many systems. The examples below use explicit resize2fs / xfs_growfs so you can see each stage; try -r on a test LV if you want a shorter path.
lvextend command syntax
Basic form:
lvextend option LV_pathExamples use VG vol_grp and paths like /dev/vol_grp/lvol. Replace with your vgs / lvs names.
If lvs shows nothing, create an LV first with lvcreate command examples.
Size options at a glance
| Goal | Example | Meaning |
|---|---|---|
| Add megabytes | lvextend -L +48M /dev/vol_grp/lvol |
Increase LV by 48 MiB |
| Set megabytes | lvextend -L 100M /dev/vol_grp/lvol2 |
Set LV size to 100 MiB total |
| Add extents | lvextend -l +10 /dev/vol_grp/lvol0 |
Add 10 physical extents |
| Add % of VG | lvextend -l +10%VG /dev/vol_grp/lvol0 |
Add 10% of total VG size (rounded to extents) |
| Use all free VG space | lvextend -l +100%FREE /dev/vol_grp/lvol1 |
Consume remaining VFree |
lvextend examples by size type
1. Extend by megabytes (-L)
With a leading +, the size is added to the current LV:
lvextend -L +48M /dev/vol_grp/lvolSample Output:
Size of logical volume vol_grp/lvol changed from 48.00 MiB (12 extents) to 96.00 MiB (24 extents).
Logical volume vol_grp/lvol successfully resized.Without +, the value is the new absolute size (must exceed the current size):
lvextend -L 100M /dev/vol_grp/lvol2Sample Output:
Size of logical volume vol_grp/lvol2 changed from 52.00 MiB (13 extents) to 100.00 MiB (25 extents).
Logical volume vol_grp/lvol2 successfully resized.2. Extend by logical extents (-l)
Add a fixed number of extents:
lvextend -l +10 /dev/vol_grp/lvol0OR
lvextend --extents +10 /dev/vol_grp/lvol0Size of logical volume vol_grp/lvol0 changed from 20.00 MiB (5 extents) to 60.00 MiB (15 extents).
Logical volume vol_grp/lvol0 successfully resized.Without +, the extent count becomes the new total size of the LV.
3. Extend by percentage of the volume group (%VG)
+10%VG adds 10% of the VG total size, rounded up to whole extents:
lvextend -l +10%VG /dev/vol_grp/lvol0Sample Output:
Size of logical volume vol_grp/lvol0 changed from 60.00 MiB (15 extents) to 110.80 MiB (28 extents).
Logical volume vol_grp/lvol0 successfully resized.4. Use all remaining free space (%FREE)
This consumes every free extent in the VG:
lvextend -l +100%FREE /dev/vol_grp/lvol1Sample Output:
Size of logical volume vol_grp/lvol1 changed from 60.00 MiB (15 extents) to 384.00 MiB (96 extents).
Logical volume vol_grp/lvol1 successfully resized.Afterward vgs should show little or no VFree:
vgs vol_grpSample Output:
VG #PV #LV #SN Attr VSize VFree
vol_grp 1 4 0 wz--n- 508.00m 0Grow the filesystem after lvextend
Pick the tool that matches your filesystem.
ext2, ext3, or ext4: resize2fs
Run against the LV device (mounted grow is normal for ext4):
resize2fs /dev/vol_grp/lvol1If you see:
resize2fs 1.45.5 (07-Jan-2020)
Please run 'e2fsck -f /dev/vol_grp/lvol1' first.Run a forced check, then resize again:
e2fsck -f /dev/vol_grp/lvol1
resize2fs /dev/vol_grp/lvol1Successful grow looks like:
resize2fs 1.45.5 (07-Jan-2020)
Resizing the filesystem on /dev/vol_grp/lvol1 to 51200 (4k) blocks.
The filesystem on /dev/vol_grp/lvol1 is now 51200 (4k) blocks long.XFS: xfs_growfs
XFS must be mounted. Pass the mount point, not the device:
xfs_growfs /mount/pointYou should see metadata and data sections grow in the command output. Then confirm with df -h /mount/point.
End-to-end workflow: extend an LV safely
This is the full sequence: check space, extend the LV, grow ext4, verify. The example grows lvol1 from 60 MiB to 200 MiB on vol_grp.
Step 1: Check LV and VG size
lvs vol_grp/lvol1Sample Output:
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
lvol1 vol_grp -wi-a----- 60.00mvgsSample Output:
VG #PV #LV #SN Attr VSize VFree
vol_grp 1 4 0 wz--n- 508.00m 328.00mVSize is total VG capacity; VFree is what lvextend can use. Here lvol1 is 60 MiB and 328 MiB is free—enough for a grow to 200 MiB.
Step 2: Extend the logical volume
lvextend -L 200M /dev/vol_grp/lvol1Sample Output:
Size of logical volume vol_grp/lvol1 changed from 60.00 MiB (15 extents) to 200.00 MiB (50 extents).
Logical volume vol_grp/lvol1 successfully resized.Step 3: Grow the ext4 filesystem
resize2fs /dev/vol_grp/lvol1If resize2fs demands e2fsck -f, run the check shown in the previous section, then rerun resize2fs.
Step 4: Mount (if needed) and confirm
If the LV was unmounted for maintenance, mount it again:
mount /dev/vol_grp/lvol1 /test
df -h /testSample Output:
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vol_grp-lvol1 193M 52K 183M 1% /testdf may show slightly less than 200 MiB because of filesystem overhead and reserved blocks—that is expected on ext4.
Post-check: verify LV and filesystem size
After any extension, confirm both layers grew:
lvs /dev/vol_grp/lvol1
df -h /path/to/mountSample Output:
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
lvol1 vol_grp -wi-a----- 200.00mlvs→ LV block device size (should match what you set withlvextend).df→ filesystem size visible to users (should be close; XFS and ext4 reserve differ slightly).
If lvs grew but df did not, you skipped the filesystem grow step.
When the volume group has no free space
lvextend cannot invent extents. Options:
- Add disk space to the VG — partition a new disk,
pvcreate, thenvgextend vol_grp /dev/sdXN. See check disk and partition space and vgcreate / LVM setup. - Grow an existing PV — if the underlying partition was enlarged,
pvresize /dev/sdX1first, then checkvgsfor newVFree. - Free space from another LV — shrink or remove a non-critical LV (LVM shrink guide), then extend the target LV.
Only after VFree is non-zero should you rerun lvextend.
Troubleshooting
| Symptom | Likely cause | What to do |
|---|---|---|
Insufficient free space |
VFree too small |
vgs; add PV/vgextend or free space from another LV |
df unchanged after lvextend |
Filesystem not grown | Run resize2fs or xfs_growfs (or lvextend -r) |
resize2fs wants e2fsck -f |
ext filesystem metadata | Run e2fsck -f on the LV, then resize2fs again |
| Wrong LV resized | Typo in path | Always double-check lvs before lvextend |
xfs_growfs fails |
Unmounted XFS or wrong path | Mount XFS; pass mount point to xfs_growfs |
| New size smaller than current | Used -L 100M without + by mistake |
Use -L +100M to add, or -L with a total larger than lvs shows |
Related guides
Manage Logical Volume in Linux
10+ lvcreate command examples
10+ lvchange command examples
Rename a logical volume
Resize root LVM on RHEL/CentOS
Create LVM during installation
References
- lvextend man page (Linux Die.net)
- resize2fs man page
- xfs_growfs man page
Summary
Extending an LVM logical volume is a two-layer job: grow the LV with lvextend, then grow the filesystem so df matches. Before you run anything, confirm the LV path, filesystem type, and VFree in vgs. Use -L +size or -l +extents to add space, or -l +100%FREE to spend every free extent in the VG. For ext4, resize2fs on the LV device is the usual follow-up; for XFS, use xfs_growfs on the mount point. If the VG is full, add or resize a physical volume before you call lvextend again. Afterward, compare lvs and df—if only lvs changed, you still owe the filesystem one command.
