Interview Prep/Linux/Storage & Memory

How do you extend a logical volume and its filesystem online?

IntermediateConceptStorage & Memory
Answer
sudo pvcreate /dev/sdd && sudo vgextend vgdata /dev/sdd   # if VG needs space
sudo lvextend -r -L +50G /dev/vgdata/lvapp               # -r resizes the FS too
# or manually:
sudo xfs_growfs /data          # XFS takes the mount point
sudo resize2fs /dev/vgdata/lvapp   # ext4 takes the device

Both XFS and ext4 grow online with no unmount.

All Linux questions Roadmap: Linux

More on Storage & Memory