How To Replace Failed Root Disk Under Solaris Volume Manager

http://techsupportpk.blogspot.com/2007/09/rootdisk.html

Check the Disk for Failures

# iostat -En | more
c0t0d0          Soft Errors: 1 Hard Errors: 14 Transport Errors: 13
Vendor: SEAGATE  Product: ST314670LSUN146G Revision: 045A Serial No: 2744ZFQB
Size: 146.80GB
Media Error: 11 Device Not Ready: 0 No Device: 2 Recoverable: 1
Illegal Request: 0 Predictive Failure Analysis: 0
c0t1d0          Soft Errors: 0 Hard Errors: 0 Transport Errors: 0

Compare the Serial Number (2744ZFQB) with the label on the physical disk to be sure.

Collect SDS information

# metadb -i
# metastat
# metastat -p

Save Partition Map

# prtvtoc /dev/rdsk/c0t0d0s2 > /var/tmp/c0t0d0s2.vtoc
Note: 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 -p
d0 -m d10 d20 1
d10 1 1 c0t0d0s0
d20 1 1 c0t1d0s0
d1 -m d11 d21 1
d11 1 1 c0t0d0s1
d21 1 1 c0t1d0s1
d3 -m d13 d23 1
d13 1 1 c0t0d0s3
d23 1 1 c0t1d0s3

Detatch and Clear affected Metadevices

# metadetach -f d0
# metadetach -f d1 d11
# metadetach -f d3 d13
# metaclear -f d10
# metaclear -f d11
# metaclear -f d13
Note: 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/c0t0d0s4

Unconfigure Disk (cfgadm)

# cfgadm -c unconfigure c0::dsk/c0t0d0

Replacing Disk

physically replace disk now

Recreate devices

# devfsadm -c disk

Generate New disk Label

# format
Searching for disks...done
c0t0d0: configured with capacity of 68.35GB
AVAILABLE 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,0
Specify disk (enter its number): 0
selecting c0t0d0
[disk formatted]
Disk not labeled.  Label it now? y

Write VTOC information to new disk

# fmthard -s /var/tmp/c0t0d0s2.vtoc /dev/rdsk/c0t0d0s2
fmthard:  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 c0t0d0

Recreate 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/c0t1d0s4

Reattach 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 d13

Create 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/c0t0d0s0
Note: 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
Powered by Blogger.