storcli64使用详解

storcli64使用详解

几个常用缩写含义介绍-无基础请先看此处

Ctl 控制器号,每个控制前对应一个控制器号,默认从0开始编号

EID 背板号,默认一般是252,也有8等不同的数字,以查出来的为准

Slt 槽位号,每片硬盘对应一个槽位号

State 硬盘状态

PDs 硬盘数

DGs 硬盘组数量

VDs Raid数量

Hlth 健康状态

查看系统信息

#查出控制器号为0,即:c0

图片[1]|storcli64使用详解|安可通用设备资源站
(标红区域)

查看指定Raid卡信息

#查出背板号为252,即:e252

查出槽位号为4、5、6、7 即:s4、s5、s6、s7

图片[2]|storcli64使用详解|安可通用设备资源站
(标红区域)

命令集合


/opt/MegaRAID/storcli/storcli64 -v    显示软件版本信息

/opt/MegaRAID/storcli/storcli64 -h    查看帮助信息

/opt/MegaRAID/storcli/storcli64 show    查看RAID卡、系统内核、主机名等信息

/opt/MegaRAID/storcli/storcli64 /c0 set alarm=on/off  开启或者关闭蜂鸣器报警

/opt/MegaRAID/storcli/storcli64 /c0 show all    查看第一块RAID卡版本、功能、状态、以及raid卡下的物理磁、逻辑盘信息。c0代表第一块raid卡,如果有多块则命令以此类推。

/opt/MegaRAID/storcli/storcli64 /c0 show freespace    查看第一块RAID卡剩下的磁盘空间

/opt/MegaRAID/storcli/storcli64 /c0 show rebuildrate    查看第一块RAID卡rebuildrate速度

/opt/MegaRAID/storcli/storcli64 /c0 download file=mr3108fw.rom    升级第一块RAID卡固件

/opt/MegaRAID/storcli/storcli64 /c0 restart    升级固件后重启RAID卡以便新固件及时生效

/opt/MegaRAID/storcli/storcli64 /c0 flushcache     清除第一块RAID卡缓存

/opt/MegaRAID/storcli/storcli64 /c0/eall/sall show all     查看第一块RAID卡上物理磁盘详细信息

/opt/MegaRAID/storcli/storcli64 /c0/e252/s0 start locate 定位第一块RAID上某块物理磁盘,物理磁盘的绿色的定位灯会闪烁。 e代表Enclosure,s代表Slot或PD

/opt/MegaRAID/storcli/storcli64 /c0/ex/sx stop locate    停止定位,定位灯停止闪烁。

/opt/MegaRAID/storcli/storcli64 /c0/e252/sall show rebuild  查看磁盘重建进度

/opt/MegaRAID/storcli/storcli64 /c0/ex/sx start rebuild    开始重建

/opt/MegaRAID/storcli/storcli64 /c0/ex/sx stop rebuild    停止重建

/opt/MegaRAID/storcli/storcli64 /c0/ex/sx add hotsparedrive dgs=0    设置某块物理磁盘为磁盘组0的热备盘,如果不指定dgs,则为该RAID卡上全局热备盘。

/opt/MegaRAID/storcli/storcli64 /c0/ex/sx1,2  add hotsparedrive dgs=0,1,2  设置两块物理磁盘为磁盘组0,1,2的特定热备。

/opt/MegaRAID/storcli/storcli64 /c0/ex/sx delete hotsparedrive    删除热备磁盘

图片[3]|storcli64使用详解|安可通用设备资源站
必须含有的参数 RAID类型 RAID大小 RAID名称 和包含的磁盘格式storcli64 /cx add RAID r  0|1|5|6|10|50|60 Size=<RAID1_Sz>,<RAID2_Sz>,..|*all  name=<RAIDNAME1>,drives=e:s|e:s-x|e:s-x,y;e:s-x,y,z(列:做raid5 ./storcli64 /c0 add vd r5 drives=252:0-3)
图片[4]|storcli64使用详解|安可通用设备资源站
出现status=Success即为成功

/opt/MegaRAID/storcli/storcli64 /c0 add vd each type=raid0 drives=252:0,1,2,3     单独为每一块物理磁盘创建raid0

