Solaris Volume Manager Administration Guide

Expanding Storage Space

To add space to a file system, create a concatenation. To add space to an existing stripe, create a concatenated stripe.

ProcedureHow to Expand Storage Space for Existing Data


Caution – Caution –

Do not create volumes larger than 1TB if you expect to run the Solaris software with a 32–bit kernel or if you expect to use a version of the Solaris OS prior to Solaris 9 4/03. See Overview of Large Volume Support in Solaris Volume Manager for more information about large volume support in Solaris Volume Manager.


Steps
  1. Check Prerequisites for Creating Solaris Volume Manager Components and Background Information for Creating RAID 0 Volumes.

  2. Unmount the file system.


    # umount /filesystem
    
  3. To create a concatenation, use one of the following methods:

    • From the Enhanced Storage tool within the Solaris Management Console, open the Volumes node. Choose Action->Create Volume, then follow the instructions in the wizard. For more information, see the online help.

    • Use the following form of the metainit command:


      metainit volume-name number-of-stripes components-per-stripe component-names
      
      • volume-name is the name of the volume to create.

      • number-of-stripes specifies the number of stripes to create.

      • components-per-stripe specifies the number of components each stripe should have.

      • component-names specifies the names of the components that will be used.

      For more information, see the metainit(1M) man page.

  4. Edit the /etc/vfstab file so that the file system references the name of the concatenation.

  5. Remount the file system.


    # mount /filesystem
    

Example 9–5 Expanding a File System By Creating a Concatenation

This example shows the creation of a concatenation called d25 out of two slices, /dev/dsk/c0t1d0s2 (which contains a file system mounted on /docs) and /dev/dsk/c0t2d0s2. The file system must first be unmounted.


# umount /docs
# metainit d25 2 1 c0t1d0s2 1 c0t2d0s2
d25: Concat/Stripe is setup
(Edit the /etc/vfstab file so that the file system  references the volume d25 instead of slice c0t1d0s2)
# mount /docs

Note that the first slice in the metainit command must be the slice that contains the file system. If not, you will corrupt your data.

Next, the entry for the file system in the /etc/vfstab file is changed (or entered for the first time) to reference the concatenation. For example, the following line:


/dev/dsk/c0t1d0s2 /dev/rdsk/c0t1d0s2 /docs ufs 2 yes -

should be changed to:


/dev/md/dsk/d25 /dev/md/rdsk/d25 /docs ufs 2 yes -

Finally, the file system is remounted.


See Also

For a UFS file system, run the growfs command on the concatenation. See How to Expand a File System.

An application, such as a database, that uses the raw concatenation must have its own way of recognizing the concatenation, or of growing the added space.

ProcedureHow to Expand an Existing RAID 0 Volume

A concatenated stripe enables you to expand an existing stripe. For example, if a stripe has run out of space, you can make it into a concatenated stripe, and expand it without having to back up and restore data.

This procedure assumes that you are adding an additional stripe to an existing stripe.


Caution – Caution –

Do not create volumes larger than 1TB if you expect to run the Solaris software with a 32–bit kernel or if you expect to use a version of the Solaris OS prior to Solaris 9 4/03. See Overview of Large Volume Support in Solaris Volume Manager for more information about large volume support in Solaris Volume Manager.


Steps
  1. Check Prerequisites for Creating Solaris Volume Manager Components and Background Information for Creating RAID 0 Volumes.

  2. To create a concatenated stripe, use one of the following methods:

    • From the Enhanced Storage tool within the Solaris Management Console, open the Volumes node. Choose Action->Create Volume, then follow the instructions in the wizard. For more information, see the online help.

    • To concatenate existing stripes from the command line, use the following form of the metattach command:


      metattach volume-name component-names
      
      • volume-name is the name of the volume to expand.

      • component-names specifies the names of the components that will be used.

      See Example 9–6, Example 9–7, and the metattach(1M) man page for more information.


Example 9–6 Creating a Concatenated Stripe By Attaching a Single Slice


# metattach d2 c1t2d0s2
d2: components are attached

This example illustrates how to attach a slice to an existing stripe, d2. The system confirms that the slice is attached.



Example 9–7 Creating a Concatenated Stripe By Adding Several Slices


# metattach d25 c1t2d0s2 c1t2d1s2 c1t2d3s2
d25: components are attached

This example takes an existing three-way stripe, d25, and concatenates another three-way stripe. Because no interlace value is given for the attached slices, they inherit the interlace value configured for d25. The system verifies that the volume has been set up.


See Also

For a UFS, run the growfs command on the volume. See How to Expand a File System.

An application, such as a database, that uses the raw volume must have its own way of recognizing the volume, or of growing the added space.

To prepare a newly created concatenated stripe for a file system, see Chapter 16, Creating UFS, TMPFS, and LOFS File Systems (Tasks), in System Administration Guide: Devices and File Systems.