The `/var` LVM logical volume is nearly full and there is free space in the volume group. How do you grow it online?
BeginnerScenarioStorage, disks and filesystems
Answer
Situation read → LVM lets you grow without downtime.
What I'd do →
sudo vgs # confirm VFree
sudo lvextend -r -L +20G /dev/vg0/var # -r resizes the filesystem too
df -h /var
If you prefer separate steps: xfs_growfs /var for XFS, resize2fs /dev/vg0/var for ext4.
Why → Both XFS and ext4 can grow while mounted.
Interview tip → Mention that XFS can't shrink, so you grow in sensible increments rather than all at once.
More on Storage, disks and filesystems
You get paged at 3 AM: the root filesystem on a production server is at 98% and climbing. Walk through your response.BeginnerA new 200 GB EBS volume is attached to an EC2 instance. How do you make it usable and persistent across reboots?BeginnerThe volume group has no free space. You've been given a new disk. How do you add it to grow `/var`?IntermediateA cloud VM's root disk was enlarged from 30 GB to 80 GB in the console, but `df` still shows 30 GB. What do you do?BeginnerYou need to move a busy MySQL data directory from the root disk to a new, faster volume. Plan it.IntermediateA team wants a shared directory mounted on 10 app servers. How do you set up NFS?Beginner