Solaris Volume Manager Administration Guide

Chapter 9 RAID-0 (Stripe and Concatenation) Volumes (Tasks)

This chapter contains information about tasks that are related to RAID-0 volumes. For information about related concepts, see Chapter 8, RAID-0 (Stripe and Concatenation) Volumes (Overview).

RAID-0 Volumes (Task Map)

The following task map identifies the procedures that are needed to manage Solaris Volume Manager RAID-0 volumes.

Task 

Description 

For Instructions 

Create RAID-0 (stripe) volumes 

Use the Solaris Volume Manager GUI or the metainit command to create a new volume.

How to Create a RAID-0 (Stripe) Volume

Create RAID-0 (concatenation) volumes 

Use the Solaris Volume Manager GUI or the metainit command to create a new volume.

How to Create a RAID-0 (Concatenation) Volume

Expand storage space 

Use the Solaris Volume Manager GUI or the metainit command to expand an existing file system.

How to Expand Storage Capacity for Existing Data

Expand an existing RAID-0 volume 

Use the Solaris Volume Manager GUI or the metattach command to expand an existing volume.

How to Expand an Existing RAID-0 Volume

Remove a RAID-0 volume 

Use the Solaris Volume Manager GUI or the metaclear command to delete a volume.

How to Remove a RAID-0 Volume

Creating RAID-0 (Stripe) Volumes


Caution – Caution –

Do not create a stripe from an existing file system or data. Doing so destroys data. To create a stripe from existing data, you must back up the data, create the stripe volume, and then restore the data to the volume.



Caution – Caution –

Do not create volumes larger than 1Tbyte if you expect to run the Solaris software with a 32-bit kernel. Additionally, do not create volumes larger than 1Tbyte if you expect to use a version of the Solaris OS prior to the Solaris 9 4/03 release. See Overview of Multi-Terabyte Support in Solaris Volume Manager for more information about large volume support in Solaris Volume Manager.


ProcedureHow to Create a RAID-0 (Stripe) Volume

Before You Begin

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

    To create a stripe volume, 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
      [ -i interlace]
      
      volume-name

      Specifies the name of the volume to create. For information on naming volumes, see Volume Names.

      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 are used. If more than one component is used, separate each component with a space.

      -i interlace

      Specifies the interlace width to use for the stripe. The interlace width is a value, followed by either `k' for kilobytes, `m' for megabytes, or `b' for blocks. The interlace specified cannot be less than 16 blocks, or greater than 100 megabytes. The default interlace width is 512 kilobytes.

      See the following examples and the metainit(1M) man page for more information.


Example 9–1 Creating a RAID–0 (Stripe) Volume of Three Slices


# metainit d20 1 3 c0t1d0s2 c0t2d0s2 c0t3d0s2
d20: Concat/Stripe is setup

This example shows the stripe, d20, consists of a single stripe (the number 1). The stripe is composed of three slices (the number 3). Because no interlace value is specified, the stripe uses the default of 512 Kbytes. The system confirms that the volume has been set up.



Example 9–2 Creating a RAID-0 (Stripe) Volume of Two Slices With a 32–Kbyte Interlace Value


# metainit d10 1 2 c0t1d0s2 c0t2d0s2 -i 32k
d10: Concat/Stripe is setup

This example shows the stripe, d10, consists of a single stripe (the number 1). The stripe is composed of two slices (the number 2). The -i option sets the interlace value to 32 Kbytes. (The interlace value cannot be less than 8 Kbytes, nor greater than 100 Mbytes.) The system verifies that the volume has been set up.


See Also

To prepare the newly created stripe for a file system, see Chapter 18, Creating UFS, TMPFS, and LOFS File Systems (Tasks), in System Administration Guide: Devices and File Systems. Some applications, such as a database, do not use a file system. These applications instead use the raw device. The application must have its own way of accessing the raw device.

Creating RAID-0 (Concatenation) Volumes

ProcedureHow to Create a RAID-0 (Concatenation) Volume


Caution – Caution –

Do not create volumes larger than 1Tbyte if you expect to run the Solaris software with a 32–bit kernel. Additionally, do not create volumes larger than 1 Tbyte if you expect to use a version of the Solaris OS prior to the Solaris 9 4/03 release. See Overview of Multi-Terabyte Support in Solaris Volume Manager for more information about multi-terabyte volumes in Solaris Volume Manager.


