Idrac监控报错:登陆ideac卡后如下如所示:硬盘状态是红叉,状态是外来
rpm -ivh MegaCli-8.07.08-1.noarch.rpm
查看包的安装路径
rpm -ql MegaCli-8.07.08-1.noarch
/opt/MegaRAID/MegaCli/MegaCli
/opt/MegaRAID/MegaCli/MegaCli64
/opt/MegaRAID/MegaCli/libstorelibir-2.so.14.07-0
执行状态检测命令:
/opt/MegaRAID/MegaCli/MegaCli64 -pdlist -aall |grep 'Firmware state'
Firmware state: Unconfigured(good), Spun Up
Firmware state: Online, Spun Up
Firmware state: Online, Spun Up
Firmware state: Online, Spun Up
Firmware state: Online, Spun Up
Firmware state: Online, Spun Up
Firmware state: Online, Spun Up
Firmware state: Online, Spun Up
此时的状态如下:
############
Enclosure Device ID: 32
Slot Number: 4
###Drive's position: DiskGroup: 0, Span: 2, Arm: 1 ###应该有这个信息的,但是这个没有
Enclosure position: 1
Device Id: 4
WWN: 5000C5005AAD3E28
Sequence Number: 1
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 102
Last Predictive Failure Event Seq Number: 41501
PD Type: SAS
Raw Size: 558.911 GB [0x45dd2fb0 Sectors]
Non Coerced Size: 558.411 GB [0x45cd2fb0 Sectors]
Coerced Size: 558.375 GB [0x45cc0000 Sectors]
Sector Size: 0
Firmware state: Unconfigured(good), Spun Up
Device Firmware Level: ES66
Shield Counter: 0
Successful diagnostics completion on : N/A
SAS Address(0): 0x5000c5005aad3e29
SAS Address(1): 0x0
Connected Port Number: 0(path0)
Inquiry Data: SEAGATE ST3600057SS ES666SL5A74S
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: Foreign
Foreign Secure: Drive is not secured by a foreign lock key
Device Speed: 6.0Gb/s
Link Speed: 6.0Gb/s
Media Type: Hard Disk Device
Drive Temperature :45C (113.00 F)
PI Eligibility: No
Drive is formatted for PI information: No
PI: No PI
Port-0 :
Port status: Active
Port's Linkspeed: 6.0Gb/s
Port-1 :
Port status: Active
Port's Linkspeed: Unknown
Drive has flagged a S.M.A.R.T alert : Yes
############
执行导入命令
/opt/MegaRAID/MegaCli/MegaCli64 -CfgForeign -Import -aall
Foreign configuration is imported on controller 0.
Exit Code: 0x00
再次执行状态检测命令:
/opt/MegaRAID/MegaCli/MegaCli64 -pdlist -aall |grep 'Firmware state'
Firmware state: Rebuild
Firmware state: Online, Spun Up
Firmware state: Online, Spun Up
Firmware state: Online, Spun Up
Firmware state: Online, Spun Up
Firmware state: Online, Spun Up
Firmware state: Online, Spun Up
Firmware state: Online, Spun Up
查询 Rebuild 进度:
/opt/MegaRAID/MegaCli/MegaCli64 -pdrbld -showprog -physdrv[32:0] -a0
显示如下:
Rebuild Progress on Device at Enclosure 32, Slot 0 Completed 38% in 54 Minutes.
Exit Code: 0x00
或者
/opt/MegaRAID/MegaCli/MegaCli64 -pdrbld -ProgDsply -physdrv[32:0] -a0
显示如下:
Rebuild progress of physical drives...
Enclosure:Slot Percent Complete Time Elps
032 :00 ####################***40 %*********************** 00:56:40
Press <ESC> key to quit...
备注:
Enclosure Device ID: 32
Slot Number: 0
以上两条信息通过/opt/MegaRAID/MegaCli/MegaCli64 -pdlist -aall |less 来查看
扫描外来配置的个数:
# /opt/MegaRAID/MegaCli/MegaCli64 -cfgforeign -scan -a0
清除外来配置:
# /opt/MegaRAID/MegaCli/MegaCli64 -cfgforeign -clear -a0
再次扫描外来配置的个数:
# /opt/MegaRAID/MegaCli/MegaCli64 -cfgforeign -scan -a0
参考:http://erikimh.com/raid-rebuilding-foreign-disk-by-hand/
Megacli是一款管理维护硬件RAID的工具,有LSI公司提供,LSI公司的raid卡,使用的比较广泛。我们可以通过megacli了解当前raid卡的所有信息,包括raid卡的型号,raid的阵列类型,raid上的磁盘状态,也可以通过它来直接创建阵列,在线添加磁盘等。
一,Megacli工具安装
可以在LSI公司的官网直接下载工具:
http://www.lsi.com/downloads/Public/Nytro/downloads/Nytro%20XD/MegaCli_Linux.zip
下载完成之后,是一个zip包,然后解压,安装:
# unzip MegaCli_Linux.zip
# cd MegaCli_Linux
# ls
megacli_8.07.08-1_all.deb MegaCli-8.07.08-1.noarch.rpm MegaSAS.log
# rpm -ivh MegaCli-8.07.08-1.noarch.rpm
安装成功之后,命令的默认安装路径为:
# /opt/MegaRAID/MegaCli/MegaCli64
二,查看磁盘的状态
作用:显示Raid卡型号,Raid设置,整列类型,Disk相关信息
# /opt/MegaRAID/MegaCli/MegaCli64 -cfgdsply -aALL|less
1,查看raid整列类型和大小
如上图所示:
(1)通过RAID Level字段得知,disk group 0做的是一个raid5;
(2)disk group 0的大小为1.6TB;
2,查看raid的cache策略
如上图所示,raid的默认以及当前生效的cache策略为writeback(还有一种cache策略为WriteThrough)
策略说明:
(1). 第一段: WriteBack, WriteThrough