TrumanWong

lvreduce

Shrink logical volume space

Supplementary instructions

lvreduce command is used to reduce the space occupied by LVM logical volumes. Using the lvreduce command to shrink the space size of a logical volume may delete existing data on the logical volume, so you must confirm before operating.

grammar

lvreduce(options)(parameters)

Options

-L: Specify the size of the logical volume, the unit is "kKmMgGtT" bytes;
-l: Specify the size of the logical volume (number of LEs).

Parameters

Logical volume: Specify the device file corresponding to the logical volume to be operated.

Example

Use the lvreduce command to reduce the space size of the specified logical volume. Enter the following command at the command line:

[root@localhost ~]# lvreduce -L -50M /dev/vg1000/lvol0 #Reduce the space size of the logical volume by 50M

The output information is as follows:

...Omit part of the output content...
Do you really want to reduce lvol0? [y/n]: y #Confirm operation
   Reducing logical volume lvol0 to 252.00 MB
   Logical volume lvol0 successfully resized