Before You Begin

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

    To create a concatenation volume, 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

      Specifies the name of the volume to create.

      number-of-stripes

      Specifies the number of stripes to create.

      components-per-concatenation

      Specifies the number of components each concatenation should have.

      component-names

      Specifies the names of the components that are used. If more than one component is used, separate each component with a space.

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


Example 9–3 Creating a Concatenation of One Slice


# metainit d25 1 1 c0t1d0s2
d25: Concat/Stripe is setup

This example shows the creation of a concatenation, d25. This concatenation consists of one stripe (the first number 1) composed of a single slice (the second number 1 in front of the slice). The system verifies that the volume has been set up.

The example shows a concatenation that can safely encapsulate existing data.



Example 9–4 Creating a Concatenation of Four Slices


# metainit d40 4 1 c0t1d0s2 1 c0t2d0s2 1 c0t2d0s3 1 c0t2d1s3
d40: Concat/Stripe is setup

This example shows the creation of a concatenation, d40. The concatenation consists of four stripes (the number 4), each composed of a single slice (the number 1 in front of each slice). The system verifies that the volume has been set up.


See Also

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

Expanding Storage Capacity

To add storage capacity to a file system, create a concatenation volume. To add storage capacity to an existing stripe, create a concatenated stripe volume.

ProcedureHow to Expand Storage Capacity for Existing Data


Caution – Caution –

Do not create volumes larger than 1Tbyte if you expect to run the Solaris software with a 32-bit kernel. Additionally, do not create volumes larger than 1 Tbyte if you expect to use a version of the Solaris OS prior to the Solaris 9 4/03 release. See Overview of Multi-Terabyte Support in Solaris Volume Manager for more information about multi-terabyte volume support in Solaris Volume Manager.


Before You Begin

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

  1. Unmount the file system.


    # umount /filesystem
    
  2. 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

      Specifies 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 are used. If more than one component is used, separate each component with a space.

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

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

  4. Remount the file system.


    # mount /filesystem
    

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


# 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

This example shows the creation of a concatenation, 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. 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, initially, the following line appears in the /etc/vfstab file:


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

This line should be changed to the following:


/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.

Some applications, such as a database, do not use a file system. An application such as a database uses the raw concatenation and 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 storage capacity, you convert it into a concatenated stripe. Doing so allows you to expand your storage capacity 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 1Tbyte if you expect to run the Solaris software with a 32-bit kernel. Additionally, do not create volumes larger than 1 Tbyte if you expect to use a version of the Solaris OS prior to the Solaris 9 4/03 release. See Overview of Multi-Terabyte Support in Solaris Volume Manager for more information about multi-terabyte support in Solaris Volume Manager.


Before You Begin

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

    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

      Specifies the name of the volume to expand.

      component-names

      Specifies the names of the components that are used. If more than one component is used, separate each component with a space.

      See 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 to it. Because no interlace value is given for the attached slices, the stripes inherit the interlace value configured for d25. The system verifies that the volume has been set up.


See Also

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

Some applications, such as a database, do not use a file system. An application such as a database uses the raw volume and 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 18, Creating UFS, TMPFS, and LOFS File Systems (Tasks), in System Administration Guide: Devices and File Systems.

Removing a RAID-0 Volume

ProcedureHow to Remove a RAID-0 Volume

  1. Make sure that you have a current backup of all data and that you have root privilege.

  2. Make sure that you no longer need the volume.

    If you delete a stripe or concatenation and reuse the slices that were part of the deleted volume, all data on the volume is deleted from the system.

  3. Unmount the file system, if needed.


    # umount /filesystem
    
  4. To remove a volume, use one of the following methods:

    • From the Enhanced Storage tool within the Solaris Management Console, open the Volumes node. Choose Edit⇒Delete, then follow the onscreen instructions. For more information, see the online help.

    • Use the following format of the metaclear command to delete the volume:


      metaclear volume-name
      

      See the following example and the metaclear(1M) man page for more information.


Example 9–8 Removing a Concatenation


# umount d8
# metaclear d8
d8: Concat/Stripe is cleared
(Edit the /etc/vfstab file)

This example illustrates removing the concatenation, d8, that also contains a mounted file system. The file system must be unmounted before the volume can be removed. The system displays a confirmation message that the concatenation is removed. If an entry in the /etc/vfstab file exists for this volume, delete that entry. You do not want to confuse the system by asking it to mount a file system on a nonexistent volume.