Solstice DiskSuite 4.2.1 User's Guide

How to Replace a Failed SCSI Disk (Command Line)

The high-level steps to replace a SCSI disk that is not part of a SPARCstorage Array are:

  1. Identify the disk to be replaced by examining /var/adm/messages and metastat output.

  2. Locate any local metadevice state database replicas that may have been placed on the problem disk. Use the metadb command to find the replicas.

    Errors may be reported for the replicas located on the failed disk. In this example, c0t1d0 is the problem device.

    # metadb
       flags       first blk        block count
      a m     u        16               1034            /dev/dsk/c0t0d0s4
      a       u        1050             1034            /dev/dsk/c0t0d0s4
      a       u        2084             1034            /dev/dsk/c0t0d0s4
      W   pc luo       16               1034            /dev/dsk/c0t1d0s4
      W   pc luo       1050             1034            /dev/dsk/c0t1d0s4
      W   pc luo       2084             1034            /dev/dsk/c0t1d0s4

    The output above shows three state database replicas on Slice 4 of each of the local disks, c0t0d0 and c0t1d0. The W in the flags field of the c0t1d0s4 slice indicates that the device has write errors. Three replicas on the c0t0d0s4 slice are still good.

    Caution - Caution -

    If, after deleting the bad state database replicas, you are left with three or less, add more state database replicas before continuing. This will ensure that your system reboots correctly.

  3. Record the slice name where the replicas reside and the number of replicas, then delete the state database replicas.

    The number of replicas is obtained by counting the number of appearances of a slice in metadb output in Step 2. In this example, the three state database replicas that exist on c0t1d0s4 are deleted.

    # metadb -d c0t1d0s4
  4. Locate any submirrors using slices on the problem disk and detach them.

    The metastat command can show the affected mirrors. In this example, one submirror, d10, is also using c0t1d0s4. The mirror is d20.

    # metadetach d20 d10
    d20: submirror d10 is detached
  5. Delete hot spares on the problem disk.

    # metahs -d hsp000 c0t1d0s6
    hsp000: Hotspare is deleted
  6. Halt the system and boot to single-user mode.

    # halt
    ok boot -s
  7. Physically replace the problem disk.

  8. Repartition the new disk.

    Use the format(1M) command or the fmthard(1M) command to partition the disk with the same slice information as the failed disk.

  9. If you deleted replicas in Step 3, add the same number back to the appropriate slice.

    In this example, /dev/dsk/c0t1d0s4 is used.

    # metadb -a c 3 c0t1d0s4
  10. Depending on how the disk was used, you may have a variety of things to do. Use the following table to decide what to do next.

    Table 7-2 SCSI Disk Replacement Decision Table

    Type of Device 

    Do the Following ... 


    Use normal data recovery procedures. 

    Unmirrored Stripe or Concatenation 

    If the stripe/concat is used for a file system, run newfs(1M), mount the file system then restore data from backup. If the stripe/concat is used as an application that uses the raw device, that application must have its own recovery procedures.

    Mirror (Submirror) 

    Run metattach(1M) to reattach a detached submirror.

    RAID5 metadevice 

    Run metareplace(1M) to re-enable the slice. This causes the resyncs to start.

    Trans metadevice 

    Run fsck(1M) to repair the trans metadevice.

  11. Replace hot spares that were deleted, and add them to the appropriate hot spare pool(s).

    # metahs -a hsp000 c0t0d0s6
    hsp000: Hotspare is added
  12. Validate the data.

    Check the user/application data on all metadevices. You may have to run an application-level consistency checker or use some other method to check the data.