Friday, May 2, 2008

PROCEDURE FOR REPLACING MIRRORED DISKS

Given all of the above, the following set of commands should work in all cases (though depending on the system configuration, some commands may not be necessary):
To replace a Solaris VM-controlled disk which is part of a mirror, the following steps must be followed:

1. Run 'metadetach' to detach all submirrors on the failing disk from their
respective mirrors:
metadetach -f
Note: If the "-f" option is not used, the following message will be returned:
"Attempt an operation on a submirror that has erred component".
Then run 'metaclear' (**) on those submirror devices:
metaclear
Verify there are no existing metadevices left on the disk by running:
metastat -p grep c#t#d#

2. If there are any replicas on this disk, remove them using:
metadb -d c#t#d#s#
Verify there are no existing replicas left on the disk, by running:
metadb grep c#t#d#

3. If there are any open filesystems on this disk (not under Solaris VM
control), unmount them.

4. Run the 'cfgadm' command to remove the failed disk.
cfgadm -c unconfigure c#::dsk/c#t#d#

NOTE: Use the "cfgadm -al" command to obtain the variable "c#::dsk/c#t#d#".
The variable will be listed under the 'Ap_Id' column from the "cfgadm
-al" command's output.
NOTE: if the message "Hardware specific failure: failed to unconfigure SCSI
device: I/O error" appears, check to make sure that you cleared all
replicas and metadevices from the disk, and that the disk is not being
accessed.

5. Insert and configure the new disk.
cfgadm -c configure c#::dsk/c#t#d#
cfgadm -al (to confirm that disk is configured properly)

6. Run 'format' or 'prtvtoc' to put the desired partition table on the new disk

7. If necessary, recreate any replicas on the new disk:
metadb -a c#t#d#s#

8. Recreate each metadevice to be used as a submirror, then use 'metattach' to
attach those submirrors to the mirrors and start the resync.
NOTE: If the submirror was something other than a simple one-slice concat device, the metainit command will be different than shown here.
metainit 1 1
metattach

9. Run 'metadevadm' on the disk, which will update the New DevID.
metadevadm -u c#t#d#

No comments: