Previous  |  Next  >  
Product: Storage Foundation Guides   
Manual: Storage Foundation 4.1 Intelligent Storage Provisioning Administrator's Guide   

Resizing Volumes Online

Increasing or decreasing the size of a volume is an operation that can be performed while a volume is online. The following vxvoladm operations are available for resizing a volume:

  • growto --- Increase volume size to a specified length.
  • growby --- Increase volume size by a specified length.
  • shrinkto --- Reduce volume size to a specified length.
  • shrinkby --- Reduce volume size by a specified length.

You can specify the length argument in sectors, kilobytes, megabytes, gigabytes or as a percentage by adding the unit of measure as a suffix (s, m, k, g, %) to the length value. If no unit is specified, sectors are assumed.


Caution  Caution    If you use vxvoladm to resize a volume, do not shrink it below the size of the file system that is located on it. If you do not shrink the file system first, you risk unrecoverable data loss. If you have a VxFS file system, shrink the file system first, and then shrink the volume. Other file systems may require you to back up your data so that you can later recreate the file system and restore its data. Alternatively, you can use the vxresize command to resize both the volume and its file system where this is supported. See the vxresize(1M) manual page for more information.

Note   Note    If you use the vxvoladm command to resize application volumes of type fsgen or raid5, you must specify the -f (force) option to the command. You must also specify the -f option if growing a volume would violate any rules.

Determining the Maximum Size of a Volume

You can use the following command to determine by how much you can grow a volume using the available storage:


vxvoladm [-g diskgroup] maxgrow volume [attributes...]

You can use storage specification attributes with this command to restrict the storage that is taken into consideration by the calculation. For example, the following command specifies that any JBOD storage may be used to resize volume, vol02:


vxvoladm -g mydg maxgrow vol02 \
  use_storage='allof("Enclosure"="Disk")'

Increasing the Size of a Volume to a Specified Length

The following command grows a volume to a specified length:


vxvoladm [-g diskgroup] [-f] growto volume length [attributes...]

You can use storage specification attributes with this command to restrict the storage that is used to grow a volume. For example, the following command expands the volume vol1 to 10 gigabytes, but excludes storage on controller c1 from being allocated:


vxvoladm -g mydg growto vol1 10g \
  use_storage='noneof("Controller"="c1")'

This operation fails if the new length specified is smaller that the current size of the volume.

Increasing the Size of a Volume by a Specified Amount

The following command grows a volume by a specified amount:


vxvoladm [-g diskgroup] [-f] growby volume length [attributes...]

For example, the following command grows the volume vol1 by 1 gigabyte by allocating contiguous storage:


vxvoladm -g mydg growby vol1 1g layout=contig

The setting layout=contig allows only contiguous regions of disk to be used for plexes or columns. By default, the length of a volume is increased by first extending existing subdisks in the volume if possible, and then by adding and associating new subdisks. This default behavior corresponds to the attribute setting layout=nocontig.

Reducing the Size of a Volume to a Specified Length

The following command reduces the length of a volume:


# vxvoladm [-g diskgroup] [-f] shrinkto volume length \
[attributes...]

For example, the following command shrinks the volume vol1 to 5 gigabytes:


vxvoladm -g mydg shrinkto vol1 5g

This operation fails if the new length specified is larger that the current size of the volume.

Reducing the Size of a Volume by a Specified Amount

The following command reduces the length of a volume by a specified amount:


# vxvoladm [-g diskgroup] [-f] shrinkby volume length \
[
attributes...]

For example, the following command shrinks the volume vol01 by 500 megabytes:


vxvoladm -g mydg shrinkby vol1 500m

Growing and Shrinking Multiple Volumes

If the -M option is specified to the vxvoladm command, multiple volumes can be resized in the same operation. For convenience, it is easiest to define the volumes that are to be resized in a file, and then have vxvoladm read this file to resize the volumes as shown in this example:


vxvoladm -M growby < filename

Each line of input defines the disk group, volume and length parameters for the resize and has the following format:


diskgroup dgname volume volume_name length

When used in scripts, the input may conveniently be taken from a "here document" as shown in this example:


vxvoladm -M shrinkto <<!!
diskgroup mydg volume vol01 10g
diskgroup mydg volume vol02 12g
!!
 ^ Return to Top Previous  |  Next  >  
Product: Storage Foundation Guides  
Manual: Storage Foundation 4.1 Intelligent Storage Provisioning Administrator's Guide  
VERITAS Software Corporation
www.veritas.com