storcli 手册

StorCLI is a command line tool for the administration of MegaRAID Controllers and the successor of MegaCLI.

由于OEM给DELL的阵列卡原厂的storcli工具不能识别,只能用DELL自家的PERCCLI工具,但其实应该就是在storcli基础上修改的,安装用法都和storcli一致!

stircli & PERCCLI下载:

storcli pdf文档:

Ubuntu:

unzip ul_avago_storcli_1.18.11_anyos.zip
dpkg -i storcli_all_os/Ubuntu/storcli_1.18.11_all.deb
dpkg -l | grep -i storcli

Centos:

unzip ul_avago_storcli_1.18.11_anyos.zip
rpm -ivh storcli_all_os/Linux/storcli-1.18.11-1.noarch.rpm
rpm -qi storcli
ln -s /opt/MegaRAID/storcli/storcli64 /usr/local/bin/storcli

ESXi 5.5 & ESXi 6.0:

将vib文件上传至/tmp:

unzip ul_avago_storcli_1.18.11_anyos.zip
esxcli software vib install -v=/tmp/vmware-esx-storcli-1.21.06.vib --no-sig-check
ln -s /opt/lsi/storcli/storcli /sbin/storcli
storcli -V
  • /cx, /vx 表示 Controller/Virtual Drive Number.
  • /ex, /sx 表示 Enclosure/Slot ID.
  • VD 表示 Virtual Drive.
  • 要输出json格式的返回,在命令行最后添加J.

2.1. 查看物理磁盘信息

storcli /c0 show all
 
 
PD LIST :
======= - 
-------------------------------------------------------------------------------
EID:Slt DID State DG     Size Intf Med SED PI SeSz Model               Sp Type 
-------------------------------------------------------------------------------
252:0      17 UGood -  2.728 TB SATA HDD N   N  512B ST3000DM001-1ER166  U  -    
252:1      16 UGood -  2.728 TB SATA HDD N   N  512B ST3000DM001-1ER166  U  -    
252:2      15 UGood -  2.728 TB SATA HDD N   N  512B ST3000DM001-1ER166  U  -    
252:3      14 UGood -  3.637 TB SATA HDD N   N  512B ST4000NM0035-1V4107 U  -    
252:4      21 UGood -  2.728 TB SATA HDD N   N  512B ST3000DM001-1ER166  U  -    
252:5      20 UGood -  2.728 TB SATA HDD N   N  512B ST3000DM001-1ER166  U  -    
252:6      19 UGood -  2.728 TB SATA HDD N   N  512B ST3000DM001-1ER166  U  -    
252:7      18 UGood -  2.728 TB SATA HDD N   N  512B ST3000DM001-1ER166  U  -    
-------------------------------------------------------------------------------

2.2. 创建raid-x

命令参数:

storcli /cx add vd type=raid[0|1|5|6|00|10|50|60] [Size=<VD1_Sz>,<VD2_Sz>,..|all] [name=<VDNAME1>,..] drives=e:s|e:s-x,y;e:s-x,y,z [PDperArray=x] [SED] [pdcache=on|off|default] [pi] [DimmerSwitch(ds)=default|automatic(auto)|none|maximum(max)|MaximumWithoutCaching(maxnocache)] [wt|wb] [nora|ra] [direct|cached] [CachedBadBBU|NoCachedBadBBU][cachevd] [Strip=<8|16|32|64|128|256|1024>] [AfterVd=X] [Spares = [e:]s|[e:]s-x|[e:]s-x,y] [force][ExclusiveAccess]

实例:

# 查看磁盘物理位置(一般为252:0-7    8个盘的话)
storcli /c0 show all
 
# raid-0
storcli /cx add vd type=r0 drives=252:0-7 wb ra
 
# raid-1
storcli /cx add vd type=r1 drives=252:0-7 wb ra
 
# 创建raid-5,write-bakc,read-ahead
storcli /cx add vd type=raid5 size=all names=VD1 drives=32:2-7 wb ra
 
