Skip to main content
A newer release of this product is available.

lun resize

Contributors
Suggest changes

Changes the size of the LUN to the input value size.

Availability: This command is available to cluster and Vserver administrators at the admin privilege level.

Description

This command resizes an existing LUN.

If the value specified by the -size parameter is larger than the current size of the LUN, the LUN size will be increased to at least the requested size by appending new empty blocks to the end of the LUN. After resizing, follow the procedures provided by your host operating system to discover the new size of the LUN and expand the filesystem on the LUN.

If the value specified by the -size parameter is smaller than the current size of the LUN, the LUN size will be reduced to no less than the requested size by truncating blocks at the end of the LUN beyond the new size. All data in the truncated blocks will be lost. Prior to reducing the size of a LUN, you must follow the procedure provided by the host operating system to resize and migrate the filesystem on the LUN off the blocks that will be truncated. Not all operating systems and filesystems support shrinking an existing filesystem.

You will recieve an error message warning of the potential for data loss if the command would reduce the size of the LUN. Once the host filesystem has been migrated off the blocks to be truncated, use the -force parameter to allow the resize to proceed.

Note Consider taking a Snapshot copy of the volume before reducing the size of the LUN. After the LUN has been resized and the contents verified, you may delete the Snapshot copy.

Parameters

-vserver <Vserver Name> - Vserver Name

Specifies the Vserver.

{ -path <path> - LUN Path

Specifies the path of the LUN that you want to resize. Examples of correct LUN paths are /vol/vol1/lun1 and /vol/vol1/qtree1/lun1 .

| -volume <volume name> - Volume Name

Specifies the volume that contains the LUN that you want to resize.

[-qtree <qtree name>] - Qtree Name

Specifies the qtree that contains the LUN that you want to resize.

-lun <text> - LUN Name }

Specifies the LUN name that you want to resize.

[-f, -force <true>] - Force Reduce LUN Size

Specifies the command may reduce the size of the specified LUN. If the specified -size is smaller than the existing size of the LUN and this parameter is not specified, the command will fail with an error instead of potentially destroying data. See the overall command description above for more information concerning reducing the size of a LUN.

[-size <size>] - New Size

Specifies the requested new size of the LUN. The actual size after resizing may be slightly larger than requested. If the value is prefixed with + or - , the new size will be calculated as the existing size plus or minus the value provided. The following multipliers are recognized as suffixes:

  • B - Value specifies number of blocks (512 bytes)

  • k - Value specifies number of kilobytes (1024 bytes)

  • M - Value specifies number of megabytes (1024 kilobytes)

  • G - Value specifies number of gigabytes (1024 megabytes)

  • T - Value specifies number of terabytes (1024 gigabytes)

Examples

cluster1::> lun resize -vserver vs1 -path /vol/vol1/lun1 -size 500M

Resizes the LUN /vol/vol1/lun1 in Vserver vs1 to 500 MB. If the LUN is already larger than 500 MB, this command will fail.

cluster1::> lun resize -vserver vs1 -path /vol/vol1/lun1 -size +50M

Adds 50 MB of space to LUN /vol/vol1/lun1

cluster1::> lun resize -vserver vs1 -path /vol/vol1/lun1 -size -10m

Error: command failed: Reducing LUN size without coordination with the host system
may cause permanent data loss or corruption. Use the force flag to allow
LUN size reduction.

cluster1::> lun resize -path /vol/vol1/lun1 -size -100M -force

Reduces the LUN /vol/vol1/lun1 by 100 MB.