Using MegaCli Tool to View and Manage Raid Card Information in Linux

Keywords: Linux RPM

MegaCli is a management and maintenance hardware RAID software, through which we can learn all the information of the current raid card, including the type of raid card, RAID array type, RAID disk status, and so on. Usually, we are not very sure about the current state of the hard disk. Generally, it is completed by the computer room staff patrol. Is there a way to check and determine this problem by software? MegaCli can do this, usually through MegaCli's edia Error Count: 0 Other Error Count: 0 two values to determine whether the disk in the array is a problem; Medai Error Count indicates that the disk may be wrong, may be bad disk, this value is not worth noting, the greater the value, the higher the risk factor, Other Error Count Count indicates that the disk may be loose and may need to be reinserted. MegaCli can detect all the disks in the array, and we can detect the relevant parameters by scripting, so as to inform the administrator.

Download MegaCli Tools

If it is an IBM server, download it directly from the IBM official.
If it's on other servers, use official downloads or LSI websites for relevant downloads.
Generally speaking, it is universal. This package is suitable for 32/64 bit operating system platform

LSI official website download address:
Baidu Disk Download:

Official Statement Documents:

II. Decompression Installation

cd linux
rpm -ivh MegaCli-8.07.14-1.noarch.rpm

Be careful:
After installation, the path of MegaCli64 is / opt/MegaRAID/MegaCli/MegaCli64 (some are / opt/MegaRAID/MegaCli/MegaCli, not necessarily MegaCLi64); under this path, you can run the MegaCli64 tool and switch to other paths, but you can't. At this time, for convenience, you can consider / opt / MegaRAID / MegaCl. I/MegaCli64 appends to the system PATH variable, or establishes a soft chain to/usr/bin (recommendation):

ln -s /opt/MegaRAID/MegaCli/MegaCli64 /usr/bin/

Common commands and parameters

MegaCli64 -LDInfo -Lall -aALL     //[raid level]
MegaCli64 -AdpAllInfo -aALL     //[Check raid card information]
MegaCli64 -PDList -aALL     //[View Hard Disk Information]
MegaCli64 -AdpBbuCmd -aAll     //[View battery information]
MegaCli64 -FwTermLog -Dsply -aALL     //[View raid card logs]
MegaCli64 -adpCount     //[Number of display adapters]
MegaCli64 -AdpGetTime –aALL     //[Display adapter time]
MegaCli64 -AdpAllInfo -aAll     //[Display all adapter information]
MegaCli64 -LDInfo -LALL -aAll     //[Display all logical disk group information]
MegaCli64 -PDList -aAll     //[Display all physical information]
MegaCli64 -AdpBbuCmd -GetBbuStatus -aALL |grep 'Charger Status'     //[View Charging Status]
MegaCli64 -AdpBbuCmd -GetBbuStatus -aALL     //[Display BBU status information]
MegaCli64 -AdpBbuCmd -GetBbuCapacityInfo -aALL     //[Display BBU capacity information]
MegaCli64 -AdpBbuCmd -GetBbuDesignInfo -aALL     //[Display BBU design parameters]
MegaCli64 -AdpBbuCmd -GetBbuProperties -aALL     //[Display current BBU properties]
MegaCli64 -cfgdsply -aALL     //[Display Raid Card Model, Raid Settings, Disk Related Information]


MegaCli64 -PDlist -aALL -Nolog |grep -Ei "(enclosure|slot)"     //[Check the disk cabinet number and location number where the hard disk is located]
MegaCli64 -cfgdsply -aALL|grep -A8 "Virtual Drive"     //[Volume Group Status Information]
MegaCli64 -PDlist -aALL|grep -i 'Firmware state'     //[Physical disk status]
MegaCli64 -pdrbld -showprog -physdrv\[20:6\] -aALL     //[Approximate time required for reconstruction]
MegaCli64 -pdrbld -progdsply -physdrv\[20:6\] -aALL     //[Progress of reconstruction]


Different states of various devices and disks:
Device |Normal|Damage|Rebuild|Normal
Virtual Drive |Optimal|Degraded|Degraded|Optimal
Physical Drive |Online|Failed –> Unconfigured|Rebuild|Online

Posted by Wildthrust on Wed, 11 Sep 2019 00:51:02 -0700