所有问题解决方案
我们都已亲身测试

使用MegaCli工具查看Raid磁盘阵列状态

Linux操作系统下使用MegaCli工具查看Raid磁盘阵列状态
  安装MegaCli-1.01.24-0.i386.rpm会把程序安装在/opt下,可以自定义安装目录,例如:rpm –relocate /opt/=/usr/sbin/ -i MegaCli-1.01.24-0.i386.rpm 即把安装目录 /opt 替换成 /usr/sbin。

下载下面2个压缩包
Lib_Utils-1.00-08.noarch.zip
MegaCli-8.00.46-1.i386.zip
解压:unzip MegaCli-8.00.46-1.i386.zip Lib_Utils-1.00-08.noarch.zip
安装:rpm -ivh Lib_Utils-1.00-08.noarch.rpm MegaCli-8.00.46-1.i386.rpm

这里我就安装到:/opt/MegaRAID/MegaCli/MegaCli
1. 首先介绍下Linux系统本身查看
软件raid:查看raid级别,状态等信息
#cat /proc/mdstat
硬件raid:查看raid的厂商,型号,级别
#dmesg | grep -i raid
#cat /proc/scsi/scsi

2.硬件raid最佳的办法是通过已安装的raid厂商的管理工具来查看,下面安装MegaCLI工具查看
首先下载MegaCli,解压缩。#rpm -ivh MegaCli-1.01.24-0.i386.rpm  安装在/opt/MegaRAID/MegaCli/MegaCli下,所以执行命令都是/opt/MegaRAID/MegaCli/MegaCli。
命令使用
#/opt/MegaRAID/MegaCli/MegaCli  -LDInfo -Lall -aALL 查raid级别
#/opt/MegaRAID/MegaCli/MegaCli -AdpAllInfo -aALL 查raid卡信息
#/opt/MegaRAID/MegaCli/MegaCli -PDList -aALL 查看硬盘信息
#/opt/MegaRAID/MegaCli/MegaCli -AdpBbuCmd -aAll 查看电池信息
#/opt/MegaRAID/MegaCli/MegaCli -FwTermLog -Dsply -aALL 查看raid卡日志
#/opt/MegaRAID/MegaCli/MegaCli -adpCount 【显示适配器个数】
#/opt/MegaRAID/MegaCli/MegaCli -AdpGetTime –aALL 【显示适配器时间】
#/opt/MegaRAID/MegaCli/MegaCli -AdpAllInfo -aAll    【显示所有适配器信息】
#/opt/MegaRAID/MegaCli/MegaCli -LDInfo -LALL -aAll    【显示所有逻辑磁盘组信息】
#/opt/MegaRAID/MegaCli/MegaCli -PDList -aAll    【显示所有的物理信息】
#/opt/MegaRAID/MegaCli/MegaCli -AdpBbuCmd -GetBbuStatus -aALL |grep ‘Charger Status’ 【查看充电状态】
#/opt/MegaRAID/MegaCli/MegaCli -AdpBbuCmd -GetBbuStatus -aALL【显示BBU状态信息】
#/opt/MegaRAID/MegaCli/MegaCli -AdpBbuCmd -GetBbuCapacityInfo -aALL【显示BBU容量信息】
#/opt/MegaRAID/MegaCli/MegaCli -AdpBbuCmd -GetBbuDesignInfo -aALL    【显示BBU设计参数】
#/opt/MegaRAID/MegaCli/MegaCli -AdpBbuCmd -GetBbuProperties -aALL    【显示当前BBU属性】
#/opt/MegaRAID/MegaCli/MegaCli -cfgdsply -aALL    【显示Raid卡型号,Raid设置,Disk相关信息】

3.磁带状态的变化,从拔盘,到插盘的过程中
Device        |Normal|Damage|Rebuild|Normal
Virtual Drive    |Optimal|Degraded|Degraded|Optimal
Physical Drive    |Online|Failed –> Unconfigured|Rebuild|Online

