Wednesday, January 14, 2009

PROCEDURE FOR REPLACING MIRRORED DISKS

Given all of the above, the following set of commands should work in all cases
(although depending on the system configuration, some of the 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: 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 in the new disk.
cfgadm -c configure c#::dsk/c#t#d# cfgadm -al (just 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, and use 'metattach' to attach those submirrors to the mirrors, to 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#
NOTE: If you get the message "Open of /dev/dsk/c#t#d#s0 failed", it can safely be ignored(this is a known bug pending a fix).

Here is an example for disk replacement on sedm3134. The failed disk is c0t0d0

Failed Disk: c0t0d0
Mirrored copy: c0t1d0
metadb -d c0t0d0s7
metadetach d10 d11
metadetach d20 d21
metadetach d30 d31
metadetach d40 d41
metaclear d11
metaclear d21
metaclear d31
metaclear d41
metastat -p grep c0t0d0
metadbgrep c0t0d0
cfgadm -al
cfgadm -c unconfigure c0::dsk/c0t0d0 à This command failed because dump device was on /dev/dsk/c0t0d0s1. Changed dump device
dumpadm
dumpadm -d /dev/dsk/c0t1d0s1
cfgadm -c unconfigure c0::dsk/c0t0d0
####
(If you are getting an error message stating that disk is in use by Veritas even though it's not under Veritas control, follow the the following steps before unconfigure the disk:
mv /usr/lib/rcm/scripts/es_rcm.pl /usr/lib/rcm/scripts/DONTUSE
mv /etc/vx/es_scripts/es_rcm.pl /etc/vx/es_scripts/DONTUSE
vxdctl stop
cfgadm -c unconfigure c0::dsk/c0t0d0
vxconfigd -m boot
vxdctl enable
mv /usr/lib/rcm/scripts/DONTUSE /usr/lib/rcm/scripts/es_rcm.pl
mv /etc/vx/es_scripts/DONTUSE /etc/vx/es_scripts/es_rcm.pl
####

cfgadm –al
Here, we replaced the failed disk and ran the following commands:
cfgadm -c configure c0::dsk/c0t0d0
cfgadm -al
prtvtoc /dev/rdsk/c0t1d0s2 fmthard -s - /dev/rdsk/c0t0d0s2
metadb -a –c 2 c0t0d0s7
metainit d11 1 1 c0t0d0s0
metainit d21 1 1 c0t0d0s1
metainit d31 1 1 c0t0d0s6
metainit d41 1 1 c0t0d0s4
metattach d10 d11
metattach d20 d21
metattach d30 d31
metattach d40 d41
metastat -p
metadevadm -u c0t0d0

Readers who read this page, also read:




Bookmark and Share My Zimbio http://www.wikio.com

0 comments: