SVM-3
What we will learn in next Few Pages
·
Replace failed disk in SVM
We will start from the last post, where we left everything messed
root@sol-test-1:>/# metastat -c
d5 m 2.3GB d41 (maint) d42
d41 s
2.3GB c1t0d0s4 (maint)
d42 s
2.3GB c1t1d0s4
d4 m 1.0GB d31 (maint) d32
d31 s
1.0GB c1t0d0s3 (maint)
d32 s
1.0GB c1t1d0s3
d3 m 1.0GB d21 (maint) d22
d21 s
1.0GB c1t0d0s1 (maint)
d22 s
1.0GB c1t1d0s1
d2 m 7.3GB d11 (maint) d12
d11 s
7.3GB c1t0d0s0 (maint)
d12 s
7.3GB c1t1d0s0
root@sol-test-1:>/# metadb
flags first blk block count
M Wm
p l 16 unknown /dev/dsk/c1t0d0s7
M W
p l 8208 unknown /dev/dsk/c1t0d0s7
M W
p l 16400 unknown /dev/dsk/c1t0d0s7
a m
p luo 16 8192 /dev/dsk/c1t1d0s7
a
p luo 8208 8192 /dev/dsk/c1t1d0s7
a
p luo 16400 8192 /dev/dsk/c1t1d0s7
SO what we need is to attach new disk, before that we have to remove
the state db replicas from failed disk,
root@sol-test-1:>/# metadb -d /dev/dsk/c1t0d0s7
root@sol-test-1:>/# metadb
flags first blk block count
a m p
luo 16 8192 /dev/dsk/c1t1d0s7
a p
luo 8208 8192 /dev/dsk/c1t1d0s7
a p
luo 16400 8192 /dev/dsk/c1t1d0s7
root@sol-test-1:>/# metastat -c
d5 m 2.3GB d41 (maint) d42
d41 s
2.3GB c1t0d0s4 (maint)
d42 s
2.3GB c1t1d0s4
d4 m 1.0GB d31 (maint) d32
d31 s
1.0GB c1t0d0s3 (maint)
d32 s
1.0GB c1t1d0s3
d3 m 1.0GB d21 (maint) d22
d21 s
1.0GB c1t0d0s1 (maint)
d22 s
1.0GB c1t1d0s1
d2 m 7.3GB d11 (maint) d12
d11 s
7.3GB c1t0d0s0 (maint)
d12 s
7.3GB c1t1d0s0
d41 from d5
d31 from d4
d21 from d3
d11 from d2
root@sol-test-1:>/# metadetach d2 d11
metadetach: sol-test-1: d2: attempt an operation on a submirror that
has erred components
root@sol-test-1:>/# metadetach -f d2 d11
d2: submirror d11 is detached
root@sol-test-1:>/# metadetach -f d3 d21
d3: submirror d21 is detached
root@sol-test-1:>/# metadetach -f d4 d31
d4: submirror d31 is detached
root@sol-test-1:>/# metadetach -f d5 d41
d5: submirror d41 is detached
root@sol-test-1:>/# metastat -c
d5 m 2.3GB d42
d42 s
2.3GB c1t1d0s4
d4 m 1.0GB
d32
d32 s
1.0GB c1t1d0s3
d3 m 1.0GB d22
d22 s
1.0GB c1t1d0s1
d2 m 7.3GB d12
d12 s
7.3GB c1t1d0s0
d41 s 2.3GB c1t0d0s4
d31 s 1.0GB c1t0d0s3
d21 s
1.0GB c1t0d0s1
d11 s 7.3GB c1t0d0s0
root@sol-test-1:>/# metastat -p
d5 -m d42 1
d42 1 1 c1t1d0s4
d4 -m d32 1
d32 1 1 c1t1d0s3
d3 -m d22 1
d22 1 1 c1t1d0s1
d2 -m d12 1
d12 1 1 c1t1d0s0
d41 1 1 c1t0d0s4
d31 1 1 c1t0d0s3
d21 1 1 c1t0d0s1
d11 1 1 c1t0d0s0
root@sol-test-1:>/# metaclear d11 d21 d31 d41
d11: Concat/Stripe is cleared
d21: Concat/Stripe is cleared
d31: Concat/Stripe is cleared
d41: Concat/Stripe is cleared
root@sol-test-1:>/# metastat -c
d5 m 2.3GB d42
d42 s
2.3GB c1t1d0s4
d4 m 1.0GB d32
d32 s
1.0GB c1t1d0s3
d3 m 1.0GB d22
d22 s
1.0GB c1t1d0s1
d2 m 7.3GB d12
d12 s
7.3GB c1t1d0s0
Now I had replaced the failed one with new disk of same size,
root@sol-test-1:>/# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c1t0d0 <DEFAULT
cyl 1564 alt 2 hd 255 sec 63>
/pci@0,0/pci15ad,1976@10/sd@0,0
1. c1t1d0 <DEFAULT
cyl 1563 alt 2 hd 255 sec 63>
/pci@0,0/pci15ad,1976@10/sd@1,0
2. c1t2d0 <DEFAULT
cyl 1563 alt 2 hd 255 sec 63>
/pci@0,0/pci15ad,1976@10/sd@2,0
Specify disk (enter its number): ^C
It is c1t0d0,
Now we need to replicate the prtvtoc of 2nd disk to new
disk
root@sol-test-1:>/# prtvtoc /dev/rdsk/c1t1d0s2 |fmthard -s -
/dev/rdsk/c1t0d0s2
fmthard: Partition 2 specifies the full disk and is not equal
full size of disk. The full
disk capacity is 25125660 sectors.
fmthard: New volume table of
contents now in place.
Now we need to create state db for new disk
root@sol-test-1:>/# metadb -afc 3 /dev/dsk/c1t0d0s7
root@sol-test-1:>/# metadb
flags first blk block count
a u 16 8192 /dev/dsk/c1t0d0s7
a u 8208 8192 /dev/dsk/c1t0d0s7
a u 16400 8192 /dev/dsk/c1t0d0s7
a m p
luo 16 8192 /dev/dsk/c1t1d0s7
a p
luo 8208 8192 /dev/dsk/c1t1d0s7
a p
luo 16400 8192 /dev/dsk/c1t1d0s7
Now we need to create sub mirrors from New disk,
d41 c1t0d0s4
d31 c1t0d0s3
d21 c1t0d0s1
d11 c1t0d0s0
root@sol-test-1:>/# metainit d11 1 1 c1t0d0s0
d11: Concat/Stripe is setup
root@sol-test-1:>/# metainit d21 1 1 c1t0d0s1
d21: Concat/Stripe is setup
root@sol-test-1:>/# metainit d31 1 1 c1t0d0s3
d31: Concat/Stripe is setup
root@sol-test-1:>/# metainit d41 1 1 c1t0d0s4
d41: Concat/Stripe is setup
Sub mirrors are created
Now we need to attach these with their respective metadevices
d41 d5
d31 d4
d21 d3
d11 d2
root@sol-test-1:>/# metattach d5 d41
d5: submirror d41 is attached
root@sol-test-1:>/# metastat -ac
d5 m 2.3GB d42 d41 (resync-46%)
d42 s
2.3GB c1t1d0s4
d41 s
2.3GB c1t0d0s4
root@sol-test-1:>/# metattach d4 d31
d4: submirror d31 is attached
root@sol-test-1:>/# metastat –ac
d4 m 1.0GB d32 d31 (resync-67%)
d32 s
1.0GB c1t1d0s3
d31 s
1.0GB c1t0d0s3
root@sol-test-1:>/# metattach d3 d21
d3: submirror d21 is attached
root@sol-test-1:>/# metastat -ac |grep -i sync
d3 m 1.0GB
d22 d21 (resync-14%)
root@sol-test-1:>/# metattach d2 d11
d2: submirror d11 is attached
root@sol-test-1:>/# metastat -ac |grep -i sync
d2 m 7.3GB d12 d11 (resync-4%)
B’coz the device (disk) has been changed so we suppose to update the
new device id
root@sol-test-1:>/# metadevadm -u c1t0d0
Updating Solaris Volume Manager device relocation information for
c1t0d0
Old device reloc information:
id1,sd@n6000c29ccd1569b342290faaca3adfd4
New device reloc information:
id1,sd@n6000c29ccd1569b342290faaca3adfd4
root@sol-test-1:>/# metastat -c
d5 m 2.3GB d42 d41
d42 s
2.3GB c1t1d0s4
d41 s
2.3GB c1t0d0s4
d4 m 1.0GB d32 d31
d32 s
1.0GB c1t1d0s3
d31 s
1.0GB c1t0d0s3
d3 m 1.0GB d22 d21
d22 s
1.0GB c1t1d0s1
d21 s
1.0GB c1t0d0s1
d2 m 7.3GB d12 d11
d12 s
7.3GB c1t1d0s0
d11 s
7.3GB c1t0d0s0
It seems that everything is OK now!
Does it?
Check yourself…
No comments:
Post a Comment