恢復SDS中壞掉的一塊硬碟的資料(轉)

ba發表於2007-08-15
恢復SDS中壞掉的一塊硬碟的資料(轉)[@more@]一、首先檢視當前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的磁碟恢復算是完成了。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10617731/viewspace-959100/,如需轉載,請註明出處,否則將追究法律責任。

相關文章