shrinkvdisksize

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

Syntax

 shrinkvdisksize    [ {  -size  size_change  |  -rsize  size_change  [  -copy id  ] } ]   [  -unit  {  b  |  kb  |  mb  |  gb  |  tb  |  pb  } ]   {  vdisk_name  |  vdisk_id  }

Parameters

-sizesize_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).
Remember: You cannot use -size to resize a thin-provisioned or compressed volume copy that is in a data reduction pool.
-rsizesize_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.
-copyid
(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.
-unitb | 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
(Required) Specifies the volume that you want to modify, either by ID or by name.

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 cannot use shrinkvdisksize if the volume is fast formatting.

The command can be used to shrink the physical capacity that is allocated to a particular volume by the specified amount. The command can also be used to shrink the virtual capacity of a thin-provisioned volume without altering the physical 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 virtual 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.

To run the shrinkvdisksize command on a mirrored volume, all copies of the volume must be synchronized.

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

The clustered system (system) arbitrarily reduces the capacity of the volume by removing a partial - one or more extents from the ones that are allocated to the volume. You cannot control which extents are removed and so you cannot assume that it is unused space that is removed.

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 -bytesvdiskname command. Shrink the volume by the required amount by issuing the shrinkvdisksize -sizesize_change-unit b | kb | mb | gb | tb | pbvdisk_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 that is part of a file system.
  4. You cannot resize (shrink) volume if that volume is being formatted.
  5. You cannot resize (shrink) a volume that is being migrated.
  6. You cannot resize (shrink) a volume if cloud snapshot is enabled on that volume.

This command is supported for volumes in Metro Mirror and Global Mirror relationships that are in consistent_synchronized state if those volumes are using thin-provisioned or compressed copies.

This command is not supported for volumes:
  • In HyperSwap relationships or in Global Mirror relationships that are operating in cycling mode.
  • In relationships that have a change volume configured.
  • That have fully allocated copies.
You must shrink both volumes in a relationship to maintain full operation of the system. To perform this task:
  1. Shrink the secondary volume by the required capacity.
  2. Shrink the primary volume by the required capacity.

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

shrinkvdisksize -size 2048 -unit b vdisk1

The resulting output:

No feedback

An invocation example to decrease the capacity of vdisk2 by 100 MB

shrinkvdisksize -size 100 -unit mb vdisk2

The resulting output:

No feedback

An invocation example to decrease the real capacity of thin-provisioned vdisk3 by 100 MB without changing its virtual capacity

shrinkvdisksize -rsize 100 -unit mb vdisk3

The resulting output:

No feedback

An invocation example to decrease the real capacity of thin-provisioned VDisk copy ID 1 of mirrored vdisk3 by 100 MB

shrinkvdisksize -rsize 100 -unit mb -copy 1 vdisk4

The resulting output:

No feedback

An invocation example to decrease the virtual capacity of thin-provisioned vdisk5 by 1 GB without changing its real capacity

shrinkvdisksize -size 1 -unit gb vdisk5

The resulting output:

No feedback