Interview Prep/Linux/Storage, disks and filesystems

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.

All Linux questions Roadmap: Linux

More on Storage, disks and filesystems