4.查看磁盘缓存策略
#/opt/MegaRAID/MegaCli/MegaCli -LDGetProp -Cache -L0 -a0
or
#/opt/MegaRAID/MegaCli/MegaCli -LDGetProp -Cache -L1 -a0
or
#/opt/MegaRAID/MegaCli/MegaCli -LDGetProp -Cache -LALL -a0
ro
#/opt/MegaRAID/MegaCli/MegaCli -LDGetProp -Cache -LALL -aALL
ro
#/opt/MegaRAID/MegaCli/MegaCli -LDGetProp -DskCache -LALL -aALL

5.设置磁盘缓存策略
缓存策略解释:
WT    (Write through)
WB    (Write back)
NORA  (No read ahead)
RA    (Read ahead)
ADRA  (Adaptive read ahead)
Cached
Direct
例子:
#/opt/MegaRAID/MegaCli/MegaCli -LDSetProp WT|WB|NORA|RA|ADRA -L0 -a0
or
#/opt/MegaRAID/MegaCli/MegaCli -LDSetProp -Cached|-Direct -L0 -a0
or
enable / disable disk cache
#/opt/MegaRAID/MegaCli/MegaCli -LDSetProp -EnDskCache|-DisDskCache -L0 -a0

6.创建一个 raid5 阵列,由物理盘 2,3,4 构成,该阵列的热备盘是物理盘 5
#/opt/MegaRAID/MegaCli/MegaCli -CfgLdAdd -r5 [1:2,1:3,1:4] WB Direct -Hsp[1:5] -a0

7.创建阵列,不指定热备
#/opt/MegaRAID/MegaCli/MegaCli -CfgLdAdd -r5 [1:2,1:3,1:4] WB Direct -a0

8.删除阵列
#/opt/MegaRAID/MegaCli/MegaCli -CfgLdDel -L1 -a0

9.在线添加磁盘
#/opt/MegaRAID/MegaCli/MegaCli -LDRecon -Start -r5 -Add -PhysDrv[1:4] -L1 -a0

10.阵列创建完后,会有一个初始化同步块的过程,可以看看其进度。
#/opt/MegaRAID/MegaCli/MegaCli -LDInit -ShowProg -LALL -aALL
或者以动态可视化文字界面显示
#/opt/MegaRAID/MegaCli/MegaCli -LDInit -ProgDsply -LALL -aALL

11.查看阵列后台初始化进度
#/opt/MegaRAID/MegaCli/MegaCli -LDBI -ShowProg -LALL -aALL
或者以动态可视化文字界面显示
#/opt/MegaRAID/MegaCli/MegaCli -LDBI -ProgDsply -LALL -aALL

12.指定第 5 块盘作为全局热备
#/opt/MegaRAID/MegaCli/MegaCli -PDHSP -Set [-EnclAffinity] [-nonRevertible] -PhysDrv[1:5] -a0

13.指定为某个阵列的专用热备
#/opt/MegaRAID/MegaCli/MegaCli -PDHSP -Set [-Dedicated [-Array1]] [-EnclAffinity] [-nonRevertible] -PhysDrv[1:5] -a0

14.删除全局热备
#/opt/MegaRAID/MegaCli/MegaCli -PDHSP -Rmv -PhysDrv[1:5] -a0

15.将某块物理盘下线/上线
#/opt/MegaRAID/MegaCli/MegaCli -PDOffline -PhysDrv [1:4] -a0
#/opt/MegaRAID/MegaCli/MegaCli -PDOnline -PhysDrv [1:4] -a0

16.查看物理磁盘重建进度
#/opt/MegaRAID/MegaCli/MegaCli -PDRbld -ShowProg -PhysDrv [1:5] -a0
或者以动态可视化文字界面显示
#/opt/MegaRAID/MegaCli/MegaCli -PDRbld -ProgDsply -PhysDrv [1:5] -a0

赞(0)
未经允许不得转载:无忧解决网 » 使用MegaCli工具查看Raid磁盘阵列状态

登录

找回密码

注册