lvresize:tldr:55346
The command lvresize
is used to resize a logical volume in a Linux system.
Here's an explanation of the options used in the command:
-
--size -${120G}
: Specifies the new size for the logical volume, which is calculated by subtracting 120 gigabytes (120G) from the current size. The minus sign (-) before${120G}
indicates that the size is being decreased. -
--resizefs
: This option instructslvresize
to also resize the file system within the logical volume after resizing it. This ensures that the file system can utilize the available space. -
${volume_group}
: This is a placeholder for the name of the volume group that contains the logical volume you want to resize. You need to replace${volume_group}
with the actual name of the volume group. -
${logical_volume}
: This is a placeholder for the name of the logical volume you want to resize. You need to replace${logical_volume}
with the actual name of the logical volume.
To summarize, the command lvresize --size -${120G} --resizefs ${volume_group}/${logical_volume}
resizes the specified logical volume by reducing its size by 120 gigabytes and also resizes the file system within the logical volume to utilize the changed size.