Solaris: metastat "need maintenance" state on a SAN

After a scheduled downtime, one of our Oracle server (SunFire V240) was started slightly before the SAN (Sun StorEdge D280) was fully operational. It resulted in I/O errors and a metastat in "need maintenance" state.
(Please notice I've truncated the output for an easier reading).

# metastat d200
d200: Mirror
Submirror 0: d201
State: Needs maintenance
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 566198272 blocks (269 GB)

d201: Submirror of d200
State: Needs maintenance
Invoke: after replacing "Maintenance" components:
metareplace d200 /dev/dsk/c3t600A...d0s0
Size: 566198272 blocks (269 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
/dev/dsk/c3t600B...d0s0 0 No Last Erred Yes
Stripe 1:
Device Start Block Dbase State Reloc Hot Spare
/dev/dsk/c3t600C...d0s0 8192 No Last Erred Yes
#

As you can see, it's a one-side mirror (easier when I need to consolidate multiple LUNs).
The metareplace command did not work:

# metareplace -e d200 /dev/dsk/c3t600A...d0s0
metareplace: sdmtl114: d200: attempt to replace a component on the last running submirror
#

There are two way to clear the maintenance state: the recommended one, ... and the last chance.
    The recommended way
  1. Do a backup
  2. Add another side to the mirror
  3. When sync'd, drop the "old" side and recreate it
  4. Once sync'd, drop the temporary side.

    The last chance
  1. Do a backup
  2. Drop the mirror: metaclear -f d200
  3. And recreate it: metainit d200 -m d201
  4. The maintance state should now be cleared:

    # metastat d200
    d200: Mirror
    Submirror 0: d201
    State: Okay
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 566198272 blocks (269 GB)

    d201: Submirror of d200
    State: Okay
    Size: 566198272 blocks (269 GB)
    Stripe 0:
    Device Start Block Dbase State Reloc Hot Spare
    /dev/dsk/c3t600B...d0s0 0 No Okay Yes
    Stripe 1:
    Device Start Block Dbase State Reloc Hot Spare
    /dev/dsk/c3t600C...d0s0 8192 No Okay Yes
    #


Of course, I'm not responsible if you loose any data. This worked for me, but has no guarantee it will work for you. However, it's rather good to know the trick.

Comments

Senthil said…
Thanks it worked me too...

Popular Posts