How to replace failed root disk under Oracle Solaris SVM


At this post, you will find some of the examples of replacing failed disk under Solaris volume manager. Not that failed disk is under a mirrored configuration.
 

#iostat -En|grep -i error
#metastat -c
d10 m 6.0GB d11 (maint) d12 >> swap
d11 s 6.0GB c1t1d0s1 (maint)
d12 s 6.0GB c1t2d0s1
d0 m 74GB d1 (maint) d2 >> root
d1 s 74GB c1t1d0s0 (maint)
d2 s 74GB c1t2d0s0

Step 1:Detach  device  maintenance state

You ‘ll get information about which disk is maintenance state then you need to remove the sub mirror in maintenance state.Use “metadetach” command.
 

#metadetach [mirror] [sub-mirror]
[shell]#metadetach d0 d1
#metadetach d10 d11

Step 2:Check metadb and remove db replicas which related to failed disk.
 

# metadb
flags first blk block count
a u 16 8192 /dev/dsk/c1t2d0s7
a u 8208 8192 /dev/dsk/c1t2d0s7
a u 16400 8192 /dev/dsk/c1t2d0s7
a u 16 8192 /dev/dsk/c1t1d0s7
a u 8208 8192 /dev/dsk/c1t1d0s7
a u 16400 8192 /dev/dsk/c1t1d0s7
#metadb -d /dev/dsk/c1t1d0s7[/shell]
Before replace broken disk we recommend to remove metadevices.
[shell]#metaclear d1
#metaclear d11

Step 3:Add new disk then scan to identify the new disk
 

#devfsadm -Cv

Step 4:Create  Vtoc  table for the  new disk

After new disk is dedected you need to add vtoc table which is same as mirror disk.If “prtvtoc” command failed use “format” to define vtoc table for the new disk.
 

#prtvtoc /dev/rdsk/c1t2d0s2 | fmthard -s – /dev/rdsk/c1t1d0s2

Step 5:Add new disk to Metadb
 

#metadb -afc 3 /dev/rdsk/c1t1d0s7

Step 6:Install boot block on ” 0″ slice of the new disk.
 

#installboot /usr/platform/sun4u/lib/fs/ufs/bootblk /dev/rdsk/c1t1d0s0

Step 7:Update device ID in SVM database
 

**If you removed metadevice with metaclear command at step 2,you don’t need this step. 
#metadevadm -u c1t1d0s2 

Step 8:Create new metadevice

**If you didn’t delete metadevices at step 2 , you don’t need this step.
 

#metainit d1 1 1 /dev/rdsk/c1t1d0s0
#metainit d11 1 1 /dev/rdsk/c1t1d0s1

Step 9:Add new metadevice to mirror .
 

#metattach d0 d1
#metattach d10 d11

Step 10: Check sync status.

# metastat -c
d10 m 6.0GB d11 (resync-53%) d12
d11 s 6.0GB c1t1d0s1
d12 s 6.0GB c1t2d0s1
d0 m 74GB d1 (resync-27%) d2
d1 s 74GB c1t1d0s0
d2 s 74GB c1t2d0s0

 

I'm a IT Infrastructure and Operations Architect with extensive experience and administration skills and works for Turk Telekom. I provide hardware and software support for the IT Infrastructure and Operations tasks.

205 Total Posts
Follow Me