Q: A production server is running out of disk space on the root partition, but the disk has unallocated space. The root partition uses LVM. How do you extend the root filesystem online without downtime?
LVM (Logical Volume Manager) allows dynamic volume resizing without unmounting or rebooting.
#Linux #Linux / SRE — Scenario-Based Interview Questions #L2 #SRE #Systems #Troubleshooting
🎙️ Candidate Opening & Architectural Context
""Never reboot a server blindly; always capture top process telemetry, lsof descriptors, and thread dumps first. The interviewer is testing: LVM management, online filesystem resize.. I structure my answer around systematic triage first, root cause analysis second, and permanent remediation third.""
Advertisement
🛠️ Production Runbook & Step-by-Step Resolution
1️⃣
Initial Diagnostics & Root Cause Analysis
LVM (Logical Volume Manager) allows dynamic volume resizing without unmounting or rebooting.
- Check available space in the volume group:
vgdisplayshows free Physical Extents (PE) in the VG. - Extend the logical volume:
lvextend -l +100%FREE /dev/mapper/rootvg-rootlv(uses all free space). - Resize the filesystem online:
- For ext4:
resize2fs /dev/mapper/rootvg-rootlv
2️⃣
Remediation & Permanent Safeguards
Steps to extend the root filesystem: If the Volume Group itself has no free space but the physical disk has unpartitioned space, first create a new partition (fdisk or parted), create a Physical Volume (pvcreate /dev/sdaX), extend the VG (vgextend rootvg /dev/sdaX), then proceed with lvextend.
- For XFS:
xfs_growfs / - Verify:
df -h /should now show the extended size.
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: Check available space in the volume group: vgdisplay shows free Physical Extents (PE) in the VG.."
⚡ 60-Second Elevator Pitch Talking Points
- Check available space in the volume group: vgdisplay shows free Physical Extents (PE) in the VG.
- Extend the logical volume: lvextend -l +100%FREE /dev/mapper/rootvg-rootlv (uses all free space).
- Resize the filesystem online:
Advertisement