# 创建 raid10/50/60 必须制定PDperArray参数,write-bakc,read-ahead
storcli /cx add vd type=raid10 size=all names=VD1 drives=32:2-7 PDperArray=2 wb ra
 
# Initializing a VD
storcli /cx/vx start init [force]
# 查看initial进度
storcli /cx/vx show init
# 完成后查看VD状态
storcli /cx /vall show [all]
# 删除VD
storcli /cx/v2 del [force]

2.3. hot spare

# sets the drives /c0/e3/s4,5 as Global Hot spare.
storcli /c0/e3/s4,5 add hotsparedrive
# sets /c0/e3/s6,8 as Dedicated Hot spare for disk groups 0,1.
storcli /c0/e3/s6,8 add hotsparedrive dgs=0,1
# deletes a hot spare drive.
storcli /c0/e3/s4,5 delete hotsparedrive

2.4. CacheCade device

创建CacheCade device:

# storcli /cx add vd cc type=r[0,1,10] drives=[EnclosureID:SlotID|:SlotID-SlotID|:SlotID,SlotID]  WT|WB (assignvds=0,1,2)
storcli /cx add vd cc type=r1 drives=252:2-3 WB
# CacheCade activation/deactivation
# storcli /cx/[vx|vall] set ssdCaching=[on|off]
storcli /cx/v1 set ssdCaching=on

移除CacheCade device:

# Removing a CacheCade device
storcli /cx/vx del cc
# Removing a VD
storcli /cx/vx del [force]

2.5. 删除raid

# 查看阵列(虚拟磁盘)编号,如果只有一个的话,一般就是0
storcli /c0/vall show
# 删除指定编号的阵列
storcli /c0/v0 del
# 清除foreign 信息(从其他地方拔下来的盘可能带有原来阵列的信息,需要清除了才能做新的阵列)
storcli /c0/fall del

2.6. 处理误拔磁盘操作

# If an improperly removed device is reconnected to the RAID controller it will be recognized as UBAD (Unconfigured Bad).
storcli /cx /eall /sall show
# changed to UGOOD
storcli /cx /ex /sx set good
# 现在磁盘状态变为foreign
storcli /cx /fall show
# import
storcli /cx /fall import
# 如果磁盘是原来-raid的一部分,会自动rebuild
storcli /cx /ex /sx show rebuild

2.7. 其他命令

# 升级firmware
storcli /cx download file=/path/to/firmware.rom
# 查看Controller的配置和信息
storcli /cx show all
# 使用激活码应用新特性 (e.g. CacheCade, FastPath,...)
storcli /cx set aso key=AAAAAAAABBBBBBBBCCCCCCCC
 
# 查看VD,健康状态等,获取到坏盘的E:S编号,然后查看对应盘的SN
storcli /c0 /vall show [all]
storcli /c0 /eX /sY show all |grep SN
 
# 查看所有物理磁盘信息
storcli /cx /eall /sall show [all]
# 查看rebuilds状态
storcli /cx /eall /sall show rebuild
# start/stop 擦除wulipan
storcli /c0/e252/s8 start/stop erase
# 查看阵列卡
storcli show ctrlcount
# 查看 virtual disk 0 @controlor 0
storcli /cx /v0 show
# 查看 Controlor-0, Enclosure-7, Slot-7的磁盘信息
storcli /cx/e252/s7 show all
# 查看报警信息
storcli /cx show alarm
# 关闭beep蜂鸣器报警
storcli /cx set alarm=<on|off|silence>
# 定位磁盘仓位
storcli /c0/e8/s2 start/stop locate


1)
StorCli SAS Customization Utility Ver 007.0504.0000.0000 Nov 22, 2017
2)
包含rhel7和esxi6.5的vib软件包
3)
Storage Command Line Tool Ver 007.0127.0000.0000 July 13, 2017
  • hardware/lsi/storcli手册.txt
  • 最后更改: 2019/08/18 13:40
  • 由 mrco