Interview Prep/Linux/Storage, disks and filesystems

The volume group has no free space. You've been given a new disk. How do you add it to grow `/var`?

IntermediateScenarioStorage, disks and filesystems
Answer

Situation read → Add a physical volume to the VG, then extend.

What I'd do →

lsblk                                  # new disk /dev/sdc
sudo pvcreate /dev/sdc
sudo vgextend vg0 /dev/sdc
sudo lvextend -r -l +100%FREE /dev/vg0/var
sudo pvs; sudo vgs; df -h /var

Why → The LV spans both PVs transparently.

Interview tip → Flag the risk: a linear LV across two disks fails if either disk fails, so on bare metal put RAID underneath.

All Linux questions Roadmap: Linux

More on Storage, disks and filesystems