Linux Commands Helper
💬 Your AI-powered Linux assistant
lvextend Command - Extend a Logical Volume
The lvextend command is used to increase the size of a logical volume in the LVM (Logical Volume Manager) system. This is useful when you need more space in a partition without recreating it.
Syntax
lvextend [options] -L [+]size[m|g] LogicalVolumePath lvextend [options] -l [+]LogicalExtents LogicalVolumePath
Examples
sudo lvextend -L +10G /dev/vg0/lv_home
Increase the size of lv_home by 10GB.
sudo lvextend -l +100%FREE /dev/vg0/lv_data
Extend lv_data to use all remaining free space in the volume group.
sudo resize2fs /dev/vg0/lv_home
After extending, resize the filesystem to use the new space (for ext4/ext3 filesystems).
Notes
- Always back up important data before resizing logical volumes.
- After using lvextend, you usually need to resize the filesystem (e.g., with
resize2fs
for ext4). - Requires root privileges.
- Check available space in the volume group with
vgdisplay
orvgs
.