This task replaces a failed slice of a RAID-5 volume in which only one slice has failed.
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.
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.
Make sure that you have a current backup of all data and that you have superuser access.
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. View the status of the individual components. For more information, see the online help.
Use the metastat command.
# metastat volume
Specifies the name of the RAID-5 volume.
Look for the keyword phrase “Needs Maintenance” to identify the state of the RAID-5 volume. Look for the keyword “Maintenance” to identify the failed slice.
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. Choose the failed component. Click Replace Component and follow the onscreen 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 RAID-5 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.
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.”
# 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 failed slice in the RAID-5 volume, d1. 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. For more information on this procedure, see How to Enable a Component in a RAID-5 Volume. 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 running the metareplace command, you can use the metastat command to monitor the progress of the resynchronization. During the replacement, the state of the volume and the new slice is “Resyncing.” You can continue to use the volume while it is in this state.