MegaCli设置raid磁盘阵列为直通模式
最近研发同事们接到了一个奇怪的BUG:在24块硬盘并发读写时,写速率大大超过读的速率,需要在服务器的raid磁盘阵列中将硬盘设置为直通模式来测试复现。
一般来说直通模式只要在BIOS里设置就行了,但这个服务器比较特殊。架构和固件等均为国产,固件扩展性较差,不支持直通模式的设置。于是进入Linux系统,使用自带的MegaCli命令设置。
- 设置磁盘阵列模式为直通:
MegaCli -AdpSetProp -EnableJBOD -1 -aALL
若设置成功,返回日志如下:
Adapter 0: Set JBOD to Enable success.
Exit Code: 0x00
- 清除当前所有能识别的的raid:
MegaCli -CfgLdDel -Lall -a0
若清除成功,返回日志如下:
Adapter 0: Deleted Virtual Drive-0(target id-0)
Adapter 0: Deleted Virtual Drive-1(target id-1)
Adapter 0: Deleted Virtual Drive-2(target id-2)
Adapter 0: Deleted Virtual Drive-3(target id-3)
Exit Code: 0x00
- 查询每一块硬盘的详细信息:
MegaCli -PDList -aALL
单块硬盘信息如下,记录Enclosure Device ID和Slot Number:
Enclosure Device ID: 8
Slot Number: 7
Enclosure position: 1
Device Id: 16
WWN: 5000c500cf59ef4b
Sequence Number: 4
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SATA
Raw Size: 7.277 TB [0x3a3812ab0 Sectors]
Non Coerced Size: 7.276 TB [0x3a3712ab0 Sectors]
Coerced Size: 7.276 TB [0x3a3710000 Sectors]
Sector Size: 512
Logical Sector Size: 512
Physical Sector Size: 4096
Firmware state: JBOD
Device Firmware Level: SN02
Shield Counter: 0
Successful diagnostics completion on : N/A
SAS Address(0): 0x5001c45028621287
Connected Port Number: 0(path0)
Inquiry Data: WKD15YBHST8000NM000A-2KE101 SN02
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None
Device Speed: 6.0Gb/s
Link Speed: 6.0Gb/s
Media Type: Hard Disk Device
Drive: Not Certified
Drive Temperature :34C (93.20 F)
PI Eligibility: No
Drive is formatted for PI information: No
PI: No PI
Drive's NCQ setting : Enabled
Port-0 :
Port status: Active
Port's Linkspeed: 6.0Gb/s
Drive has flagged a S.M.A.R.T alert : No
- 设置单块硬盘的模式为直通,其中8是Enclosure Device ID,5是Slot Number:
MegaCli -PDMakeJBOD -PhysDrv[8:5] -a0
若成功设置,返回日志如下:
Adapter: 0: EnclId-8 SlotId-5 state changed to JBOD.
Exit Code: 0x00
注意每块硬盘都要单独设置直通