Check the Disk for Failures
# iostat -En | morec0t0d0 Soft Errors: 1 Hard Errors: 14 Transport Errors: 13Vendor: SEAGATE Product: ST314670LSUN146G Revision: 045A Serial No: 2744ZFQBSize: 146.80GB Media Error: 11 Device Not Ready: 0 No Device: 2 Recoverable: 1Illegal Request: 0 Predictive Failure Analysis: 0c0t1d0 Soft Errors: 0 Hard Errors: 0 Transport Errors: 0Compare the Serial Number (2744ZFQB) with the label on the physical disk to be sure.
Collect SDS information
# metadb -i# metastat# metastat -pSave Partition Map
# prtvtoc /dev/rdsk/c0t0d0s2 > /var/tmp/c0t0d0s2.vtocNote: if the prtvtoc is not responding or hanging due the device is not accessible anymore then use the prtvtoc from the mirror.Identify affected Metadevices
# metastat -pd0 -m d10 d20 1d10 1 1 c0t0d0s0d20 1 1 c0t1d0s0d1 -m d11 d21 1d11 1 1 c0t0d0s1d21 1 1 c0t1d0s1d3 -m d13 d23 1d13 1 1 c0t0d0s3d23 1 1 c0t1d0s3Detatch and Clear affected Metadevices
# metadetach -f d0# metadetach -f d1 d11# metadetach -f d3 d13# metaclear -f d10# metaclear -f d11# metaclear -f d13Note: If the disk device is not accessible anymore the “metaclear” command might hang.Delete Meta Databases
# metadb flags first blk block count a m p luo 16 1034 /dev/dsk/c0t0d0s4 a p luo 1050 1034 /dev/dsk/c0t0d0s4 a p luo 2084 1034 /dev/dsk/c0t0d0s4 a p luo 16 1034 /dev/dsk/c0t1d0s4 a p luo 1050 1034 /dev/dsk/c0t1d0s4 a p luo 2084 1034 /dev/dsk/c0t1d0s4# metadb -df /dev/dsk/c0t0d0s4Unconfigure Disk (cfgadm)
# cfgadm -c unconfigure c0::dsk/c0t0d0Replacing Disk
physically replace disk nowRecreate devices
# devfsadm -c disk Generate New disk Label
# formatSearching for disks...donec0t0d0: configured with capacity of 68.35GBAVAILABLE DISK SELECTIONS: 0. c0t0d0 /pci@780/pci@0/pci@9/scsi@0/sd@0,0 1. c0t1d0 /pci@780/pci@0/pci@9/scsi@0/sd@1,0Specify disk (enter its number): 0selecting c0t0d0[disk formatted]Disk not labeled. Label it now? yWrite VTOC information to new disk
# fmthard -s /var/tmp/c0t0d0s2.vtoc /dev/rdsk/c0t0d0s2fmthard: New volume table of contents now in place.Update DevID (Solaris 10 only)
Run ‘metadevadm’ on the disk, which will update the New DevID. NOTE: not needed if disk has been removed with metadetach and metaclear before# metadevadm -u c0t0d0Recreate Meta Databases
# metadb -afc 3 c0t0d0s4# metadb flags first blk block count a u 16 1034 /dev/dsk/c0t0d0s4 a u 1050 1034 /dev/dsk/c0t0d0s4 a u 2084 1034 /dev/dsk/c0t0d0s4 a p luo 16 1034 /dev/dsk/c0t1d0s4 a p luo 1050 1034 /dev/dsk/c0t1d0s4 a p luo 2084 1034 /dev/dsk/c0t1d0s4Reattach Metadevices
If you where not able to run the “metaclear” command prior replacing the disk. Run the “metaclear” commands for all submirrors of the replaced disk now# metaclear -f d10# metaclear -f d11# metaclear -f d13
Configure metadevices and attach the metadevices to the mirror
# metainit d10 1 1 c0t0d0s0# metattach d0 d10# metainit d11 1 1 c0t0d0s1# metattach d1 d11# metainit d13 1 1 c0t0d0s3# metattach d3 d13Create Bootblock
This command installboot - install bootblocks in a disk partition, just to be secure# installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t0d0s0Note: DO NOT reboot the server while any syncs are in progress, as this can potentially cause file system corruption, or at least confuse Solstice Disksuite/Solaris Volume Manager software. When possible run only one metattach at a time per physical disk to prevent disk thrashing.Check the metastat output
# metastat 