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 -' >--+-------------------+-- --+- vdisk_name -+------------------>< '- -unit --+- b --+-' '- vdisk_id ---' +- kb -+ +- mb -+ +- gb -+ +- tb -+ '- pb -'
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. This indicates the change in size as a result of the reduction. Specify the size_change value using an integer. Specify the units for a size_change integer using the -unit parameter; the default is MB. You must specify either -rsize or -size.
- -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 in conjunction 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 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.
The clustered system (system) arbitrarily reduces the capacity of the volume by removing a partial, one or more extents from those allocated to the volume. You cannot control which extents are removed and so you cannot assume that it is unused space that is removed.
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.
- You cannot resize (shrink) an image mode volume.
- You cannot resize (shrink) the disk if the volume contains data.
- You cannot resize (shrink) a volume that is part of a file system.
- You cannot resize (shrink) volume if that volume is being formatted.
- You cannot resize (shrink) a volume that is being migrated.
- HyperSwap® relationships or in Global Mirror relationships that are operating in cycling mode
- In relationships where that volume has a Change Volume configured
- That have a fully-allocated copy
- Shrink the secondary volume by the required capacity
- 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