Responding to RAID-1 Volume Component Failures

How to Replace a Slice in a Submirror

Read Overview of Replacing and Enabling Components in RAID-1 and RAID-5 Volumes and Creating and Maintaining RAID-1 Volumes.

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

  2. Use the metastat command to view the status of the RAID-1 volume and associated submirrors.

    # metastat mirror-name
    
    
  3. Use one of the following methods to replace a slice in a submirror.

    • From the Enhanced Storage tool within the Solaris Management Console, open the Volumes node. Choose the mirror. Then, choose Action⇒Properties and click the Submirror tab. Follow the onscreen instructions. For more information, see the online help.

    • Use the following form of the metareplace command to replace a slice in a submirror:

      # metareplace mirror-name component-name
      
      
      • mirror-name is the name of the volume to create.

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

      mirror-name

      Specifies the name of the volume to create

      component-name

      Specifies the name of the component to replace

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

Example 11.19. Replacing a Failed Slice in a Mirror

The following example illustrates how to replace a failed slice when the system is not configured to use hot spare pools for the automatic replacement of failed disks. See Chapter 16, Hot Spare Pools (Overview) for more information about using hot spare pools.

# metastat d6
d6: Mirror
    Submirror 0: d16
      State: Okay        
    Submirror 1: d26
      State: Needs maintenance
...
d26: Submirror of d6
    State: Needs maintenance
    Invoke: metareplace d6 c0t2d0s2 <new device>
...
# metareplace d6 c0t2d0s2 c0t2d2s2
d6: device c0t2d0s2 is replaced with c0t2d2s2

The metastat command confirms that mirror d6 has a submirror, d26, with a slice in the “Needs maintenance” state. The metareplace command replaces the slice as specified in the “Invoke” line of the metastat output with another available slice on the system. The system confirms that the slice is replaced, and starts resynchronizing the submirror.

How to Replace a Submirror

Read Overview of Replacing and Enabling Components in RAID-1 and RAID-5 Volumes and Creating and Maintaining RAID-1 Volumes.

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

  2. Use the metastat command to view the status of the RAID-1 volume and associated submirrors.

    # metastat mirror-name
    
    
  3. Use one of the following methods to replace a submirror.

    • From the Enhanced Storage tool within the Solaris Management Console, open the Volumes node. Choose the mirror. Then, choose Action⇒Properties and click the Submirror tab. Follow the onscreen instructions. For more information, see the online help.

    • Use the metadetach, metaclear, metatinit, and metattach commands to replace an entire submirror.

      1. Use the metadetach command to the failed submirror from the mirror.

        # metadetach -f mirror-name submirror
        
        
        f

        Forces the detach to occur

        mirror-name

        Specifies the name of the mirror

        submirror

        Specifies the submirror to detach

      2. Use the metaclear command to delete the submirror.

        # metaclear -f submirror
        
        
        f

        Forces the deletion of the submirror to occur

        submirror

        Specifies the submirror to delete

      3. Use the metainit command to create a new submirror.

        # metainit volume-name number-of-stripes components-per-stripe component-name
        
        
        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. This example uses the root slice, c0t0d0s0.

      4. Use the metattach command to attach the new submirror.

        # metattach mirror submirror
        
        

Example 11.20. Replacing a Submirror in a Mirror

The following example illustrates how to replace a submirror in an active mirror.

# metastat d20
d20: Mirror
    Submirror 0: d21
      State: Okay        
    Submirror 1: d22
      State: Needs maintenance
...
# metadetach -f d20 d22
d20: submirror d22 is detached
# metaclear -f d22
d22: Concat/Stripe is cleared
# metainit d22 2 1 c1t0d0s2 1 c1t0d1s2
d22: Concat/Stripe is setup
# metattach d20 d22
d20: components are attached

In this example, the metastat command confirms that the two-way mirror, d20, has a submirror, d22, in the “Needs maintenance” state. In this case, the entire submirror needs to be cleared and recreated. The metadetach command detaches the failed submirror from the mirror by using the f option, which forces the detachment to occur. The metaclear command clears the submirror. The metainit command recreates submirror, d22, with new slices. Finally, the metattach command attaches the rebuilt submirror. A mirror resynchronization begins automatically.

The specific configuration of the new volume, d22, depends on the component you are replacing. A concatenation, as shown here, can sufficiently replace a concatenation. However, a concatenation would not be an ideal replacement for a stripe because it could impact performance.

You temporarily lose the capability for data redundancy while the mirror is a one-way mirror.