Shrinking a volume using the CLI

You can reduce the size of a compressed or uncompressedvolume using the command-line interface (CLI).

Volumes can be reduced in size, if it is necessary. You can make a target or auxiliary volume the same size as the source or master volume when you create FlashCopy mappings, Metro Mirror relationships, or Global Mirror relationships. However, if the volume contains data, do not shrink the size of the disk. The system disables shrinking a volume if the selected volume is currently performing quick initialization. After the quick initialization completes, you can shrink the volume.

Attention:
  1. The system arbitrarily reduces the capacity of the volume by removing one or more extents from those that are allocated to the volume. You cannot control which extents are removed so you cannot guarantee that it is unused space that is removed.
  2. If the volume contains data that is being used, do not attempt under any circumstances to shrink a volume without first backing up your data.
  3. For performance reasons, some operating systems or file systems use the outer edge of the disk.

You can use the shrinkvdisksize command to shrink the physical capacity that is allocated to the particular volume by the specified amount. You can also shrink the virtual capacity of a thin-provisioned volume without altering the physical capacity assigned to the volume.

For more information about the command parameters, see shrinkvdisksize.

Complete the following steps to shrink a volume:

  1. Validate that the volume is not mapped to any host objects. If the volume is mapped, data is displayed.
  2. You can determine the exact capacity of the source or master volume. Issue the following command:

    lsvdisk -bytes vdisk_name

  3. Shrink the volume by the required amount. Enter the following command:

    shrinkvdisksize -size size_change -unit
    b | kb | mb | gb | tb | pbvdisk_name

    where size_change indicates the size reduction for the volume in the specified units and vdisk_name is the volume that you are shrinking.