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

lvreduce - Reduce LV Size




lvreduce is a command in the context of LVM (Logical Volume Manager) and is used to reduce the size of a logical volume (LV). Prior to executing vreduce, you should perform e2fsck and resize2fs operations. Additionally, the LV must not be mounted. Reducing an LV's size to less than the data contained within it may result in data corruption.

The basic syntax of the lvreduce command is: lvreduce [OPTIONS] LV_PATH [SIZE], where 'LV_PATH' specifies the path to the logical volume you want to reduce, and 'SIZE' represents the amount by which you want to shrink the logical volume's size. If no 'SIZE' is provided, the logical volume will be reduced to its current usage.

Some common options for the lvreduce command include:

Example:
# e2fsck -f /dev/myVG/myLV ←Check the LV
# resize2fs /dev/myVG/myLV 15G ←Shrink the filesystem to 15GB
# lvreduce -L 15G /dev/myVG/myLV ←Reduce the LV to 15GB

The above operations are only applicable to ext2/ext3/ext4 filesystems. Please exercise caution when using thelvreduce command, as reducing the size of a logical volume can potentially lead to data loss if not done carefully.

For more LVM-related operations, you can refer to the provided link.