/opt/MegaRAID/storcli/storcli64 /c0 add vd type=raid5 size=all names=tmp1 drives=32:2-4    由第3、4、5块物理磁盘来构建RAID5,分配所有空间的逻辑磁盘命名tmp1。

/opt/MegaRAID/storcli/storcli64 /c0 add vd type=raid10 size=all names=tmp1 drives=32:0-3 pdperarray=2    由前四块物理磁盘构建raid10,分配所有空间的逻辑磁盘命名为tmp1。(注意:LSI SAS3108最多支持64个RAID,创建10/50/60时,必须指定pdperarray参数。如果没有这个参数,是创建不成功的。这个参数的含义是:Specifies the number of physical drives per array. The default value is automatically chosen。)

/opt/MegaRAID/storcli/storcli64 /c0 add vd type=raid10 size=100GB,200GB names=tmp1,tmp2 drives=32:0-3 pdperarray=2    由前四块物理磁盘构建raid10,分别分配多个逻辑磁盘。

/opt/MegaRAID/storcli/storcli64 /c0 add vd type=raid10 size=all names=tmp3 drives=32:0-3 pdperarray=2    剩下的所有空间分配给逻辑磁盘tmp3。

/opt/MegaRAID/storcli/storcli64 /c0 /vall show all     显示第一块RAID卡上所有逻辑磁盘相关信息,也可指定某个逻辑磁盘v0,v1等等。

/opt/MegaRAID/storcli/storcli64 /c0/v0 show     显示第一块RAID卡上第一个逻辑磁盘信息

/opt/MegaRAID/storcli/storcli64 /c0/v0 del force   强制删除某个逻辑磁盘

/opt/MegaRAID/storcli/storcli64 /c0/bbu show all   显示bbu信息

/opt/MegaRAID/storcli/storcli64 /c0/cv start learn  立即启动bbu充放电循环

/opt/MegaRAID/storcli/storcli64 /c0/vall set wrcache=wt/wb/awb 设置写策略

/opt/MegaRAID/storcli/storcli64 /c0 show alarm    查看报警器信息

/opt/MegaRAID/storcli/storcli64 /c0 set alarm=silence   暂时关闭报警器鸣叫

/opt/MegaRAID/storcli/storcli64 /c0 set alarm=off       始终关闭报警器鸣叫

/opt/MegaRAID/storcli/storcli64 /c0/e252/s3 set good    改变插入的物理磁盘的状态

/opt/MegaRAID/storcli/storcli64 /c0/e252/s3 start initialization    初始化某个物理磁盘

/opt/MegaRAID/storcli/storcli64 /c0/e252/s3 show initialization    查看某个初始化的物理磁盘进度

/opt/MegaRAID/storcli/storcli64 /c0/v0 set wrcache=wt   修改vd的写策略

/opt/MegaRAID/storcli/storcli64 /c0/v0 set rdcache=nora   修改vd的读策略

/opt/MegaRAID/storcli/storcli64 /c0/fall show   查看foreign信息

/opt/MegaRAID/storcli/storcli64 /c0/fall import    导入foreign

/opt/MegaRAID/storcli/storcli64 /c0 show termlog type=contents       在线查看日志

/opt/MegaRAID/storcli/storcli64 /c0 show termlog type=contents | grep “rebuild”    在线查看日志抽取关键字

/opt/MegaRAID/storcli/storcli64 /c0 show events file=/home/eventreports    将日志存储为文件

/opt/MegaRAID/storcli/storcli64 /c0 show snapdump ………………………………..显示snapdump状态

/opt/MegaRAID/storcli/storcli64 /c0 get snapdump …………………………………..获取所有Snapdump日志文件

/opt/MegaRAID/storcli/storcli64 /c0 show all > AdpInfo.txt………………………RAID卡的全部基本信息

/opt/MegaRAID/storcli/storcli64 /c0 show termlog > FwTmLog.txt……………………系统下的实时log

/opt/MegaRAID/storcli/storcli64 /c0/pall show all > PhyErr.txt…………………………Phy的连接错误

/opt/MegaRAID/storcli/storcli64 /c0/eall/sall show all > PdList.txt……………………硬盘的基本信息

/opt/MegaRAID/storcli/storcli64 /c0/vall show all > LdInfo.txt…………………………RAID阵列的信息

