The Linux Newbie Guide  ⇒    Fundamentals     Advanced     Supplement   Command Index   ENG⇒中
All rights reserved, please indicate the source when citing
  

lvextend - Extend LV Capacity



lvextend is a command in the context of LVM (Logical Volume Manager) and is used to increase the capacity of a logical volume (LV).

The basic syntax of the lvextend command is: lvextend [OPTIONS] LV_PATH [SIZE], where 'LV_PATH' specifies the path to the logical volume you want to extend, and 'SIZE' represents the amount by which you want to increase the logical volume's size. If no 'SIZE' is provided, the logical volume will be extended to use all available free space within the volume group.

Some common options for the lvextend command include:

Here are a few examples of using the lvextend command:
# lvextend -L15G /dev/myVG/myLV ←Extend the 'myLV' LV to 15 GB
# lvextend -l +100%FREE /dev/myVG/myLV ←Extend the 'myLV' LV to use all available free space
# lvextend -L+5G /dev/myVG/myLV ←Increase the 'myLV' LV by 5 GB

After running lvextend, if the LV was previously formatted, remember to use resize2fs to adjust the filesystem size (note that resize2fs is not applicable to the XFS filesystem).

For more examples and operations related to lvextend and LVM, you can refer to the provided link.