Solaris Volume Manager Administration Guide

ProcedureHow to Replace a Component in a RAID 5 Volume

This task replaces a failed slice of a RAID 5 volume in which only one slice has failed.


Caution – Caution –

Replacing a failed slice when multiple slices are in error might cause data to be fabricated. The integrity of the data in this instance would be questionable.


You can use the metareplace 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.

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

  2. Use one of the following methods to determine which slice of the RAID 5 volume needs to be replaced:

    • 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 view the status of the individual components. For more information, see the online help.

    • Use the metastat command.

    Look for the keyword “Maintenance” to identify the failed slice.

  3. Use one of the following methods to replace the failed slice with another slice:

    • 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 Replace Component and follow the instructions. For more information, see the online help.

    • Use the following form of the metareplace command:


      metareplace volume-name failed-component new-component
      
      • volume-name is the name of the volume with a failed component.

      • failed-component specifies the name of the component to replace.

      • new-component specifies the name of the component to add to the volume in place of the failed component.

      See the metareplace(1M) man page for more information.

  4. To verify the status of the replacement slice, use one of the methods described in Step 2.

    The state of the replaced slice should be “Resyncing” or “Okay”.


Example 15–5 Replacing a RAID 5 Component


# metastat d1
d1: RAID
State: Needs Maintenance
    Invoke: metareplace d1 c0t14d0s6 <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
 
# metareplace d1 c0t14d0s6 c0t4d0s6
d1: device c0t14d0s6 is replaced with c0t4d0s6
# metastat d1
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

In this example, the metastat command displays the action to take to recover from the failed slice in the d1 RAID 5 volume. After locating an available slice, the metareplace command is run, specifying the failed slice first, then the replacement slice. (If no other slices are available, run the metareplace command with the -e option to attempt to recover from possible soft errors by resynchronizing the failed device.) If multiple errors exist, the slice in the “Maintenance” state must first be replaced or enabled. Then the slice in the “Last Erred” state can be repaired. After the metareplace command, the metastat command monitors the progress of the resynchronization. During the replacement, the state of the volume and the new slice will is “Resyncing.” You can continue to use the volume while it is in this state.