MegaCli修复单盘RAID0

背景:某台机器做个几块单盘RAID0,可以理解成单盘单用,因为有RAID卡必须要做RAID才能识别到硬盘,所以单块盘也要做成RAID0。现在有块盘坏了,厂家换了新盘没重做,怎么恢复呢?

1、查看所有磁盘的状态,这没啥好说的

./MegaCli64 -PDList -a0

2、有块盘Firmware state是Unconfigured(bad),这是今天要拯救的目标

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

3、可选:查看磁盘的缓存策略,每块盘一行,现在的结果应该少一行,因为少块盘

./MegaCli64 -LDGetProp -Cache -Lall -a0

4、先让这块磁盘变成good

./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之分。再看磁盘的状态

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

5、磁盘确实Good了,但是Foreign State变成了Foreign,需要清除Foreign

./MegaCli64 -cfgforeign -clear -a0

Foreign configuration 0 is cleared on controller 0.

Exit Code: 0x00

再看磁盘的状态

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

6、现在再做RAID0

./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,应该会多一行,对应上面的新VD

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值