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: 8Slot Number: 7Enclosure position: 1Device Id: 16WWN: 5000c500cf59ef4bSequence Number: 4Media Error Count: 0Other Error Count: 0Predictive Failure Count: 0Last Predictive Failure Event Seq Number: 0PD Type: SATARaw Size: 7.277 TB [0x3a3812ab0 Sectors]Non Coerced Size: 7.276 TB [0x3a3712ab0 Sectors]Coerced Size: 7.276 TB [0x3a3710000 Sectors]Sector Size: 512Logical Sector Size: 512Physical Sector Size: 4096Firmware state: JBODDevice Firmware Level: SN02Shield Counter: 0Successful diagnostics completion on : N/ASAS Address(0): 0x5001c45028621287Connected Port Number: 0(path0) Inquiry Data: WKD15YBHST8000NM000A-2KE101 SN02 FDE Capable: Not CapableFDE Enable: DisableSecured: UnsecuredLocked: UnlockedNeeds EKM Attention: NoForeign State: None Device Speed: 6.0Gb/s Link Speed: 6.0Gb/s Media Type: Hard Disk DeviceDrive: Not CertifiedDrive Temperature :34C (93.20 F)PI Eligibility: No Drive is formatted for PI information: NoPI: No PIDrive's NCQ setting : EnabledPort-0 :Port status: ActivePort'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
注意每块硬盘都要单独设置直通