背景:某台机器作个几块单盘RAID0,能够理解成单盘单用,由于有RAID卡必需要作RAID才能识别到硬盘,因此单块盘也要作成RAID0。如今有块盘坏了,厂家换了新盘没重作,怎么恢复呢?缓存
一、查看全部磁盘的状态,这没啥好说的ui
./MegaCli64 -PDList -a0
二、有块盘Firmware state是Unconfigured(bad),这是今天要拯救的目标code
Enclosure Device ID: 0 Slot Number: 3 Device Id: 8 Sequence Number: 2 Media Error Count: 0 Other Error Count: 0 Predictive Failure Count: 0 Last Predictive Failure Event Seq Number: 0 PD Type: SATA Raw Size: 3.638 TB [0x1d1c0beb0 Sectors] Non Coerced Size: 3.637 TB [0x1d1b0beb0 Sectors] Coerced Size: 3.637 TB [0x1d1b00000 Sectors] Firmware state: Unconfigured(bad) SAS Address(0): 0x5001c45000785ca3 Connected Port Number: 0(path0) Inquiry Data: 手动马赛克 FDE Capable: Not Capable FDE Enable: Disable Secured: Unsecured Locked: Unlocked Foreign State: None Device Speed: Unknown Link Speed: Unknown Media Type: Hard Disk Device
三、可选:查看磁盘的缓存策略,每块盘一行,如今的结果应该少一行,由于少块盘it
./MegaCli64 -LDGetProp -Cache -Lall -a0
四、先让这块磁盘变成goodio
./MegaCli64 -PDMakeGood -PhysDrv[0:3] -a0 Adapter: 0: EnclId-0 SlotId-3 state changed to Unconfigured-Good. Exit Code: 0x00
这里-PhysDrv[0:3]对应上面的Enclosure Device ID和Slot Number,-a确定是Adapter #0,不太懂为啥盘要有Good/bad之分。再看磁盘的状态ast
Enclosure Device ID: 0 Slot Number: 3 Device Id: 8 Sequence Number: 3 Media Error Count: 0 Other Error Count: 0 Predictive Failure Count: 0 Last Predictive Failure Event Seq Number: 0 PD Type: SATA Raw Size: 3.638 TB [0x1d1c0beb0 Sectors] Non Coerced Size: 3.637 TB [0x1d1b0beb0 Sectors] Coerced Size: 3.637 TB [0x1d1b00000 Sectors] Firmware state: Unconfigured(good), Spun Up SAS Address(0): 0x5001c45000785ca3 Connected Port Number: 0(path0) Inquiry Data: 手动马赛克 FDE Capable: Not Capable FDE Enable: Disable Secured: Unsecured Locked: Unlocked Foreign State: Foreign Foreign Secure: Drive is not secured by a foreign lock key Device Speed: Unknown Link Speed: Unknown Media Type: Hard Disk Device
五、磁盘确实Good了,可是Foreign State变成了Foreign,须要清除ForeignList
./MegaCli64 -cfgforeign -clear -a0 Foreign configuration 0 is cleared on controller 0. Exit Code: 0x00
再看磁盘的状态closure
Enclosure Device ID: 0 Slot Number: 3 Device Id: 8 Sequence Number: 3 Media Error Count: 0 Other Error Count: 0 Predictive Failure Count: 0 Last Predictive Failure Event Seq Number: 0 PD Type: SATA Raw Size: 3.638 TB [0x1d1c0beb0 Sectors] Non Coerced Size: 3.637 TB [0x1d1b0beb0 Sectors] Coerced Size: 3.637 TB [0x1d1b00000 Sectors] Firmware state: Unconfigured(good), Spun Up SAS Address(0): 0x5001c45000785ca3 Connected Port Number: 0(path0) Inquiry Data: 手动马赛克 FDE Capable: Not Capable FDE Enable: Disable Secured: Unsecured Locked: Unlocked Foreign State: None Device Speed: Unknown Link Speed: Unknown Media Type: Hard Disk Device
六、如今再作RAID0dict
./MegaCli64 -cfgldadd -r0 [0:3] WB RA Direct -a0 Adapter 0: Created VD 马赛克 Adapter 0: Configured the Adapter!! Exit Code: 0x00
这时候再看./MegaCli64 -LDGetProp -Cache -Lall -a0,应该会多一行,对应上面的新VDdi