<chapter id="tasks-raid5-1"><title>RAID-5
Volumes (Tasks)</title><highlights><para>This chapter provides information about performing Solaris Volume Manager tasks
that are associated with RAID-5 volumes. For information about the concepts
involved in these tasks, see <olink targetptr="about-raid5-1" remap="internal">Chapter&nbsp;14,
RAID-5 Volumes (Overview)</olink>.</para>
</highlights><sect1 id="tasks-raid5-26"><title>RAID-5 Volumes (Task Map)</title><para>The following task map identifies the procedures that are needed to
manage Solaris Volume Manager's 5 volumes. </para><informaltable frame="all"><tgroup cols="3" colsep="1" rowsep="1"><colspec colname="colspec0" colwidth="110.00*"/><colspec colname="colspec1" colwidth="167.00*"/><colspec colname="colspec2" colwidth="119.00*"/><thead><row><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Create RAID-5 volumes</para>
</entry><entry><para>Use the Solaris Volume Manager GUI or the <command>metainit</command> command
to create RAID-5 volumes. </para>
</entry><entry><para><olink targetptr="addtasks-30654" remap="internal">How to Create a RAID-5 Volume</olink></para>
</entry>
</row><row><entry><para>Check the status of RAID-5 volumes</para>
</entry><entry><para>Use the Solaris Volume Manager GUI or the <command>metastat</command> command
to check the status of RAID-5 volumes. </para>
</entry><entry><para><olink targetptr="maintaintasksnew-28175" remap="internal">How to Check the Status of
a RAID-5 Volume</olink></para>
</entry>
</row><row><entry><para>Expand a RAID-5 volume</para>
</entry><entry><para>Use the Solaris Volume Manager GUI or the <command>metattach</command> command
to expand RAID-5 volumes. </para>
</entry><entry><para><olink targetptr="maintaintasksnew-13229" remap="internal">How to Expand a RAID-5 Volume</olink></para>
</entry>
</row><row><entry><para>Enable a slice in a RAID-5 volume</para>
</entry><entry><para>Use the Solaris Volume Manager GUI or the <command>metareplace</command> command
to enable slices in RAID-5 volumes. </para>
</entry><entry><para><olink targetptr="maintaintasksnew-31120" remap="internal">How to Enable a Component
in a RAID-5 Volume</olink></para>
</entry>
</row><row><entry><para>Replace a slice in a RAID-5 volume</para>
</entry><entry><para>Use the Solaris Volume Manager GUI or the <command>metareplace</command> command
to replace slices in RAID-5 volumes. </para>
</entry><entry><para><olink targetptr="maintaintasksnew-14708" remap="internal">How to Replace a Component
in a RAID-5 Volume</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="tasks-raid5-6"><title>Creating RAID-5 Volumes</title><caution><para>Do not create volumes larger than 1 Tbyte 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 the Solaris 9 4/03 release. See <olink targetptr="large-volume-overview" remap="internal">Overview of Multi-Terabyte Support in Solaris
Volume Manager</olink> for more information about large volume support in Solaris Volume Manager.</para>
</caution><task id="addtasks-30654"><title>How to Create a RAID-5 Volume</title><taskprerequisites><para>Check <olink targetptr="addtasks-20933" remap="internal">Prerequisites for Creating Solaris
Volume Manager Components</olink> and <olink targetptr="addtasks-25668" remap="internal">Background
Information for Creating RAID-5 Volumes</olink>.</para>
</taskprerequisites><procedure remap="single-step"><step id="tasks-raid5-step-9"><para>To create a RAID-5 volume, use one of
the following methods:</para><itemizedlist><listitem><para>From the Enhanced Storage tool within the Solaris Management Console, open the Volumes node. Choose Action&rArr;Create
Volume. Then, follow the steps in the wizard. For more information, see the
online help.</para>
</listitem><listitem><para>Use the following form of the <command>metainit</command> command:</para><screen># <userinput>metainit <replaceable>wolume-name</replaceable> -r <replaceable>component</replaceable> <replaceable>component</replaceable> <replaceable>component</replaceable> -i <replaceable>interlace-value</replaceable></userinput></screen><variablelist><varlistentry><term><replaceable>volume-name</replaceable></term><listitem><para>Specifies the name of the volume to create.</para>
</listitem>
</varlistentry><varlistentry><term><option>r</option></term><listitem><para>Specifies to create a RAID-5 volume.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>component</replaceable></term><listitem><para>Specifies a slice or soft partition to include in the RAID-5
volume. At least 3 components are required.</para>
</listitem>
</varlistentry><varlistentry><term><option>i</option></term><listitem><para>Specifies an interlace value.</para>
</listitem>
</varlistentry>
</variablelist><para>For more information, see the <olink targetdoc="refman1m" targetptr="metainit-1m" remap="external"><citerefentry><refentrytitle>metainit</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</listitem>
</itemizedlist>
</step>
</procedure><example id="egjxg"><title>Creating a RAID-5 Volume of Three Slices</title><para>In this example, the RAID-5 volume <filename>d45</filename> is created
with the <option>r</option> option from 3 slices. Because no interlace value
is specified, <filename>d45</filename> uses the default of 512 Kbytes.
The system verifies that the RAID-5 volume has been set up and begins initializing
the volume.</para><para>You must wait for the initialization to finish before you can use the
RAID-5 volume.</para><screen># <userinput>metainit d45 -r c2t3d0s2 c3t0d0s2 c4t0d0s2</userinput>
d45: RAID is setup</screen>
</example><taskrelated role="see-also"><para>To prepare the newly created RAID-5 volume for a file system, see <olink targetdoc="sagdfs" targetptr="fscreate-96442" remap="external">Chapter 18, <citetitle remap="chapter">Creating UFS, TMPFS, and LOFS File Systems (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Devices and File Systems</citetitle></olink>.
Some applications, such as a database, do not use a file system. These applications
instead use the raw volume. The application must have its own way of recognizing
the volume.</para><para>To associate a hot spare pool with a RAID-5 volume, see <olink targetptr="addtasks-32105" remap="internal">How to Associate a Hot Spare Pool With a Volume</olink>.</para>
</taskrelated>
</task>
</sect1><sect1 id="tasks-raid5-10"><title>Maintaining RAID-5 Volumes</title><task id="maintaintasksnew-28175"><title>How to Check the Status of a RAID-5
Volume</title><tasksummary><para>When checking status of RAID-5 volumes, you need to check both the RAID-5
state and the slice state to fully understand the state of the volume and
the possibility of data loss if the volumes are not in an Okay state. See <olink targetptr="egcls" remap="internal">Overview of Checking Status of RAID-5 Volumes</olink> for
details.</para><note><para>RAID-5 volume initialization or resynchronization cannot be interrupted. </para>
</note>
</tasksummary><procedure remap="single-step"><step id="tasks-raid5-step-12"><para>To check the status of a RAID-5 volume,
use one of the following methods:</para><itemizedlist><listitem><para>From the Enhanced Storage tool within the Solaris Management Console, open the Volumes node and view the status
of the volumes. Choose a volume. Then, choose Action&rArr;Properties to see
more detailed information. For more information, see the online help.</para>
</listitem><listitem><para>Use the <command>metastat</command> command to display the
status of a RAID-5 volume.</para><screen># <userinput>metastat [-s <replaceable>diskset</replaceable>] [<replaceable>volume</replaceable>]</userinput></screen><variablelist><varlistentry><term><option>s</option> <replaceable>diskset</replaceable></term><listitem><para>Specifies the name of the disk set on which to perform the
command.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>volume</replaceable></term><listitem><para>Specifies the volume to display.</para>
</listitem>
</varlistentry>
</variablelist><para>For each slice in the RAID-5 volume, the <command>metastat</command> command
shows the following:</para><variablelist><varlistentry><term>Device</term><listitem><para>Specifies the device name of the slice in the stripe.</para>
</listitem>
</varlistentry><varlistentry><term>Start Block</term><listitem><para>Specifies the block on which the slice begins.</para>
</listitem>
</varlistentry><varlistentry><term>Dbase</term><listitem><para>Specifies whether the slice contains a state database replica</para>
</listitem>
</varlistentry><varlistentry><term>State</term><listitem><para>Specifies the state of the slice.</para>
</listitem>
</varlistentry><varlistentry><term>Hot Spare</term><listitem><para>Specifies whether the slice is being used to hot spare a failed
slice</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</itemizedlist>
</step>
</procedure><example id="egjxh"><title>Viewing RAID-5 Volume Status</title><para>The following example shows RAID-5 volume output from the <command>metastat</command> command. </para><screen># <userinput>metastat d10</userinput>
d10: RAID
    State: Okay        
    Interlace: 32 blocks
    Size: 10080 blocks
Original device:
    Size: 10496 blocks
        Device              Start Block  Dbase State        Hot Spare
        c0t0d0s1                 330     No    Okay        
        c1t2d0s1                 330     No    Okay        
        c2t3d0s1                 330     No    Okay </screen><para>The <command>metastat</command> command output identifies the volume
as a RAID-5 volume. This information is indicated by the &ldquo;RAID&rdquo;
notation after the volume name. For each slice in the RAID-5 volume, the output
shows the following:</para><itemizedlist><listitem><para>The name of the slice in the stripe.</para>
</listitem><listitem><para>The block on which the slice begins.</para>
</listitem><listitem><para>An indicator that none of these slices contain a state database
replica.</para>
</listitem><listitem><para>The state of the slices. In this example all slices are in
the &ldquo;Okay&rdquo; state.</para>
</listitem><listitem><para>If a slice is a hot spare replacement for a failed slice.</para>
</listitem>
</itemizedlist>
</example>
</task><task id="maintaintasksnew-13229"><title>How to Expand a RAID-5 Volume</title><tasksummary><para>In general, attaching components is a short-term solution to a RAID-5
volume that is running out of space. For performance reasons, it is best to
have a &ldquo;pure&rdquo; RAID-5 volume. If you must expand an existing RAID-5
volume to gain extra storage space, use this procedure. </para><caution><para>Do not create volumes larger than 1 Tbyte if you expect to
run the Solaris software with a 32&ndash;bit kernel or if you expect to use
a version of the Solaris OS prior to the Solaris 9 4/03 release. See <olink targetptr="large-volume-overview" remap="internal">Overview of Multi-Terabyte Support in Solaris
Volume Manager</olink> for more information about multiterabyte volume support
in Solaris Volume Manager.</para>
</caution>
</tasksummary><taskprerequisites><para>Read <olink targetptr="addtasks-25668" remap="internal">Background Information for Creating
RAID-5 Volumes</olink>.</para>
</taskprerequisites><procedure><step id="tasks-raid5-step-26"><para>Make sure that you have a current backup
of all data and that you have superuser access.</para>
</step><step id="tasks-raid5-step-17"><para>To attach additional components to a
RAID-5 volume, use one of the following methods:</para><itemizedlist><listitem><para>From the Enhanced Storage tool within the Solaris Management Console, open the Volumes node, then open the RAID-5
volume. Choose the Components pane. Then, choose Attach Component. Follow
the onscreen instructions. For more information, see the online help.</para>
</listitem><listitem><para>Use the following form of the <command>metattach</command> command:</para><screen># <userinput>metattach <replaceable>volume-name</replaceable> <replaceable>name-of-component-to-add</replaceable></userinput></screen><variablelist><varlistentry><term><replaceable>volume-name</replaceable></term><listitem><para>Specifies the name of the RAID-5 volume to expand.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>name-of-component-to-add</replaceable></term><listitem><para>Specifies the name of the component to attach to the RAID-5
volume.</para>
</listitem>
</varlistentry>
</variablelist><para>See the <olink targetdoc="refman1m" targetptr="metattach-1m" remap="external"><citerefentry><refentrytitle>metattach</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page for more information. </para>
</listitem>
</itemizedlist>
</step>
</procedure><example id="egjxi"><title>Adding a Component to a RAID-5 Volume</title><para>The following example shows the addition of slice <filename>c2t1d0s2</filename> to
an existing RAID-5 volume, <filename>d2</filename>. </para><screen># <userinput>metattach d2 c2t1d0s2</userinput>
d2: column is attached</screen>
</example><taskrelated role="see-also"><para>For a UFS file system, run the <command>growfs</command> command on
the RAID-5 volume. See <olink targetptr="basics-18534" remap="internal">Volume and Disk Space
Expansion Using the growfs Command</olink>.</para><para>Some applications, such as a database, do not use a file system. These
applications instead use the raw volume. In these cases, the application must
have its own way of growing the added space.</para>
</taskrelated>
</task><task id="maintaintasksnew-31120"><title>How to Enable a Component in a RAID-5
Volume</title><tasksummary><para>If a disk drive is defective, you can replace it with another available
disk (and its slices) on the system as documented in <olink targetptr="maintaintasksnew-14708" remap="internal">How to Replace a Component in a RAID-5
Volume</olink>. Alternatively, you can repair the disk, label it, and run
the <command>metareplace</command> command with the <option>e</option> option
to re-enable the disk.</para>
</tasksummary><procedure><step id="tasks-raid5-step-260"><para>Make sure that you have a current backup
of all data and that you have superuser access.</para>
</step><step id="tasks-raid5-step-20"><para>To enable a failed component in a RAID-5
volume, use one of the following methods:</para><itemizedlist><listitem><para>From the Enhanced Storage tool within the Solaris Management Console, open the Volumes node, then open the RAID-5
volume. Choose the Components pane. Then, choose the failed component. Click
Enable Component. Follow the onscreen instructions. For more information,
see the online help.</para>
</listitem><listitem><para>Use the following form of the <command>metareplace</command> command:</para><screen># <userinput>metareplace -e <replaceable>volume-name</replaceable> <replaceable>component-name</replaceable></userinput></screen><variablelist><varlistentry><term><option>e</option></term><listitem><para>Specifies to place the failed component into an available
state and to perform a resynchronization on the failed component.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>volume-name</replaceable></term><listitem><para>Specifies the name of the volume containing the failed component.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>component-name</replaceable></term><listitem><para>Specifies the name of the failed component.</para>
</listitem>
</varlistentry>
</variablelist><para>The <command>metareplace</command> command automatically starts
resynchronizing the new component with the rest of the RAID-5 volume. </para>
</listitem>
</itemizedlist>
</step>
</procedure><example id="egjxj"><title>Enabling a Component in a RAID-5 Volume</title><para>In the following example, the RAID-5 volume <filename>d20</filename> has
a slice, <filename>c2t0d0s2</filename>, which had a soft error. The <command>metareplace</command> command with the <option>e</option> option enables the slice.</para><screen># <userinput>metareplace -e d20 c2t0d0s2</userinput></screen>
</example>
</task><task id="maintaintasksnew-14708"><title>How to Replace a Component in a RAID-5
Volume</title><tasksummary><para>This task replaces a failed slice of a RAID-5 volume in which only one
slice has failed.</para><caution><para>Replacing a failed slice when multiple slices are in error
might cause data to be fabricated. In this instance, the integrity of the
data in this instance would be questionable.</para>
</caution><para>You can use the <command>metareplace</command> command on non-failed
devices to change a disk slice or other component. This procedure can be useful
for tuning the performance of RAID-5 volumes.</para>
</tasksummary><procedure><step id="tasks-raid5-step-27"><para>Make sure that you have a current backup
of all data and that you have superuser access.</para>
</step><step id="tasks-raid5-step-23"><para>Use one of the following methods to determine
which slice of the RAID-5 volume needs to be replaced:</para><itemizedlist><listitem><para>From the Enhanced Storage tool within the Solaris Management Console, open the Volumes node. Then open the RAID-5
volume. Choose the Components pane. View the status of the individual components.
For more information, see the online help.</para>
</listitem><listitem><para>Use the <command>metastat</command> command.</para><screen># <userinput>metastat <replaceable>volume</replaceable></userinput></screen><variablelist><varlistentry><term><replaceable>volume</replaceable></term><listitem><para>Specifies the name of the RAID-5 volume.</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</itemizedlist><para>Look for the keyword phrase &ldquo;Needs Maintenance&rdquo; to identify
the state of the RAID-5 volume. Look for the keyword &ldquo;Maintenance&rdquo;
to identify the failed slice.</para>
</step><step id="tasks-raid5-step-24"><para>Use one of the following methods to replace
the failed slice with another slice:</para><itemizedlist><listitem><para>From the Enhanced Storage tool within the Solaris Management Console, open the Volumes node. Then open the RAID-5
volume. Choose the Components pane. Choose the failed component. Click Replace
Component and follow the onscreen instructions. For more information, see
the online help.</para>
</listitem><listitem><para>Use the following form of the <command>metareplace</command> command:</para><screen># <userinput>metareplace <replaceable>volume-name</replaceable> <replaceable>failed-component</replaceable> <replaceable>new-component</replaceable></userinput></screen><itemizedlist><listitem><para><replaceable>volume-name</replaceable> is the name of the
RAID-5 volume with a failed component.</para>
</listitem><listitem><para><replaceable>failed-component</replaceable> specifies the
name of the component to replace.</para>
</listitem><listitem><para><replaceable>new-component</replaceable> specifies the name
of the component to add to the volume in place of the failed component.</para>
</listitem>
</itemizedlist><para>See the <olink targetdoc="refman1m" targetptr="metareplace-1m" remap="external"><citerefentry><refentrytitle>metareplace</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page for more information.</para>
</listitem>
</itemizedlist>
</step><step id="tasks-raid5-step-25"><para>To verify the status of the replacement
slice, use one of the methods described in <olink targetptr="tasks-raid5-step-23" remap="internal">Step&nbsp;2</olink>.</para><para>The state of the replaced slice should be &ldquo;Resyncing&rdquo;
or &ldquo;Okay.&rdquo;</para>
</step>
</procedure><example id="egjxn"><title>Replacing a RAID-5 Component</title><screen># <userinput>metastat d1</userinput>
d1: RAID
State: Needs Maintenance
    Invoke: metareplace d1 c0t14d0s6 &lt;new device>
    Interlace: 32 blocks
    Size: 8087040 blocks
Original device:
    Size: 8087520 blocks
	Device              Start Block  Dbase State        Hot Spare
	c0t9d0s6                 330     No    Okay        
	c0t13d0s6                330     No    Okay        
	c0t10d0s6                330     No    Okay        
	c0t11d0s6                330     No    Okay        
	c0t12d0s6                330     No    Okay        
	c0t14d0s6                330     No    Maintenance
 
# <userinput>metareplace d1 c0t14d0s6 c0t4d0s6</userinput>
d1: device c0t14d0s6 is replaced with c0t4d0s6
# <userinput>metastat d1</userinput>
d1: RAID
    State: Resyncing
    Resync in progress: 98% done
    Interlace: 32 blocks
    Size: 8087040 blocks
Original device:
    Size: 8087520 blocks
	Device              Start Block  Dbase State        Hot Spare
	c0t9d0s6                 330     No    Okay        
	c0t13d0s6                330     No    Okay        
	c0t10d0s6                330     No    Okay        
	c0t11d0s6                330     No    Okay        
	c0t12d0s6                330     No    Okay
	c0t4d0s6                 330     No    Resyncing</screen><para>In this example, the <command>metastat</command> command displays
the failed slice in the RAID-5 volume, <filename>d1</filename>. After locating
an available slice, the <command>metareplace</command> command is run, specifying
the failed slice first, then the replacement slice.</para><para>If no other slices are available, run the <command>metareplace</command> command
with the <option>e</option> option to attempt to recover from possible soft
errors by resynchronizing the failed device. For more information on this
procedure, see <olink targetptr="maintaintasksnew-31120" remap="internal">How to Enable a Component
in a RAID-5 Volume</olink>. If multiple errors exist, the slice in the &ldquo;Maintenance&rdquo;
state must first be replaced or enabled. Then the slice in the &ldquo;Last
Erred&rdquo; state can be repaired. After running the <command>metareplace</command> command,
you can use the <command>metastat</command> command to monitor the progress
of the resynchronization. During the replacement, the state of the volume
and the new slice is &ldquo;Resyncing.&rdquo; You can continue to use the
volume while it is in this state.</para>
</example>
</task>
</sect1>
</chapter>