lvextend — quick reference
Pre-checks
| When to use | Command |
|---|---|
| List logical volumes and sizes | sudo lvs |
| Check free extents in the volume group | sudo vgs |
| Show one LV in detail | sudo lvdisplay VG/LV |
| See filesystem type and mount point | df -Th or lsblk -f |
Extend by size (-L)
| When to use | Command |
|---|---|
| Add megabytes to current LV size | sudo lvextend -L +48M /dev/VG/LV |
| Set new absolute LV size | sudo lvextend -L 200M /dev/VG/LV |
| Add gigabytes | sudo lvextend -L +10G /dev/VG/LV |
Extend by extents (-l)
| When to use | Command |
|---|---|
| Add a fixed number of extents | sudo lvextend -l +10 /dev/VG/LV |
| Add percentage of total VG size | sudo lvextend -l +10%VG /dev/VG/LV |
| Consume all free VG space | sudo lvextend -l +100%FREE /dev/VG/LV |
Grow filesystem
| When to use | Command |
|---|---|
| Grow ext4 on the LV device (mounted OK) | sudo resize2fs /dev/VG/LV |
| Grow XFS on the mount point | sudo xfs_growfs /mount/point |
| Try LV + FS in one step (may need helper package) | sudo lvextend -r -L +size /dev/VG/LV |
Help
| When to use | Command |
|---|---|
| Show built-in usage | lvextend --help |
| Same operation via lvresize | sudo lvresize -L +48M /dev/VG/LV |
lvextend — command syntax
Synopsis from lvextend --help on Ubuntu 25.04 (LVM 2.03.27):
lvextend -L|--size [+]Size[m|UNIT] LV
[ -l|--extents [+]Number[PERCENT] ]
[ -r|--resizefs ]
[ COMMON_OPTIONS ]
[ PV ... ]lvextend only grows the LV block device. + means add (-L +48M); no + sets total size (-L 200M). After lvextend, grow ext4 with resize2fs on the device or XFS with xfs_growfs on the mount point unless -r succeeds on your host. Needs sudo. The examples below use a practice volume group on loop-backed storage.
lvextend — command examples
Essential Build a practice VG and ext4 LV for extend tests
The examples below use a practice volume group on loop-backed storage. Extend data volumes on spare disks first; plan carefully before growing a root logical volume.
Run the commands:
mkdir -p /tmp/lvm-extend-lab/mnt
dd if=/dev/zero of=/tmp/lvm-extend-lab/disk.img bs=1M count=512 status=none
LOOP=$(sudo losetup -f --show /tmp/lvm-extend-lab/disk.img)
sudo pvcreate "$LOOP"
sudo vgcreate lab_vg "$LOOP"
sudo lvcreate -L 48M -n lab_lv lab_vg
sudo mkfs.ext4 -F /dev/lab_vg/lab_lv
sudo mount /dev/lab_vg/lab_lv /tmp/lvm-extend-lab/mnt
sudo lvs lab_vg
sudo vgs lab_vgSample output:
LV VG Attr LSize
lab_lv lab_vg -wi-ao---- 48.00m
VG #PV #LV #SN Attr VSize VFree
lab_vg 1 1 0 wz--n- 508.00m 460.00mTeardown later: sudo umount /tmp/lvm-extend-lab/mnt, sudo lvremove -y lab_vg/lab_lv, sudo vgremove lab_vg, sudo pvremove "$LOOP", sudo losetup -d "$LOOP", rm -rf /tmp/lvm-extend-lab.
Essential Add 48M with lvextend, then grow ext4 online
This is the standard two-step grow: LV first, filesystem second.
Run the commands:
Check mount-point usage and filesystem types with df; the df and du covers -h, -T, and filtering pseudo-filesystems.
sudo lvextend -L +48M /dev/lab_vg/lab_lv
sudo resize2fs /dev/lab_vg/lab_lv
df -h /tmp/lvm-extend-lab/mnt
sudo lvs lab_vg/lab_lvSample output:
Size of logical volume lab_vg/lab_lv changed from 48.00 MiB (12 extents) to 96.00 MiB (24 extents).
Logical volume lab_vg/lab_lv successfully resized.
The filesystem on /dev/lab_vg/lab_lv is now 24576 (4k) blocks long.
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/lab_vg-lab_lv 89M 156K 86M 1% /tmp/lvm-extend-lab/mnt
LV VG Attr LSize
lab_lv lab_vg -wi-ao---- 96.00mdf may show slightly less than the LV size because of ext4 metadata and reserved blocks.
Common Set absolute LV size with -L (no plus)
Use absolute -L 200M when you want the LV exactly that large, not “add 200M”.
Run the commands:
sudo lvextend -L 200M /dev/lab_vg/lab_lv
sudo resize2fs /dev/lab_vg/lab_lv
sudo lvs lab_vg/lab_lvThe new size must be larger than lvs shows now. If you pick a smaller number, LVM refuses the operation.
Common Extend by extents and by %VG
Extents match how LVM allocates physical chunks inside the VG.
Run the commands:
sudo lvextend -l +10 /dev/lab_vg/lab_lv
sudo lvextend -l +10%VG /dev/lab_vg/lab_lv
sudo lvs lab_vg/lab_lvSample output:
Size of logical volume lab_vg/lab_lv changed from 96.00 MiB (24 extents) to 136.00 MiB (34 extents).
Logical volume lab_vg/lab_lv successfully resized.Run resize2fs after each grow if you need the filesystem to follow immediately.
Common Use every free extent with +100%FREE
This drains VFree in the VG into one LV — common when a data volume should absorb leftover space.
Run the commands:
sudo lvextend -l +100%FREE /dev/lab_vg/lab_lv
sudo vgs lab_vg
sudo resize2fs /dev/lab_vg/lab_lvSample output:
Size of logical volume lab_vg/lab_lv changed from 136.00 MiB (34 extents) to 508.00 MiB (127 extents).
VG #PV #LV #SN Attr VSize VFree
lab_vg 1 1 0 wz--n- 508.00m 0Afterward VFree should be 0 (or nearly zero).
Common Error when the volume group has no room
lvextend cannot invent space — it only reallocates free extents already in the VG.
Run the commands:
dd if=/dev/zero of=/tmp/lvm-extend-lab/small.img bs=1M count=64 status=none
LOOP2=$(sudo losetup -f --show /tmp/lvm-extend-lab/small.img)
sudo pvcreate "$LOOP2" && sudo vgcreate tiny_vg "$LOOP2"
sudo lvcreate -L 50M -n tiny_lv tiny_vg
sudo lvextend -L +20M /dev/tiny_vg/tiny_lvSample output:
Insufficient free space: 5 extents needed, but only 2 availableFix by adding a disk (pvcreate, vgextend), growing the PV (pvresize), or freeing space from another LV.
Advanced lvextend -r — one-step FS grow (helper may be missing)
-r / --resizefs asks LVM to grow a supported filesystem after extending the LV. On Ubuntu 25.04 the helper may be absent.
Run the commands:
sudo lvextend -r -L +16M /dev/lab_vg/lab_lvIf you see lvresize_fs_helper: execvp failed, the LV still grew — run sudo resize2fs /dev/lab_vg/lab_lv manually. Prefer the explicit two-step path in production scripts.
Advanced Check free space before extending a volume group
Listing LVs and VGs does not change sizes — safe on live systems before you plan a grow window.
Run the commands:
sudo lvs
sudo vgs
sudo pvsSample output:
LV VG Attr LSize
ubuntu-lv ubuntu-vg -wi-ao---- 58.41g
VG #PV #LV #SN Attr VSize VFree
ubuntu-vg 2 1 0 wz--n- 58.41g 0If VFree is 0, extend the VG before lvextend.
lvextend — when to use / when not
| Use lvextend when | Use something else when |
|---|---|
|
|
lvextend vs lvresize
| lvextend | lvresize | |
|---|---|---|
| Direction | Grow only | Grow or shrink |
| Mental model | “Add space to this LV” | Generic resize to a target |
| Typical follow-up | resize2fs / xfs_growfs |
Same for grow; shrink needs FS first on ext4 |
lvextend is shorthand for growing with lvresize -L +size.
Related commands
| Command | One line |
|---|---|
| lvextend | Grow a logical volume (this page) |
| lvcreate | Create a new logical volume |
| vgcreate | Create a volume group |
| Manage logical volumes | Full LVM workflow guide |
Browse the full index in our Linux commands reference.
lvextend — interview corner
Do you need to reboot after lvextend?
No for a typical online grow. lvextend changes the LV in place. ext4 and XFS usually grow while mounted.
You still must grow the filesystem (resize2fs, xfs_growfs, or working -r) or df stays at the old size. Reboot is not the mechanism that applies the extra space.
A strong answer is:
"No reboot for a normal online grow — lvextend extends the LV live; I still run resize2fs or xfs_growfs so df matches."
What is the difference between lvextend -L +100M and -L 100M?
-L +100M adds 100 MiB to the current LV size.
-L 100M sets the LV to exactly 100 MiB total, which must be greater than the present size.
The same rule applies to -l extents: +10 adds ten extents; -l 10 sets total extent count.
A strong answer is:
"Plus means add to current size; without plus sets absolute total — both must end larger than lvs shows now."
Why does df show the old size after lvextend succeeds?
lvextend grows the block device (/dev/VG/LV). The filesystem inside still occupies the old length until you expand it.
Run resize2fs /dev/VG/LV for ext2/3/4, or xfs_growfs /mount/point for XFS. Then compare lvs and df.
A strong answer is:
"lvextend only grows the LV — the filesystem needs resize2fs or xfs_growfs; if lvs grew but df didn't, I skipped that step."
What if the volume group has no free space?
lvextend only moves existing free extents in the VG. It cannot create space.
Options: add a disk (pvcreate, vgextend), grow an underlying partition and pvresize, or shrink/remove another LV to free extents.
A strong answer is:
"Check vgs VFree — if zero, add or resize a PV or free space from another LV; lvextend won't help until VFree is non-zero."
Can you extend a mounted logical volume?
Yes for grow operations on ext4 and XFS in normal use: extend the LV, then grow the filesystem on the mounted device or mount point.
Always confirm the LV path with lvs and take a backup or snapshot before production changes.
A strong answer is:
"Yes for online grow on ext4/XFS — lvextend then resize2fs on the device or xfs_growfs on the mount point, after verifying VFree and the LV name."
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
Insufficient free space |
VFree too small |
vgs; vgextend / pvresize / shrink another LV |
df unchanged |
Filesystem not grown | resize2fs or xfs_growfs after lvextend |
resize2fs wants e2fsck -f |
ext metadata | sudo e2fsck -f /dev/VG/LV, then resize2fs |
| Wrong LV grew | Typo in path | Double-check lvs before every lvextend |
xfs_growfs fails |
Unmounted XFS or wrong argument | Mount XFS; pass mount point not raw device |
-r helper failed |
Missing lvresize_fs_helper |
LV may still be extended — run resize2fs manually |
| New size smaller than current | Used -L 100M without + by mistake |
Use -L +100M to add, or pick a larger absolute size |
