StorCLI即Storage Command Line Tool 是LSI公司开发的RAID卡命令行管理工具。主要用于服务器内部RAID管理。
安装storcli前,服务器本地硬盘故障更换过程中,在message中只有如下2行日志,无法得到详细信息
# dmidecode |grep 'Product'
Product Name: Lenovo ThinkServer RD630
Product Name: RD630
Oct 8 17:00:58 db2 kernel: megaraid_sas 0000:05:00.0: scanning for scsi2...
Oct 9 07:47:21 db2 kernel: megaraid_sas 0000:05:00.0: scanning for scsi2...
查看raid卡类型
# lspci |grep RAID
05:00.0 RAID bus controller: LSI Logic / Symbios Logic MegaRAID SAS 2008 [Falcon] (rev 03)
# dmesg |grep "RAID"
dracut: rd_NO_MD: removing MD RAID activation
scsi2 : Avago SAS based MegaRAID driver
可到服务器的官网下载相应的包,本例下载ul_avago_storcli_1.18.11_anyos.zip,下载后ftp到/opt目录下
# unzip ul_avago_storcli_1.18.11_anyos.zip
# cd storcli_all_os/Linux
# rpm -ivh storcli-1.18.11-1.noarch.rpm
Preparing... ########################################### [100%]
1:storcli ########################################### [100%]
rpm安装后 storcli64所在路径为/opt/MegaRAID/storcli/storcli64,可以直接运行storcli64工具,
为了使用方便,可以考虑将/opt/MegaRAID/storcli追加到系统PATH变量,或做链接
ln -s /opt/MegaRAID/storcli/storcli64 /bin/storcli
ln -s /opt/MegaRAID/storcli/storcli64 /sbin/storcli
# storcli show ctrlcount
Status Code = 0
Status = Success
Description = None
Controller Count = 1
# storcli /c0 /v0 show
Controller = 0
Status = Success
Description = None
Virtual Drives :
==============
-------------------------------------------------------------
DG/VD TYPE State Access Consist Cache Cac sCC Size Name
-------------------------------------------------------------
0/0 RAID5 Optl RW Yes NRWTD - ON 3.636 TB
-------------------------------------------------------------
Cac=CacheCade|Rec=Recovery|OfLn=OffLine|Pdgd=Partially Degraded|dgrd=Degraded
Optl=Optimal|RO=Read Only|RW=Read Write|HD=Hidden|TRANS=TransportReady|B=Blocked|
Consist=ConsistentR=Read Ahead Always|NR=No Read Ahead|WB=WriteBack|
AWB=Always WriteBack|WT=WriteThrough|C=Cached IO|D=Direct IO|sCC=Scheduled
Check Consistency
#/usr/bin/storcli show all
Status Code = 0
Status = Success
Description = None
Number of Controllers = 1
Host Name = db2
Operating System = Linux2.6.32-754.el6.x86_64
System Overview :
===============
----------------------------------------------------------------------------------
Ctl Model Ports PDs DGs DNOpt VDs VNOpt BBU sPR DS EHS ASOs Hlth
----------------------------------------------------------------------------------
0 LSIMegaRAIDSAS9240-8i 8 6 1 0 1 0 Msng On - Y 1 Opt
----------------------------------------------------------------------------------
Ctl=Controller Index|DGs=Drive groups|VDs=Virtual drives|Fld=Failed
PDs=Physical drives|DNOpt=DG NotOptimal|VNOpt=VD NotOptimal|Opt=Optimal
Msng=Missing|Dgd=Degraded|NdAtn=Need Attention|Unkwn=Unknown
sPR=Scheduled Patrol Read|DS=DimmerSwitch|EHS=Emergency Hot Spare
Y=Yes|N=No|ASOs=Advanced Software Options|BBU=Battery backup unit
Hlth=Health|Safe=Safe-mode boot
ASO :
===
----------------------------------------------------
Ctl Cl SAS MD R6 WC R5 SS FP Re CR RF CO CW HA SSHA
----------------------------------------------------
0 X X X X X X X X X X X X X X X
----------------------------------------------------
Cl=Cluster|MD=Max Disks|WC=Wide Cache|SS=Safe Store|FP=Fast Path|Re=Recovery
CR=CacheCade(Read)|RF=Reduced Feature Set|CO=Cache Offload
CW=CacheCade(Read/Write)|X=Not Available/Not Installed|U=Unlimited|T=Trial
|HA=High Availability |SSHA=Single server High Availability