Skip to main content

MegaCli

Check raid card:

lspci | grep -i raid

Ubuntu/Debian:

wget http://hwraid.le-vert.net/debian/pool-jessie/megacli_8.07.14-1_amd64.deb
dpkg -i megacli_8.07.14-1_amd64.deb

CentOS/Other:

https://docs.broadcom.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/8-07-14_MegaCLI.zip

Physical drive information

-PDList -aALL
-PDInfo -PhysDrv [E:S] -aALL

Virtual drive information

-LDInfo -Lall -aALL

Enclosure information.

-EncInfo -aALL

Set physical drive state to online

-PDOnline -PhysDrv[E:S] -aALL

Stop Rebuild manually on the drive

-PDRbld -Stop -PhysDrv[E:S] -aALL

Show rebuild progress

-PDRbld -ShowProg -PhysDrv[E:S] -aALL

view dead disks (offline or missing)

-ldpdinfo -aall |grep -i “firmware state\|slot”

view new disks

-pdlist -aall |grep -i “firmware\|unconfigured\|slot”

create raid 1:

-CfgLdAdd -r1 [E:S, E:S] -aN

clearcache

-DiscardPreservedCache -L3 -aN (3 being the VD number)

check FW 

-AdpAllInfo -aALL | grep 'FW Package Build'

flash FW

-AdpFwFlash -f <Your rom file> -a0

Check BBU

-AdpBbuCmd  -a0

 The syntax for checking a disk within a MegaRAID based controller is as follows via CLI:

"n"This needs to be replaced byshows the first"Device diskID: XXX", Replace n with the Device ID

MegaCli -LdPdInfo -a0
smartctl -a -d megaraid,n /dev/sdx