Replacing a failed disk - (old on still online and readable)
capture the vtoc from the disk:
prtvtoc /dev/rdsk/c4t0d0s2 > savedisk.vtoc
now check if it's part of the db:
metadb
metadb
flags first blk block count
a m p luo 16 1034 /dev/dsk/c2t0d0s7
a p luo 16 1034 /dev/dsk/c3t2d0s7
a p luo 16 1034 /dev/dsk/c3t3d0s7
a p luo 16 1034 /dev/dsk/c4t0d0s7
a p luo 16 1034 /dev/dsk/c4t1d0s7
a p luo 16 1034 /dev/dsk/c4t2d0s7
a p luo 16 1034 /dev/dsk/c4t3d0s7
ok it is so lets delete it:
metadb -d /dev/rdsk/c4t0d0s6
replace failed mech
import vtoc from saved file :
cat savedisk.vtoc|hmthard -s - /dev/rdsk/c4t0d0s2
recreate metadb (this option is for 2 copy on slice 6 , may not be required if you have more than 3 disks in the metadb - you can get arounf this with
metadb -a -c 2 /rdev/c4t0d0s6
find the degraded mirror:
Invoke: metareplace d5 c4t2d0s0
metastat|grep 'metareplace'
Now replace and resilver the mirrors:
metareplace -e d5 c4t2d0s0
Disk Replacement of dead mech
mostly the same as before but you need to force it
rebuild the vtoc (naturally you will have saved all the vtocs of the disks to a save place ;-) )
yank the disk out of the metadb
metadb -f -d /dev/rdsk/cXtYdZs6
metareplace -f d4 c4t3d0s0
Avoid database replica issues (more of value on root mirrors)
echo "set md:mirrored_root_flag=1" >> /etc/system
Corrupt boot block
boot from the mirror and do (or cd/net)
/usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/cXtYdZs0
Bogus Svm needs maintainance printed on metastat output
Sometimes if the svm sync has not been started correctly you will see
metastat d50
d50: Mirror
Submirror 0: d51
State: Needs maintenance
Submirror 1: d52
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 8405376 blocks (4.0 GB)
d51: Submirror of d50
State: Needs maintenance
Invoke: metareplace d50 c1t2d0s0
Size: 8405376 blocks (4.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t2d0s0 0 No Maintenance Yes
but iostat shows up clean !!
(you can use the format command to do a non destructive test if you like)
once tested or trusted ;-)
simply run svm sync - /etc/rc.local for older svm or /etc/rc2.d/svm.sync for newer versions
followed by
metareplace -e d50 cXtXdXsX to resync the mirrors.
metastat d50
d50: Mirror
Submirror 0: d51
State: Okay
Submirror 1: d52
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 8405376 blocks (4.0 GB)
http://dlc.sun.com/osol/docs/content/LOGVOLMGRADMIN/tasks-state-db-replicas-11.html#troubleshoottasks-31036