Вы находитесь на странице: 1из 2

Replacing a Failed Disk in Solaris Mirror (SVM)

This one is about Solaris Volume Manager and all those meta commands you can think of..
(metadb, metadettach, metattach, metaclear etc)…

Yesterday we had to replace a failed disk that belongs to a mirror. The disk is running in a Sparc
Solaris 10 box. It’s a 72GB from Fujitsu

c1t1d0 Soft Errors: 440 Hard Errors: 12 Transport Errors: 124


Vendor: FUJITSU Product: MAY2073RCSUN72G Revision: 0501 Serial No: 0711S0935R
Size: 73.40GB <73400057856 bytes>

As you can see from the iostat -En command, the disk is spitting hard errors and must be
replaced before it can cause a lot more headache. It’s in c1t1, right.

Here’s what we’re supposed to do:

* we could delete the meta data base that corresponds to the failed disk
* detached the failed disk/slices to the mirror
* clear it
* unconfigure the disk
* replace the disk
* configure the disk
* create new meta device database
* Initialize the disk
* Attached it to mirror
* and sync

Here’s the detailed job:

Info:
metadb | grep c1t1
metadb –d c1t1d0s7

Detach:
metadetach d30 d32
metadetach d40 d42
metadetach d20 d22
metadetach d10 d12

metaclear d32
metaclear d42
metaclear d22
metaclear d12

Verify:
metastat -p | grep c1t1d0
metadb | grep c1t1d0
[root@localhost] /> cfgadm -al
Ap_Id Type Receptacle Occupant Condition
c0 scsi-bus connected configured unknown
c0::dsk/c0t0d0 CD-ROM connected configured unknown
c1 scsi-bus connected configured unknown
c1::dsk/c1t0d0 disk connected configured unknown
c1::dsk/c1t1d0 disk connected configured unknown
c1::dsk/c1t2d0 disk connected configured unknown
c1::dsk/c1t3d0 disk connected configured unknown
usb0/1 unknown empty unconfigured ok
usb0/2 unknown empty unconfigured ok
usb1/1.1 unknown empty unconfigured ok
usb1/1.2 unknown empty unconfigured ok
usb1/1.3 unknown empty unconfigured ok
usb1/1.4 unknown empty unconfigured ok
usb1/2 unknown empty unconfigured ok

Unconfigure:
cfgadm -c unconfigure c1::dsk/c1t1d0

Verify ulit, note the red text above:


cfgadm –al
SWAP DISK

Undo what has been done….

Configure:
cfgadm -c configure c1::dsk/c1t1d0

format (to label disk)

prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s – /dev/rdsk/c1t1d0s2

metadb -a –c 2 c1t1d0s7

Attach!!

metainit d32 1 1 c1t1d0s6


metainit d42 1 1 c1t1d0s4
metainit d22 1 1 c1t1d0s1
metainit d12 1 1 c1t1d0s0
metattach d30 d32
metattach d40 d42
metattach d20 d22
metattach d10 d12
metastat -p
metadevadm -u c1t1d0

And you’re done! Grab a cup of coffee and wait till the synchronization is done.