solaris lvm mirror – 스크랩

구성…
http://blog.naver.com/comki/100024647947
복구
http://www.brandonhutchinson.com/Replacing_a_disk_with_different_geometry_in_DiskSuite.html
내가 해본것.
원본디스크: c0t0d0s2 대상디스크: c0t1d0s2
원본디스크의 파티션 (7번 슬라이스는 md를 위한 공간으로 16MB잡았음)

partition> p
Current partition table (original):
Total disk cylinders available: 47994 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 root wm 352 – 27391 38.47GB (27040/0/0) 80687360
1 swap wu 0 – 351 512.88MB (352/0/0) 1050368
2 backup wm 0 – 47993 68.29GB (47994/0/0) 143214096
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 27392 – 34255 9.77GB (6864/0/0) 20482176
6 unassigned wm 34256 – 47982 19.53GB (13727/0/0) 40961368
7 unassigned wm 47983 – 47993 16.03MB (11/0/0) 32824

1. 디스크 미러 만들기
prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s – /dev/rdsk/c0t1d0s2
여기서 두 디스크의 모델이 서로 달라서 에러 발생. 이것은 두번째 문서를 참조하여, 같은 모델로 설정함.
format -> disk -> 1 -> type -> …..
디스크 파티션은 아래와 같음
/dev/dsk/c0t0d0s1 – – swap – no –
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no –
/dev/dsk/c0t0d0s5 /dev/rdsk/c0t0d0s5 /oracle ufs 2 yes –
/dev/dsk/c0t0d0s6 /dev/rdsk/c0t0d0s6 /oradata ufs 2 yes –
swap – /tmp tmpfs – yes –
작업내용
metadb -a -f -c 2 /dev/dsk/c0t0d0s7 /dev/dsk/c0t1d0s7
metainit -f d10 1 1 c0t0d0s0
metainit -f d20 1 1 c0t1d0s0
metainit d0 -m d10
metaroot d0
lockfs -fa
metainit -f d11 1 1 c0t0d0s1
metainit -f d21 1 1 c0t1d0s1
metainit d1 -m d11
metainit -f d 15 1 1 c0t0d0s5
metainit -f d15 1 1 c0t0d0s5
metainit -f d25 1 1 c0t1d0s5
metainit d5 -m d15
metainit -f d16 1 1 c0t0d0s6
metainit -f d26 1 1 c0t1d0s6
metainit d6 -m d16
/etc/vfstab 을 편집
/dev/md/dsk/d1 – – swap – no –
/dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no –
/dev/md/dsk/d5 /dev/md/rdsk/d5 /oracle ufs 2 yes –
/dev/md/dsk/d6 /dev/md/rdsk/d6 /oradata ufs 2 yes –
swap – /tmp tmpfs – yes –
그리고 재부팅 후 나머지 슬라이스를 메타디바이스에 추가해준다.
metattach d0 d20
metattach d1 d21
metattach d5 d25
metattach d6 d26
# metastat
d6: Mirror
Submirror 0: d16
State: Okay
Submirror 1: d26
State: Resyncing
Resync in progress: 17 % done
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 40961368 blocks (19 GB)
d16: Submirror of d6
State: Okay
Size: 40961368 blocks (19 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s6 0 No Okay Yes
d26: Submirror of d6
State: Resyncing
Size: 40961368 blocks (19 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t1d0s6 0 No Okay Yes
d5: Mirror
Submirror 0: d15
State: Okay
Submirror 1: d25
State: Resyncing
Resync in progress: 79 % done
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 20482176 blocks (9.8 GB)
d15: Submirror of d5
State: Okay
Size: 20482176 blocks (9.8 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s5 0 No Okay Yes
d25: Submirror of d5
State: Resyncing
Size: 20489378 blocks (9.8 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t1d0s5 0 No Resyncing Yes
d1: Mirror
Submirror 0: d11
State: Okay
Submirror 1: d21
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 1050368 blocks (512 MB)
d11: Submirror of d1
State: Okay
Size: 1050368 blocks (512 MB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s1 0 No Okay Yes
d21: Submirror of d1
State: Okay
Size: 1051466 blocks (513 MB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t1d0s1 0 No Okay Yes
d0: Mirror
Submirror 0: d10
State: Okay
Submirror 1: d20
State: Resyncing
Resync in progress: 0 % done
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 80687360 blocks (38 GB)
d10: Submirror of d0
State: Okay
Size: 80687360 blocks (38 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s0 0 No Okay Yes
d20: Submirror of d0
State: Resyncing
Size: 80687360 blocks (38 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t1d0s0 0 No Okay Yes

2. dd로 두번째 디스크 에러 유발
dd if=/dev/zero of=/dev/dsk/c0t1d0s2
이후, prtvtoc로 두번째 디스크의 파티션을 재 설정하고, 각각의 서브미러를 replace해준다.
metareplace -e d5 c0t1d0s5
metareplace -e d6 c0t1d0s6
metareplace -e d0 c0t1d0s0
metareplace -e d1 c0t1d0s1
만약 제대로 수행이 안된다면, 메타디바이스에서 분리(metadetach)후, 삭제(metaclear)하고, 다시 만들어줌(metainit)
metadetach -f d0 d20
metaclear d20
metainit -f d20 1 1 c0t1d0s0

답글 남기기

Your email address will not be published.