Once your LVM infrastructure is in place, day-to-day management means growing LVs as filesystems fill, moving data between physical disks, extending volume groups with new storage, and occasionally reducing volumes when storage needs change. Most of these operations happen online — no downtime required.
This page covers the operations you will use
most frequently: lvextend, lvreduce,
lvresize, vgextend, pvmove,
and the filesystem resize commands that must accompany LV changes.
Growing an LV is the most common LVM operation — always online, always safe:
# Extend by an additional amount sudo lvextend -L +50G /dev/vg_data/lv_home # Extend to a specific total size sudo lvextend -L 300G /dev/vg_data/lv_home # Extend using all remaining free space in the VG sudo lvextend -l +100%FREE /dev/vg_data/lv_home # Extend AND resize the filesystem in one command (-r flag) sudo lvextend -L +50G -r /dev/vg_data/lv_home # Verify sudo lvs /dev/vg_data/lv_home df -h /home
lvextend -r
extends the LV AND automatically resizes the filesystem in a single
command — it detects whether the filesystem is ext4 or XFS and runs
the appropriate resize tool. Use it and skip the separate
resize2fs / xfs_growfs step.
sudo vgs shows VFree — how much space is available
in the VG to extend into. You cannot extend an LV beyond the
VG's free space without first adding a new PV.
If you extended without -r, resize the filesystem manually.
The method depends on the filesystem type:
### ext4 — resize2fs (works mounted or unmounted) ### # Extend the LV first sudo lvextend -L +100G /dev/vg_data/lv_home # Resize ext4 to fill the LV (no size needed — fills automatically) sudo resize2fs /dev/vg_data/lv_home # Verify df -h /home ### XFS — xfs_growfs (must be mounted) ### # Extend the LV first sudo lvextend -L +100G /dev/vg_data/lv_var # Grow XFS filesystem — use the mount point, not the device sudo xfs_growfs /var # Verify df -h /var
resize2fs takes
the device path and works whether mounted or not.
xfs_growfs takes the mount point and requires
the filesystem to be mounted. XFS cannot be shrunk — only grown.
ext4 can be shrunk but requires unmounting first.
Shrinking an LV is more dangerous than extending — the filesystem must be shrunk first, then the LV. Only ext4 supports shrinking; XFS cannot be reduced:
### ext4 ONLY — XFS cannot be shrunk ### # Step 1: Unmount the filesystem sudo umount /home # Step 2: Check filesystem integrity first sudo e2fsck -f /dev/vg_data/lv_home # Step 3: Shrink the filesystem FIRST (before the LV) sudo resize2fs /dev/vg_data/lv_home 80G # Step 4: Shrink the LV to match sudo lvreduce -L 80G /dev/vg_data/lv_home # Step 5: Remount sudo mount /dev/vg_data/lv_home /home # Step 6: Verify df -h /home
lvresize is the general-purpose command that can both
grow and shrink. Use lvresize -r -L 80G /dev/vg_data/lv_home
and the -r flag handles filesystem resize automatically —
but it still requires unmounting for shrink operations.
When a VG runs low on free space, add a new physical disk to it:
# Step 1: Confirm the VG is running low sudo vgs # VFree is small — time to add storage # Step 2: Initialize the new disk as a PV sudo pvcreate /dev/sde # Step 3: Add it to the existing VG sudo vgextend vg_data /dev/sde # Step 4: Verify VG now has more free space sudo vgs sudo pvs # shows new PV is now part of vg_data # Step 5: Now extend LVs as needed sudo lvextend -L +200G -r /dev/vg_data/lv_homevgs before and after vgextend:
pvmove migrates data off a physical volume onto other PVs
in the same VG — online, while the filesystem is mounted and in use.
Essential for replacing a failing disk without downtime:
# Move ALL data off /dev/sdb to other PVs in the VG sudo pvmove /dev/sdb # Move data from one specific PV to another specific PV sudo pvmove /dev/sdb /dev/sde # Move data from a specific LV on a PV sudo pvmove -n lv_home /dev/sdb # Run in background (large volumes take time) sudo pvmove -b /dev/sdb # Monitor progress of a background pvmove sudo lvs -a | grep pvmove sudo watch -n5 'sudo pvs' # After pvmove completes — remove the PV from the VG sudo vgreduce vg_data /dev/sdb # Remove the PV label (disk is now free) sudo pvremove /dev/sdbpvmove progress output:
vgextend it into the VG, then pvmove data off
the failing disk, then vgreduce and pvremove
the bad disk. Zero downtime, zero data loss.
Renaming LVM objects — useful when server roles change or naming conventions need to be corrected:
# Rename a Logical Volume sudo lvrename vg_data lv_home lv_users # Or specify full paths sudo lvrename /dev/vg_data/lv_home /dev/vg_data/lv_users # Rename a Volume Group sudo vgrename vg_data vg_production # After renaming VG — update /etc/fstab entries sudo vi /etc/fstab # Change /dev/vg_data/... to /dev/vg_production/... # Verify new names sudo vgs sudo lvs
/etc/fstab still references
the old name, the next reboot will fail to mount those filesystems.
Update fstab immediately after renaming and test with
sudo mount -a.
Regular health checks to catch problems before they become outages:
# Quick overall status sudo pvs && sudo vgs && sudo lvs # Check for any partial or failed LVs sudo lvs -a | grep -v "-wi-ao" # Detailed attribute flags — look for anything not 'a' (active) sudo lvs -o name,vgname,attr,size,pool_lv # Check PV for missing or duplicate UUIDs sudo pvscan # Check VG consistency sudo vgck vg_data # Scan all block devices for LVM metadata sudo lvscan # Backup LVM metadata (do this regularly) sudo vgcfgbackup vg_data # Saved to /etc/lvm/backup/vg_data # List metadata backups ls -la /etc/lvm/backup/ ls -la /etc/lvm/archive/
/etc/lvm/archive/. You can restore a VG from these
backups with vgcfgrestore if metadata is corrupted.
Keep these files safe.
When a PV disk fails and the VG is in a degraded state:
# VG shows as partial — a PV is missing sudo vgs # Attr shows 'p' (partial) instead of normal # Activate VG in partial mode (access surviving LVs) sudo vgchange -a y --partial vg_data # Identify which PV is missing sudo pvs # Missing PV shows as [unknown] # If replacement disk is available — add it sudo pvcreate /dev/sdf sudo vgextend vg_data /dev/sdf # Remove the missing PV record from the VG sudo vgreduce --removemissing vg_data # If VG metadata backup exists — restore sudo vgcfgrestore -f /etc/lvm/archive/vg_data_00001.vg vg_data # Check filesystem integrity after recovery sudo e2fsck -f /dev/vg_data/lv_home
| Command | What it does |
|---|---|
| lvextend -L +50G -r /dev/vg/lv | Extend LV by 50G and resize filesystem |
| lvextend -l +100%FREE -r /dev/vg/lv | Use all remaining VG space |
| lvreduce -L 80G /dev/vg/lv | Shrink LV to 80G (filesystem first!) |
| lvresize -r -L 200G /dev/vg/lv | Resize LV and filesystem to 200G |
| resize2fs /dev/vg/lv | Grow ext4 to fill LV |
| xfs_growfs /mountpoint | Grow XFS to fill LV (mounted) |
| vgextend vgname /dev/sdX | Add new PV to existing VG |
| vgreduce vgname /dev/sdX | Remove a PV from a VG |
| pvmove /dev/sdX | Move all data off a PV |
| pvmove -b /dev/sdX | Move data in background |
| lvrename vg oldlv newlv | Rename a Logical Volume |
| vgrename oldvg newvg | Rename a Volume Group |
| vgcfgbackup vgname | Backup VG metadata manually |
| vgcfgrestore vgname | Restore VG from metadata backup |
| vgchange -a y --partial vg | Activate partial VG after disk failure |
| Step | Command | Notes |
|---|---|---|
| 1. Check free space | sudo vgs | Confirm VFree is sufficient |
| 2. Extend LV + FS | sudo lvextend -L +NG -r /dev/vg/lv | -r handles filesystem resize |
| 3. Verify | df -h /mountpoint | Confirm new size visible |
| Step | Command | Notes |
|---|---|---|
| 1. Unmount | sudo umount /mountpoint | Required for shrink |
| 2. Check filesystem | sudo e2fsck -f /dev/vg/lv | Fix errors before resize |
| 3. Shrink filesystem | sudo resize2fs /dev/vg/lv NG | Must be smaller than LV target |
| 4. Shrink LV | sudo lvreduce -L NG /dev/vg/lv | Match or slightly larger than FS |
| 5. Remount | sudo mount /dev/vg/lv /mountpoint | Verify clean mount |
| 6. Verify | df -h /mountpoint | Confirm new size |