Replacing a failed SCSI disk in Solstice DiskSuite (no reboot)

This is a short article on how to replace a failed mirrored SCSI disk with Solstice DiskSuiite using command-line and without performing a reboot.

This procedure will work with both Solaris 8 and Solaris 9 running Solstice DiskSuite versions 4.2 or 4.2.1.

This article assumes that the failed disk is hot-swappable. If your system does NOT have hot-swappable drives, see the Solstice DiskSuite 4,2 SunSolve document for procedure, available here.

For this exmaple we are using c0t0d0 as the primary root (failed disk) and c0t1d0 as it's mirrored (working) disk.

  1. Firstly, collect the following output (safety in numbers)
    # metsatat >/var/tmp/metastat.out
    # metstat -p > /var/tmp/metastat-p.out
    # metadb -i > /var/tmp/metadb-i.out
  2. Identify the disk to replace by examining the metadb -i output. You will see a W in the flags fields associated with slice 7 of the disk with errors. You could also look at the output from the format command looking for the device name with <drive type unknown>. For this example we assume our faulty disk is c0t0d0
  3. Delete any metadevice state database replacias that are on the failed disk
    # metadb -d c0t0d0s7
    # metadb -i (confirming they have been removed)
  4. Using the metsatat output check the state of all submirrors on the failed disk confirming they are in a Needs maintenance state. This state indicates that Solstice DiskSuote has automatically disabled the submirrors so no need to perform a metadetach
  5. Physically replace the failed hot-swappable disk
  6. Partition the new disk by copying the partition table from the root mirror (c0t1d0s2) to the new disk (c0t0d0s2) using the following command:
    # dd if=/dev/rdsk/c0t1d0s2 of=/dev/rdsk/c0t0d0s2 count=16
  7. Verify the partition table was copied correctly by using the format command, select the corresponding disk and type p and p again to print the partition table.
  8. Recreate the metadevice state database replicas that were detached in step 3 from c0t0d0s7
    # metadb -a -f -c 3 /dev/dsk/c0t0d0s7
  9. Re-enable the submirrors
    # metareplace -e d0 c0t0d0s0
    # metareplace -e d1 c0t0d0s1
    # metareplace -e d3 c0t0d0s3
    # metareplace -e d5 c0t0d0s5
  10. Run metstat | grep sync to check the syncing status. When all syncing is complete, run metastat to verify the state of all submirrors are Okay.

This article assumes that the failed disk is hot-swappable. If your system does NOT have hot-swappable drives, see the Solstice DiskSuite 4,2 SunSolve document for procedure, available here.