/opt/MegaRAID/storcli/storcli64 /c0 show events > EvtLog.txt…………………………RAID卡的Eventlog

/opt/MegaRAID/storcli/storcli64 /c0/e36/s1 set good…………………………设置控制器 0 背板36 槽位号为1的磁盘状态为good
/opt/MegaRAID/storcli/storcli64 /c0/e36/s1 set offline…………………………设置控制器 0 背板36 槽位号为1的磁盘状态为offline
/opt/MegaRAID/storcli/storcli64 /c0/e36/s1 set online…………………………设置控制器为0 背板为36 槽位号为1的磁盘状态为online
/opt/MegaRAID/storcli/storcli64 -PDList -aALL…………………………查看磁盘健康状态

  • Adapter#0 —–raid卡控制器编号
  • EnclosureDevice ID: 252 —–外壳设备ID,也就是raid卡的ID号
  • SlotNumber: 4 ——槽号
  • Enclosureposition: 0 ——外壳位置
  • DeviceId: 49 —–设备ID
  • SequenceNumber: 2 —–序号
  • Media Error Count: 0 —–介质错误计数
  • Other Error Count: 0 —–其它错误计数
  • Predictive Failure Count: 0 —–预测故障计数
  • Last Predictive Failure Event Seq Number: 0
  • PD Type:SATA —–磁盘接口类型
  • Raw Size:3.638 TB [0x1d1c0beb0 Sectors] —–磁盘原始大小
  • NonCoerced Size: 3.637 TB [0x1d1b0beb0 Sectors] —–磁盘标准大小
  • CoercedSize: 3.637 TB [0x1d1b00000 Sectors] ——磁盘最大可用大小
  • Firmware state: Unconfigured(good),Spun down —–固件状态:未配置(好的),未连接
  • SASAddress(0): 0x4433221107000000
  • ConnectedPort Number: 3(path0) ——连接端口号
  • InquiryData: Z1ZBBJWWST4000NM0033-9ZM170 SN06 —–硬盘的序列号、型号、固件版本
  • FDECapable: Not Capable
  • FDEEnable: Disable
  • Secured:Unsecured
  • Locked:Unlocked
  • Needs EKMAttention: No
  • ForeignState: None
  • DeviceSpeed: 6.0Gb/s
  • LinkSpeed: 6.0Gb/s
  • MediaType: Hard Disk Device
  • Drive: Not Certified
  • DriveTemperature : N/A —-设备温度
  • 需要特别关注这几个指标:Media Error / Other Error / Predictive Failure Count / LastPredictive Failure Event Seq Number

/opt/MegaRAID/storcli/storcli64 /c0 /eall/sall show …………………………查看磁盘状态:磁盘状态为UGOOD空闲盘,磁盘状态为DHS为专属热备,磁盘状态为GHS为全局热备
添加专属热备

  • 获得dgs号 /opt/MegaRAID/storcli/storcli64 /call/vall show 可看到DG及dgs的值为特定的DG配置热备
  • 获取空闲磁盘/opt/MegaRAID/storcli/storcli64 /c0 /eall/sall show 磁盘状态为UGOOD
图片[5]|storcli64使用详解|安可通用设备资源站
以上DG代表drive group,是配置raid建分组的顺序;VD代表virtual disk,即虚拟磁盘,对应的就是服务器中的sda、sdb等。

c.   语法/opt/MegaRAID/storcli/storcli64 /cx/ex/sx add hotsparedrive dgs=x
例:/opt/MegaRAID/storcli/storcli64 /c0/e3/s6 add hotsparedrive dgs=0 背板为3,槽位为6的磁盘做 dgs为0的RAID的专属热备
添加全局热备

  • 查看空闲磁盘/opt/MegaRAID/storcli/storcli64 /c0 /eall/sall show  磁盘状态为UGOOD
  • /opt/MegaRAID/storcli/storcli64 /cx/ex/sx add hotsparedrive

   如:/opt/MegaRAID/storcli/storcli64 /c0/e3/s6 add hotsparedrive    背板为3,槽位为6的磁盘作为全局热备
删除热备

  • 查看热备盘  /opt/MegaRAID/storcli/storcli64 /c0 /eall/sall show  磁盘状态为DHS,GHS

         b.   删除热备盘 /opt/MegaRAID/storcli/storcli /c0/ex/sx delete hotsparedrive 
