Forrest logo
back to the lvresize tool

lvresize:tldr:bd317

lvresize: Change the size of a logical volume to 120 GB.
$ lvresize --size ${120G} ${volume_group}/${logical_volume}
try on your machine

This command is used to resize a logical volume in Linux by increasing or decreasing its size. Here is the explanation of each part of the command:

  • lvresize: This is the main command for resizing logical volumes in Linux.
  • --size: This option specifies the new size of the logical volume.
  • ${120G}: This is a variable representing the desired size of the logical volume. In this example, it is set to 120 gigabytes (GB). The $ symbol is used to indicate that it is a variable.
  • ${volume_group}: This is a variable representing the name of the volume group where the logical volume resides. The specific volume group name needs to be provided.
  • ${logical_volume}: This is a variable representing the name of the logical volume that needs to be resized. The name of the logical volume needs to be provided.

By substituting the variable values, the command would look something like this:

lvresize --size 120G vg1/lv1

In this example, the logical volume lv1 in the volume group vg1 would be resized to 120GB.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the lvresize tool