Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

MegaCli monitors raid status

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Brief introduction

MegaCli is a management and maintenance hardware RAID software, you can use it to know all the information about the current raid card, including the raid card model, the array type of raid, the status of each disk on the raid, and so on. Usually, we are not sure about the current state of the hard disk, which is generally completed through the patrol inspection of the computer room personnel. Is there any way to check and determine this problem by software? MegaCli can do this. Generally, the two values of Media Error Count: 0 Other Error Count: 0 of MegaCli are used to determine whether there is a problem with the disk in the array. Medai Error Count indicates that the disk may be wrong or has a bad path, but this value is not 0. The higher the value, the higher the risk factor. Other Error Count indicates that the disk may be loose and may need to be re-inserted. MegaCli can detect all the disks in the array, and we can detect the relevant parameters in a script to notify the manager.

Download MegCli. Currently, the DB database for the company is the server of IBM, which can be downloaded directly from IBM. If

For other servers, use the official downloads or the LSI website for related downloads. Generally speaking, it is universal. This package is suitable for 32 / 64-bit operating system platform

Download address: ftp://download2.boulder.ibm.com/ecc/sar/CMA/XSA/ibm_utl_sraidmr_megacli-8.00.48_linux_32-64.zip

II. Installation

# unzip ibm_utl_sraidmr_megacli-8.00.48_linux_32-64.zip

# cd linux

# rpm-ivh Lib_Utils-1.00-09.noarch.rpm MegaCli-8.00.48-1.i386.rpm

3. Use commands and parameters

Click (here) to collapse or open

The command uses:

# / opt/MegaRAID/MegaCli/MegaCli64-LDInfo-Lall-aALL check raid level

# / opt/MegaRAID/MegaCli/MegaCli64-AdpAllInfo-aALL to check the raid card information

# / opt/MegaRAID/MegaCli/MegaCli64-PDList-aALL to view hard disk information

# / opt/MegaRAID/MegaCli/MegaCli64-AdpBbuCmd-aAll to view battery information

# / opt/MegaRAID/MegaCli/MegaCli64-FwTermLog-Dsply-aALL View raid card log

# / opt/MegaRAID/MegaCli/MegaCli64-adpCount [display the number of adapters]

# / opt/MegaRAID/MegaCli/MegaCli64-AdpGetTime-aALL [display adapter time]

# / opt/MegaRAID/MegaCli/MegaCli64-AdpAllInfo-aAll [Show all adapter information]

# / opt/MegaRAID/MegaCli/MegaCli64-LDInfo-LALL-aAll [displays all logical disk group information]

# / opt/MegaRAID/MegaCli/MegaCli64-PDList-aAll [displays all physical information]

# / opt/MegaRAID/MegaCli/MegaCli64-AdpBbuCmd-GetBbuStatus-aALL | grep 'Charger Status' [check charging status]

# / opt/MegaRAID/MegaCli/MegaCli64-AdpBbuCmd-GetBbuStatus-aALL [display BBU status information]

# / opt/MegaRAID/MegaCli/MegaCli64-AdpBbuCmd-GetBbuCapacityInfo-aALL [display BBU capacity information]

# / opt/MegaRAID/MegaCli/MegaCli64-AdpBbuCmd-GetBbuDesignInfo-aALL [display BBU design parameters]

# / opt/MegaRAID/MegaCli/MegaCli64-AdpBbuCmd-GetBbuProperties-aALL [Show current BBU attributes]

# / opt/MegaRAID/MegaCli/MegaCli64-cfgdsply-aALL [display Raid card model, Raid settings, Disk related information]

3. The change in the state of the tape, from pulling the disk to inserting the disk.

Device | Normal | Damage | Rebuild | Normal

Virtual Drive | Optimal | Degraded | Degraded | Optimal

Physical Drive | Online | Failed-> Unconfigured | Rebuild | Online

4. View disk cache policy

# / opt/MegaRAID/MegaCli/MegaCli64-LDGetProp-Cache-L0-a0

Or

# / opt/MegaRAID/MegaCli/MegaCli64-LDGetProp-Cache-L1-a0

Or

# / opt/MegaRAID/MegaCli/MegaCli64-LDGetProp-Cache-LALL-a0

Ro

# / opt/MegaRAID/MegaCli/MegaCli64-LDGetProp-Cache-LALL-aALL

Ro

# / opt/MegaRAID/MegaCli/MegaCli64-LDGetProp-DskCache-LALL-aALL

5. Set disk caching policy

Cache policy explanation:

