Solaris Volume Manager (SVM) x86 How to Replace a Failed, SCSI Disk, Mirrored with SVM

Verify failed disk (in this example, c1t0d0 is the failed disk)

# metastat -c

#format

#tail /var/adm/messages

# metastat -c (We can see that the disk is no longer an active member of the mirror.)

 

Remove failed disk from existing mirror group

# metadetach <mirror> <submirror>

# iostat -iEn c1t0d0

#cfgadm -al

# cfgadm -c unconfigure c1::dsk/c1t0d0

Maybe there is a need to delete the metadb with ‘metadb -d c1t0d0s7’ before ‘cfgadm -c unconfigure …’ can complete.

This command will remove the block and character (raw) device nodes the symbolic links in /dev/[r]dsk point to.

Physically replace the disk. Configure the new disk back into Solaris.

# cfgadm -c configure c1::dsk/c1t0d0

# ls -lL /dev/dsk/c1t0d0s* <— check the device nodes
# ls -lL /dev/rdsk/c1t0d0s*

# format

# iostat -iEn c1t0d0

if boot disk, run below:
# fdisk -b /usr/lib/fs/ufs/mboot /dev/rdsk/c1t0d0p0

if not, run below:
# fdisk /dev/rdsk/c1t0d0p0
# prtvtoc /dev/rdsk/c1t1d0s2 | fmthard -s – /dev/rdsk/c1t0d0s2
# /sbin/installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c1t0d0s0
# metadb
# metadb -d /dev/dsk/c1t0d0s7 <—-remove old metadb replicas
# metadb -a -c3 /dev/dsk/c1t0d0s7 <—re-add new metadb replicas
# metadb
# metadevadm -u c1t0d0

#metainit -f d11 1 1 c1t0d0s0
#metainit -f d21 1 1 c1t0d0s1
#metainit -f d31 1 1 c1t0d0s3

#metattach d10 d11
#metattach d20 d21
#metattach d30 d31

#metastat -c     (below is the sample output)

d20        m 525MB d22 d21 (resync-19%)
d22 s 525MB c0d0s1
d21 s 525MB c0d1s1
d30        m 211MB d32 d31 (resync-33%)
d32 s 211MB c0d0s7
d31 s 211MB c0d1s7
d10       m 8.2GB d12 d11 (resync-0%)
d12 s 8.2GB c0d0s0
d11 s 8.2GB c0d1s0