Purpose
Extend disk space on a Linux system using LVM without downtime.
Applies to
Systems using LVM (Logical Volume Manager)
Problem
Filesystem (e.g. /, /var) is running out of space and needs to be extended.
Step 1 — Check Current Disk Usage
Output:
Outcome:
Step 2 — Verify LVM Setup (Build Context for Extension)
1. Map LV to Mount Point
Output :
Insight:
Output:
Insight:
Output:
Insight:
Interpretation:
4. Check Underlying Disks
Insight:
Step 2 Outcome (What we now know)
Decision Point
Case A: VG has free space
→ Extend LV directly
Case B: No free space
→ Add disk / extend storage first
Case A — Extend LV (VG has free space)
Step 3 — Extend Logical Volume
OR use all free space:
Outcome:
Step 4 — Resize Filesystem
Check filesystem:
For ext4:
For xfs:
Outcome:
Step 5 — Verify
Case B — No Free Space in VG
Step 3 — Add New Disk (Cloud / VM level)
Step 4 — Create PV
Step 5 — Extend VG
Step 6 — Extend LV
Step 7 — Resize Filesystem
# OR
Step 8 — Verify
Additional Note — Expanding Existing Disk
If the same disk is increased in size (no new disk added):
Outcome:
You can now proceed with lvextend
Common Mistakes
Key Concepts and Takeaways
Flow:
Disk → PV → VG → LV → Filesystem
Precautions
Extend disk space on a Linux system using LVM without downtime.
Applies to
Systems using LVM (Logical Volume Manager)
ProblemFilesystem (e.g. /, /var) is running out of space and needs to be extended.
Step 1 — Check Current Disk Usage
Code:
df -hCode:
/dev/mapper/rootvg-varlv 14G 13G 1.4G 91% /varOutcome:
- Identify which mount point is full (e.g /var)
- This determines which LV needs extension
Step 2 — Verify LVM Setup (Build Context for Extension)
1. Map LV to Mount Point
Code:
lsblkCode:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 256G 0 disk
├─sda4 8:4 0 63.3G 0 part
├─rootvg-varlv 253:3 0 14G 0 lvm /var
└─sda5 8:5 0 100G 0 part
├─rootvg-varlv 253:3 0 14G 0 lvm /var
Insight:- Identifies which LV is mounted where
- Confirms LVM usage (TYPE = lvm)
Code:
lvs -o lv_name,vg_name,lv_pathCode:
LV VG Path
varlv rootvg /dev/rootvg/varlv
Insight:- Confirms exact LV name to extend (e.g varlv)
- Provides correct device path required for lvextend (e.g /dev/rootvg/varlv)
Code:
vgsCode:
VG #PV #LV #SN Attr VSize VFree
rootvg 2 5 0 wz--n- <163.31g 316.00m
Insight:- Determines if extension is possible
Interpretation:
- VFree > 0
→ Extend directly
- VFree = 0
→ Add disk first
4. Check Underlying Disks
Code:
pvsCode:
PV VG Fmt Attr PSize PFree
/dev/sda4 rootvg lvm2 a-- 63.31g 0
/dev/sda5 rootvg lvm2 a-- <100.00g 316.00m
Insight:- Shows disks backing the VG
- Confirms whether storage is already fully utilized
Step 2 Outcome (What we now know)- Which LV to extend (varlv)
- Its mount point (/var) and exact path (/dev/rootvg/varlv)
- Whether free space exists in VG
- Which disks are backing LVM
Decision PointCase A: VG has free space
→ Extend LV directly
Case B: No free space
→ Add disk / extend storage first
Case A — Extend LV (VG has free space)
Step 3 — Extend Logical Volume
Code:
lvextend -L +316M /dev/rootvg/varlv- -L → size in GB/MB
OR use all free space:
Code:
lvextend -l +100%FREE /dev/rootvg/varlv- -l → extents / percentage
Outcome:
Code:
Size of logical volume rootvg/varlv changed from 14.00 GiB (3584 extents) to <14.31 GiB (3663 extents).
Logical volume rootvg/varlv successfully resized.- LV size increases
- Filesystem unchanged (IMPORTANT)
Step 4 — Resize Filesystem
Check filesystem:
Code:
lsblk -fFor ext4:
Code:
resize2fs /dev/rootvg/varlvFor xfs:
Code:
xfs_growfs /varOutcome:
- Filesystem expands to use new space
Step 5 — Verify
Code:
df -hCase B — No Free Space in VG
Step 3 — Add New Disk (Cloud / VM level)
- Add a new disk from your cloud provider / hypervisor (e.g. AWS, Azure, VMware)
- Example: New disk appears as /dev/sdb
- Verify Disk is Added
Code:lsblk - New disk should be visible (e.g. /dev/sdb)
Step 4 — Create PV
Code:
pvcreate /dev/sdbStep 5 — Extend VG
Code:
vgextend rootvg /dev/sdbStep 6 — Extend LV
Code:
lvextend -l +100%FREE /dev/rootvg/varlvStep 7 — Resize Filesystem
Code:
xfs_growfs /var# OR
Code:
resize2fs /dev/rootvg/varlvStep 8 — Verify
Code:
df -hAdditional Note — Expanding Existing Disk
If the same disk is increased in size (no new disk added):
Code:
growpart /dev/sda 4Code:
pvresize /dev/sda4Outcome:
- growpart → expands the partition
- pvresize → makes new space available to LVM
You can now proceed with lvextend
Common Mistakes- Extending LV but not resizing filesystem
- Using wrong filesystem command (resize2fs vs xfs_growfs)
- Not checking vgs before starting
- Using wrong device path
- Confusing disk (/dev/sdb) with LV (/dev/rootvg/varlv)
Key Concepts and Takeaways - PV (Physical Volume) → Disk (/dev/sda4)
- VG (Volume Group) → Storage pool (rootvg)
- LV (Logical Volume) → Usable volume (/var)
Flow:
Disk → PV → VG → LV → Filesystem
- Extension = LV resize + filesystem resize
- vgs decides your approach (direct vs add disk)
- LVM allows online resizing (no downtime)
Precautions- Take backup before changes
- Double-check device names
- Run carefully on production