WT (Write through

WB (Write back)

NORA (No read ahead)

RA (Read ahead)

ADRA (Adaptive read ahead)

Cached

Direct

Example:

# / opt/MegaRAID/MegaCli/MegaCli64-LDSetProp WT | WB | NORA | RA | ADRA-L0-a0

Or

# / opt/MegaRAID/MegaCli/MegaCli64-LDSetProp-Cached |-Direct-L0-a0

Or

Enable / disable disk cache

# / opt/MegaRAID/MegaCli/MegaCli64-LDSetProp-EnDskCache |-DisDskCache-L0-a0

6. Create a raid5 array, which is made up of physical disk 2je 3je 4. The hot spare of this array is physical disk 5.

# / opt/MegaRAID/MegaCli/MegaCli64-CfgLdAdd-R5 [1 WB Direct-Hsp [1:5]-a0

7. Create an array without specifying a hot backup

# / opt/MegaRAID/MegaCli/MegaCli64-CfgLdAdd-R5 [1 WB Direct-a0

8. Delete Array

# / opt/MegaRAID/MegaCli/MegaCli64-CfgLdDel-L1-a0

9. Add disks online

# / opt/MegaRAID/MegaCli/MegaCli64-LDRecon-Start-R5-Add-PhysDrv [1:4]-L1-a0

10. After the array is created, there is a process of initializing the synchronization block, and you can see its progress.

# / opt/MegaRAID/MegaCli/MegaCli64-LDInit-ShowProg-LALL-aALL

Or display it in a dynamic visual text interface.

# / opt/MegaRAID/MegaCli/MegaCli64-LDInit-ProgDsply-LALL-aALL

11. Check the progress of array background initialization

# / opt/MegaRAID/MegaCli/MegaCli64-LDBI-ShowProg-LALL-aALL

Or display it in a dynamic visual text interface.

# / opt/MegaRAID/MegaCli/MegaCli64-LDBI-ProgDsply-LALL-aALL

twelve。 Specify the fifth disk as the global hot backup

# / opt/MegaRAID/MegaCli/MegaCli64-PDHSP-Set [- EnclAffinity] [- nonRevertible]-PhysDrv [1:5]-a0

13. Designated as a dedicated hot standby for an array

# / opt/MegaRAID/MegaCli/MegaCli64-PDHSP-Set [- Dedicated [- Array1]] [- EnclAffinity] [- nonRevertible]-PhysDrv [1:5]-a0

14. Delete global hot backup

# / opt/MegaRAID/MegaCli/MegaCli64-PDHSP-Rmv-PhysDrv [1:5]-a0

15. Take a physical disk offline / online

# / opt/MegaRAID/MegaCli/MegaCli64-PDOffline-PhysDrv [1:4]-a0

# / opt/MegaRAID/MegaCli/MegaCli64-PDOnline-PhysDrv [1:4]-a0

16. Check the progress of physical disk reconstruction

# / opt/MegaRAID/MegaCli/MegaCli64-PDRbld-ShowProg-PhysDrv [1:5]-a0

Or display it in a dynamic visual text interface.

# / opt/MegaRAID/MegaCli/MegaCli64-PDRbld-ProgDsply-PhysDrv [1:5]-a0

The change in the state of the tape, from pulling the disk to inserting the disk:

Device | Normal | Damage | Rebuild | Normal

Virtual Drive | Optimal | Degraded | Degraded | Optimal

Physical Drive | Online | Failed-> Unconfigured | Rebuild | Online

1. View the RAID level

2. Check the raid card information and mainly output some configuration information of the raid card

RAID Level: Primary-1, Secondary-0, RAID Level Qualifier-0

Size: 1.086 TB

State: Optimal

Strip Size: 128 KB

Number Of Drives per span:4 / / means that every four physical disks are made into a raid 1 disk group.

Span Depth: 2 / / indicates that a total of 2 RAID1 disk groups have been made into RAID10

3. View the information of all hard drives

/ opt/MegaCli64-pdlist-aALL

4. Check the current raid cache status. If the raid cache status is set to wb, you should pay attention to the battery discharge, and set the battery discharge mode to automatic learning mode.

/ opt/MegaRAID/MegaCli/MegaCli64-ldgetprop-dskcache-lall-aall

5. Related to raid battery settings

View battery status information (Display BBU Status Information)

MegaCli-AdpBbuCmd-GetBbuStatus-aN |-a0Magol 1Pol 2 |-aALL

MegaCli-AdpBbuCmd-GetBbuStatus-aALL

View battery capacity (Display BBU Capacity Information)

MegaCli-AdpBbuCmd-GetBbuCapacityInfo-aN |-a0Magol 1Pol 2 |-aALL

MegaCli-AdpBbuCmd-GetBbuCapacityInfo-aALL

View battery design parameters (Display BBU Design Parameters)

MegaCli-AdpBbuCmd-GetBbuDesignInfo-aN |-a0Magol 1Pol 2 |-aALL

MegaCli-AdpBbuCmd-GetBbuDesignInfo-aALL

View Battery Properties (Display Current BBU Properties)

MegaCli-AdpBbuCmd-GetBbuProperties-aN |-a0Magol 1Pol 2 |-aALL

MegaCli-AdpBbuCmd-GetBbuProperties-aALL

Set the battery to learning mode to cycle mode (Start BBU Learning Cycle)

Description Starts the learning cycle on the BBU.

No parameter is needed for this option.

MegaCli-AdpBbuCmd-BbuLearn-aN |-a0Magol 1Pol 2 |-aALL

Set the caching mode and access mode of the disk (Change Virtual Disk Cache and Access Parameters)

Description Allows you to change the following virtual disk parameters:

-WT (Write through), WB (Write back): Selects write policy.

-NORA (No read ahead), RA (Read ahead), ADRA (Adaptive read ahead): Selects read policy.

-Cached,-Direct: Selects cache policy.

-RW,-RO, Blocked: Selects access policy.

-EnDskCache: Enables disk cache.

-DisDskCache: Disables disk cache.

MegaCli-LDSetProp {WT | WB | NORA | RA | ADRA |-Cached | Direct} |

{- RW | RO | Blocked} |

{- Name [string]} |

{- EnDskCache | DisDskCache}-Lx |

-L0Magol 1 Lall 2 |-aALL-aN |-a0 Person1Magol 2 |-aALL

MegaCli-LDSetProp WT-L0-a0

Show disk cache and access method (Display Virtual Disk Cache and Access Parameters)

MegaCli-LDGetProp-Cache |-Access |-Name |-DskCache-Lx |-L0 _

-Lall-aN |-a0pr 1pm 2 |-aALL

Displays the cache and access policies of the virtual disk (s):

-WT (Write through), WB (Write back): Selects write policy.

-NORA (No read ahead), RA (Read ahead), ADRA (Adaptive read ahead): Selects read policy.

-Cache,-Cached, Direct: Displays cache policy.

-Access,-RW,-RO, Blocked: Displays access policy.

-DskCache: Displays physical disk cache policy.

Megaraid must know that it will use LSI's megaraid to effectively monitor raid. Other manufacturers such as HP,IBM also have their own raid API

MegaCli-ldinfo-lall-aall

Query raid level, number of disks, capacity, stripe size.

MegaCli-cfgdsply-aALL | grep Policy

Query controller cache strategy

MegaCli-LDSetProp WB-L0-a0

Set up write back function

MegaCli-LDSetProp CachedBadBBU-L0-a0

Set to keep the WB function even if the battery is broken

MegaCli-AdpBbuCmd-BbuLearn a0

Manual charging

MegaCli-FwTermLog-Dsply-aALL

Query log

Number of display adapters: MegaCli-adpCount

Show all adapter information: MegaCli-AdpAllInfo-aAll

Critical Disks: 0

Failed Disks: 0

Display all logical disk group information: MegaCli-LDInfo-LALL-aAll

Display all physical information: MegaCli-PDList-aAll

Media Error Count: 0

Other Error Count: 0

Check the charging status: MegaCli-AdpBbuCmd-GetBbuStatus-aALL

Learn Cycle Requested: No

Fully Charged: Yes

Display BBU (backup battery) status information: MegaCli-AdpBbuCmd-GetBbuStatus-aALL

Display BBU capacity information: MegaCli-AdpBbuCmd-GetBbuCapacityInfo-aALL

Display BBU design parameters: MegaCli-AdpBbuCmd-GetBbuDesignInfo-aALL

Show the current BBU properties: MegaCli-AdpBbuCmd-GetBbuProperties-aALL

Displays the Raid card model, Raid settings, Disk related information: MegaCli-cfgdsply-aALL

View Cache policy settings: MegaCli-cfgdsply-aALL | grep-I Policy

Current Cache Policy: WriteBack, ReadAheadNone, Direct, Write Cache OK if Bad BBU

Check the percentage of charging progress: MegaCli-AdpBbuCmd-GetBbuStatus-aALL

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

6. Check the status of RAID disk by script

Script under Linux

#! / bin/bash

# check raid disk status

MEGACLI= "/ opt/MegaRAID/MegaCli/MegaCli64"

$MEGACLI-pdlist-aALL | grep "Firmware state" | awk-F:'{print $2}'| awk-F,'{print $1}'> / tmp/fireware.log

$MEGACLI-pdlist-aALL | grep-E "Media Error | Other Error" | awk-F:'{print $2}'> / tmp/disk.log

For i in `cat < / tmp/ disk.log`

Do

If [$I-ne 0]

Then

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report