← Storage & LVM
Linux · Storage & LVM

How to extend a logical volume and grow the filesystem in Linux

Grow a logical volume and its filesystem online with lvextend -r, or manually with resize2fs (ext4) and xfs_growfs (XFS).


Add space to a logical volume and grow its filesystem to use it. lvextend -r resizes the filesystem in the same step; the manual commands are shown too. Run as root.

Growing is generally safe and can be done online, but you cannot shrink an XFS filesystem afterward. Make sure the volume group has free space (vgs) before extending.

# Check there is free space in the VG first
sudo vgs <vg>

# Extend the LV by 10G and resize the filesystem in one step (-r)
sudo lvextend -L +10G -r /dev/<vg>/<lv>

# Or use all free space
# sudo lvextend -l +100%FREE -r /dev/<vg>/<lv>

# Manual resize (if you did not use -r):
#   ext4:  sudo resize2fs /dev/<vg>/<lv>
#   XFS:   sudo xfs_growfs /mount/point

# Verify
df -h /mount/point
sudo lvs <vg>/<lv>
LinuxLVMlvextend