删除RAID

/opt/MegaRAID/storcli/storcli64 /c0/vall show…………………………查看要删除的RAID 查看到对应的VD号 
/opt/MegaRAID/storcli/storcli64 /cx/vx del…………………………删除RAID
例:/opt/MegaRAID/storcli/storcli64 /c0/v1 del 删除虚拟设备号为1的RAID
删除含有用户数据(MBR或者分区信息)的RAID
/opt/MegaRAID/storcli/storcli64 /cx/vx del force
查看RAID

/opt/MegaRAID/storcli/storcli64 /call/vall show…………………………查看控制器上的所有RAID
/opt/MegaRAID/storcli/storcli64 /c0/v1 show all…………………………查看具体的RAID虚拟设备号为1的详细信息
RAID缓存设置

设置写缓存语法:/opt/MegaRAID/storcli/storcli64 /cx/vx set wrcache=wt|wb|awb  wt 是关闭缓存wb 在RAID卡没有电池的情况下开启写缓存 awb在RAID卡含有电池的情况下开启写缓存
设置读缓存语法:/opt/MegaRAID/storcli/storcli64 /cx/vx set racache=nora|ra nora不会读缓存里面内容 ra 先读缓存里有的内容
设置io 优先级的语法:/opt/MegaRAID/storcli/storcli64 /cx/vx set iopolicy=direct|cached
开启读缓存
/opt/MegaRAID/storcli/storcli64 /call/v1 set rdcache=ra 
开启写缓存
开启写缓存需要先设置IO优先级为缓存 /opt/MegaRAID/storcli/storcli /c0/v1 set iopolicy=cached
/opt/MegaRAID/storcli/storcli64 /call/v1 set wrcache=wb
或者 /opt/MegaRAID/storcli/storcli64 /call/v1 set wrcache=awb
关闭读缓存
/opt/MegaRAID/storcli/storcli64 /call/v1 set rdcache=nora
关闭写缓存
/opt/MegaRAID/storcli/storcli64 /call/v1 set wrcache=wt
1.6.6 RAID初始化

查看快速初始化
/opt/MegaRAID/storcli/storcli64 /cx/vx show init  
开启快速初始化
/opt/MegaRAID/storcli/storcli64 /cx/vx start init
开启完全初始化
/opt/MegaRAID/storcli/storcli64 /cx/vx start init full
停止初始化
/opt/MegaRAID/storcli/storcli64 /cx/vx stop init
 RAID5(5块以上)和RAID6(6块以上)在进行快速初始化时会转到后台进行初始化
查看后台初始化
/opt/MegaRAID/storcli/storcli64 /cx/vx show bgi
停止初始化
/opt/MegaRAID/storcli/storcli64 /call/v1 stop bgi
挂起初始化
/opt/MegaRAID/storcli/storcli64 /call/v1 suspend bgi
1.6.7 RAID一致性校验

查看初始化
/opt/MegaRAID/storcli/storcli64 /cx/vx show cc
开启初始化
/opt/MegaRAID/storcli/storcli64 /cx/vx start cc
停止初始化
/opt/MegaRAID/storcli/storcli64 /cx/vx stop cc
smartor基本设置下一致性校验 是在特定的时间执行一致性校验,在页面设置即可
LSIRAID卡自带的一致性校验
查看一致性校验执行的具体时间
/opt/MegaRAID/storcli/storcli64 /cx show cc
设置卡自带的一致性校验方式顺序或者并发
/opt/MegaRAID/storcli/storcli64 /cx set consistencycheck=seq|con
关闭卡自带的一致性校验 
/opt/MegaRAID/storcli/storcli64 /cx set cc=off

/opt/MegaRAID/storcli./storcli64 /c0/fall import…………………………导入frgn状态的DG

图片[6]|storcli64使用详解|安可通用设备资源站
如图vd出现Frgn状态

其中内容来源如下文章:

storcli 简易使用介绍:https://www.lmlphp.com/user/61479/article/item/618691/
华为服务器 RAID控制卡 用户指南(x86):
https://support.huawei.com/enterprise/zh/doc/EDOC1000163568/4a8ec8fa

© 版权声明
THE END
喜欢就支持一下吧
点赞201赞赏 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容