shrinkvdisksize

Use the shrinkvdisksize command to reduce the size of a volume by the specified capacity.

Syntax

Read syntax diagramSkip visual syntax diagram shrinkvdisksize -sizesize_change-rsizesize_change-copyid-sizesize_change-unitbkbmbgbtbpbvdisk_namevdisk_idvdisk_uid

Parameters

-size size_change
(Optional) Specifies the size reduction (change in size) for the designated volume. The -size parameter cannot be used with the -rsize parameter. You must specify either -size or -rsize.
Important: This parameter does reduce the size of a volume (the specified virtual size capacity).
-rsize size_change
(Optional) Reduces the real size of a thin-provisioned volume by the specified amount. It indicates the change in size as a result of the reduction. Specify the size_change value by using an integer. Specify the units for a size_change integer by using the -unit parameter; the default is MB. You must specify either -rsize or -size.
Remember: You cannot use -rsize to resize a thin-provisioned or compressed volume copy that is in a data reduction pool.
-copy id
(Optional) Specifies the copy to change the real capacity for. You must also specify the -rsize parameter. If the -copy parameter is not specified, all copies of the volume are reduced. This parameter is required if the volume is mirrored and only one copy is thin-provisioned.
-unit b | kb | mb | gb | tb | pb
(Optional) Specifies the data units to be used along with the value that is specified by the -size parameter.
vdisk_name | vdisk_id | vdisk_uid
(Required) Specifies the volume by ID, name, or UID that you want to modify.

Description

The shrinkvdisksize command reduces the capacity that is allocated to the particular volume by the amount that you specify. You cannot shrink the real size of a thin-provisioned volume below its used size. All capacities, including changes, must be in multiples of 512 bytes. An entire extent is reserved even if it is only partially used. The default capacity units are MB. You can use shrinkvdisksize while the volume is fast formatting and while the volume is synchronizing.You cannot use shrinkvdisksize if the volume is fast formatting.

The command can be used to shrink the usable capacity that is allocated to a particular volume by the specified amount. The command can also be used to shrink the provisioned capacity of a thin-provisioned volume without altering the usable capacity that is assigned to the volume. To change the capacity of a non-thin-provisioned disk, use the -size parameter. To change the real capacity of a thin-provisioned disk, use the -rsize parameter. To change the provisioned capacity of a thin-provisioned disk, use the -size parameter.

Volumes can be reduced in size, if required.

When the virtual size of a thin-provisioned volume is changed, the warning threshold is automatically scaled to match. The new threshold is stored as a percentage.

Attention: If the volume contains data that is being used, do not shrink the volume without backing up the data first.

The system reduces the capacity by removing extents that are allocated to the end of the volume. You cannot control how the host used the capacity that was provisioned to it and so you cannot assume that the unused space is all at the end of the volume.

Remember: Before you shrink a volume, validate that the volume is not mapped to any host objects.

You can determine the exact capacity of the source or master volume by issuing the lsvdisk -bytes vdiskname command. Shrink the volume by the required amount by issuing the shrinkvdisksize -size size_change-unit b | kb | mb | gb | tb | pb vdisk_name | vdisk_id command.

Remember:
  1. You cannot resize (shrink) an image mode volume.
  2. You cannot resize (shrink) the disk if the volume contains data.
  3. You cannot resize (shrink) a volume if that volume is being formatted.
  4. You cannot resize (shrink) a volume that is being migrated.
  5. You cannot resize (shrink) a volume if cloud snapshot is enabled on that volume.
  6. You cannot resize (shrink) a volume if it is replicated or in a highly-available storage partition.

A volume cannot be shrunk if it is the target of a FlashCopy mapping. If the volume is the a source of a FlashCopy mapping it can be shrunk provided no FlashCopy mapping for which it is the source has a starting capacity that is greater than the proposed size of the volume. The starting capacity can be found in the lsfcmap view.

An invocation example to decrease the capacity of vdisk1 by 2 KB

shrinkvdisksize -size 2048 -unit b vdisk1

The resulting output:

No feedback