MegaCli 查看RAID阵列卡硬盘信息

2024-07-24 970 0

MegaCli 是一款查看、管理当前机器 raid 卡所有信息的软件,包括 raid 卡的型号、raid 的阵列类型、raid 上各个磁盘状态等等。

安装

broadcom 博通官网搜索下载

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

解压安装,默认安装目录为/opt/MegaRAID/MegaCli/

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

常用命令

# 查看RAID级别
MegaCli64 -LDInfo -Lall -aALL
# 查看RAID卡信息
MegaCli64 -AdpAllInfo -aALL
# 查看硬盘信息
MegaCli64 -PDList -aALL
# 查看硬盘型号
MegaCli -PDList -aALL | grep "Inquiry Data"
# 查看电池信息
MegaCli64 -AdpBbuCmd -aAll
# 查看raid卡日志
MegaCli64 -FwTermLog -Dsply -aALL
# 查看适配器个数
MegaCli64 -adpCount
# 查看适配器时间
MegaCli64 -AdpGetTime –aALL
# 查看所有适配器信息
MegaCli64 -AdpAllInfo -aAll
# 查看所有逻辑磁盘组信息
MegaCli64 -LDInfo -LALL -aAll
# 查看所有的物理信息
MegaCli64 -PDList -aAll
# 查看电池充电状态
MegaCli64 -AdpBbuCmd -GetBbuStatus -aALL |grep 'Charger Status'
# 查看BBU状态信息
MegaCli64 -AdpBbuCmd -GetBbuStatus -aALL
# 查看BBU容量信息
MegaCli64 -AdpBbuCmd -GetBbuCapacityInfo -aALL
# 查看BBU设计参数
MegaCli64 -AdpBbuCmd -GetBbuDesignInfo -aALL
# 查看当前BBU属性
MegaCli64 -AdpBbuCmd -GetBbuProperties -aALL
# 查看 RAID卡型号,RAID设置,硬盘相关信息
MegaCli64 -cfgdsply -aALL

# 查看硬盘所在盘柜号和位置号
MegaCli64 -PDlist -aALL -Nolog |grep -Ei '(enclosure|slot)'
# 查看逻辑卷和硬盘状态信息
MegaCli64 -cfgdsply -aALL
# 查看物理盘状态
MegaCli64 -PDlist -aALL|grep -i 'Firmware state'
# 重建进度
MegaCli64 -pdrbld -showprog -physdrv[32:6] -aALL
MegaCli64 -pdrbld -progdsply -physdrv[32:6] -aALL

硬盘状态变化,从拔盘,到插盘的过程中:

|Device |Normal|Damage|Rebuild|Normal|

|Virtual Drive |Optimal|Degraded|Degraded|Optimal|

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

查看重建进度

root@demo18:~# MegaCli -PDInfo -PhysDrv [32:4] -aAll  | grep 'Firmware state'
Firmware state: Rebuild

root@demo18:~# /opt/MegaRAID/MegaCli/MegaCli64 -PDRbld -ShowProg -PhysDrv [32:4] -a0                                     
Rebuild Progress on Device at Enclosure 32, Slot 4 Completed 1% in 7 Minutes.

查看通电时间

0和1表示物理硬盘所在的槽位

smartctl -a /dev/sda  -d megaraid,0
smartctl -a /dev/sda  -d megaraid,1
root@demo18:~# smartctl -a /dev/sda  -d megaraid,0
smartctl 6.5 2016-01-24 r4214 [x86_64-linux-4.12.9-041209-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

/dev/sda [megaraid_disk_00] [SAT]: Device open changed type from 'megaraid,0' to 'sat+megaraid,0'
=== START OF INFORMATION SECTION ===
Device Model:     TOSHIBA MG04ACA600E
Serial Number:    7687K3TPFE1C
LU WWN Device Id: 5 000039 72ba01394
Add. Product Id:  DELL(tm)
Firmware Version: FS6D
User Capacity:    6,001,175,126,016 bytes [6.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    7200 rpm
Form Factor:      3.5 inches
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   ATA8-ACS (minor revision not indicated)
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Mon Feb 17 21:59:31 2025 CST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART Status not supported: ATA return descriptor not supported by controller firmware
SMART overall-health self-assessment test result: PASSED
Warning: This result is based on an Attribute check.

General SMART Values:
Offline data collection status:  (0x84) Offline data collection activity
                    was suspended by an interrupting command from host.
                    Auto Offline Data Collection: Enabled.
Self-test execution status:      (  24) The self-test routine was aborted by
                    the host.
Total time to complete Offline 
data collection:        (   90) seconds.
Offline data collection
capabilities:            (0x5b) SMART execute Offline immediate.
                    Auto Offline data collection on/off support.
                    Suspend Offline collection upon new
                    command.
                    Offline surface scan supported.
                    Self-test supported.
                    No Conveyance Self-test supported.
                    Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                    power-saving mode.
                    Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                    General Purpose Logging supported.
Short self-test routine 
recommended polling time:    (   2) minutes.
Extended self-test routine
recommended polling time:    ( 642) minutes.
SCT capabilities:          (0x003d) SCT Status supported.
                    SCT Error Recovery Control supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000b   100   100   050    Pre-fail  Always       -       0
  2 Throughput_Performance  0x0004   100   100   000    Old_age   Offline      -       0
  3 Spin_Up_Time            0x0027   100   100   001    Pre-fail  Always       -       10236
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       148
  5 Reallocated_Sector_Ct   0x0033   100   100   050    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000a   100   100   000    Old_age   Always       -       0
  8 Seek_Time_Performance   0x0004   100   100   000    Old_age   Offline      -       0
  9 Power_On_Hours          0x0032   001   001   000    Old_age   Always       -       66335
 10 Spin_Retry_Count        0x0032   102   100   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       148
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       147
193 Load_Cycle_Count        0x0032   100   100   000    Old_age   Always       -       148
194 Temperature_Celsius     0x0022   100   100   000    Old_age   Always       -       31 (Min/Max 17/53)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   253   000    Old_age   Always       -       0
241 Total_LBAs_Written      0x0032   100   100   000    Old_age   Always       -       109828881033
242 Total_LBAs_Read         0x0032   100   100   000    Old_age   Always       -       111175388373

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Aborted by host               80%     65017         -
# 2  Short offline       Completed without error       00%         3         -
# 3  Vendor (0xdf)       Completed without error       00%         3         -

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

相关文章

RAID阵列卡硬盘坏道检测脚本
服务器磁盘坏道检查

发布评论