歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Unix知識 >> 關於Unix

恢復SDS中壞掉的一塊硬盤的數據


一、首先查看當前meta設備狀態:
# metastat >$HOME/metastat.0820
# more metastat.0820
d1:Mirror
Submirror 0:d11
State:Okay
Submirror 1:d12
State:Okay
Pass: 1
Read option: roundrobin(default)
Write option: parallerl(default)
Size:4274640 blocks
d 11: Submirror of d1
State:Okay
Hot spare pool: hsp000
Size: 4274640 blocks
Stripe 0:
Device Start Block Dbase State Hot spare
C0t0d0s0 0 No Okay
d 12: Submirror of d1
State:Okay
Hot spare pool: hsp000
Size: 4274640 blocks
Stripe 0:
Device Start Block Dbase State Hot spare
C3t0d0s0 0 No Okay c2t0d0s0
d2:Mirror
Submirror 0:d21
State:Okay
Submirror 1:d22
State:Okay
Pass: 1
Read option: roundrobin(default)
Write option: parallerl(default)
Size:2049840 blocks
d 21: Submirror of d2
State:Okay
Hot spare pool: hsp000
Size: 2049840 blocks
Stripe 0:
Device Start Block Dbase State Hot spare
C0t0d0s1 0 No Okay
d 22: Submirror of d2
State:Okay
Hot spare pool: hsp000
Size: 2049840 blocks
Stripe 0:
Device Start Block Dbase State Hot spare
C3t0d0s1 0 No Okay
d3:Mirror
Submirror 0:d31
State:Okay
Submirror 1:d32
State:Okay
Pass: 1
Read option: roundrobin(default)
Write option: parallerl(default)
Size:2049840 blocks
d 31: Submirror of d3
State:Okay
Hot spare pool: hsp000
Size: 2049840 blocks
Stripe 0:
Device Start Block Dbase State Hot spare
C0t0d0s3 0 No Okay
d 32: Submirror of d3
State:Okay
Hot spare pool: hsp000
Size: 2049840 blocks
Stripe 0:
Device Start Block Dbase State Hot spare
C3t0d0s3 0 No Okay
d4:Mirror
Submirror 0:d41
State:Okay
Submirror 1:d42
State:Okay
Pass: 1
Read option: roundrobin(default)
Write option: parallerl(default)
Size:11430153 blocks
d 41: Submirror of d4
State:Okay
Hot spare pool: hsp001
Size: 11430153 blocks
Stripe 0:
Device Start Block Dbase State Hot spare
C2t1d0s0 0 No Okay
d 42: Submirror of d4
State:Okay
Hot spare pool: hsp001
Size: 11430153 blocks
Stripe 0:
Device Start Block Dbase State Hot spare
C3t1d0s0 0 No Okay c0t1d0s0
d5:Mirror
Submirror 0:d51
State:Okay
Submirror 1:d52
State:Okay
Pass: 1
Read option: roundrobin(default)
Write option: parallerl(default)
Size:6244749 blocks
d 51: Submirror of d5
State:Okay
Hot spare pool: hsp001
Size: 6244749 blocks
Stripe 0:
Device Start Block Dbase State Hot spare
C2t1d0s1 0 No Okay
d 52: Submirror of d5
State:Okay
Hot spare pool: hsp001
Size: 6244749 blocks
Stripe 0:
Device Start Block Dbase State Hot spare
C3t1d0s1 0 No Maintence
Hsp000: 3 hot spares
C2t0d0s1 Available 2049840 blocks
C2t0d0s3 Available 2049840 blocks
C2t0d0s0 In use 4274640 blocks
Hsp001: 2 hot spares
C0t1d0s1 Available 2050461 blocks
C0t1d0s0 In use 15620850 blocks
確定meta設備 d52處於維護狀態,hsp001池中的hot spare處於使用中,替換了失敗的d52。
D52所在的硬盤為:c3t1d0,與這共在同硬盤的還有d42。將d42與d4分離,d52與d5分離:
# metadetach d4 d42
# metadetach d5 d52

二、拔出壞掉的硬盤:c3t1d0,在同一位置插入新的18G硬盤(因為沒有同樣大小的9G硬盤,所以,只好用18G硬盤來代替。其實,只要容量大於或等於原先硬盤容量就可以了,鏡像分區是絕對不能小地,要不,恢復不了地)。
# format
0. c0t0d0
/pci@1f,4000/scsi@3/sd@0,0
1. c0t0d0
/pci@1f,4000/scsi@3/sd@1,0
2. c2t0d0
/pci@6,4000/scsi@4/sd@0,0
3. c2t1d0
/pci@6,4000/scsi@4/sd@1,0
4. c3t0d0
/pci@6,4000/scsi@4,1/sd@0,0
5. c3t1d0
/pci@6,4000/scsi@4,1/sd@1,0
因為是c3t1d0與c2t1d0做的mirror,所以,要配置新硬盤的分區與c2t1d0相同。選擇3,查看分區情況
c2t1d0s0: root 5.45gb
c2t1d0s1: usr 2.98gb
c2t1d0s7: alternates 3.51mb
將新硬盤與原硬盤分區設置相同,然後進行下一步工作。

三、1.先把d4設備與新硬盤做連接
# metattach d4 d42
2.恢復壞掉的d5的submirror d52
# metareplace –e d5 c3t1d0s1
3.將spare設備重新放回到hot spare pool中
# metahs –e c0t1d0s0
(如果hot spare處於In Use狀態,則無法釋放,需要執行以下:
# metareplace –e d4 c3t1d0s0
# metareplace –e d1 c3t0d0s0

四、因為更換了新的硬盤,所以,原先硬盤上的復制的庫文件會丟失,應該對其進行修復。
1、 查看一下當前的復制數據庫情況:
# metadb –i
flags first blk block count


M p unknown unknown /dev/dsk/c3t1d0s7
2、 刪除無效的數據庫復制
# metadb –d –f /dev/dsk/c3t1d0s7
3、 確定一下是否被刪除
# metadb –I
4、 重啟之後,增加復制數據庫
# metadb –a –c 2 /dev/dsk/c3t1d0s7
這樣,整個的SDS的磁盤恢復算是完成了。
Copyright © Linux教程網 All Rights Reserved