#下载地址 https://www.broadcom.com/products/storage/raid-controllers/megaraid-sas-9361-8i#downloads https://docs.broadcom.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/007.1907.0000.0000_Unified_StorCLI.zip ##Management Software and Tools yum install -y storcli sudo ln -s /opt/MegaRAID/storcli/storcli64 /bin/storcli64 sudo ln -s /opt/MegaRAID/storcli/storcli64 /sbin/storcli #查询raid卡 storcli show ------------------------------------------------------------------------- Ctl Model AdapterType VendId DevId SubVendId SubDevId PCI Address ------------------------------------------------------------------------- 0 SAS9311-8i SAS3008(C0) 0x1000 0x97 0x1000 0x3090 00:b3:00:00 ------------------------------------------------------------------------- #查询Ctl=0的卡信息 根据查到的卡的Ctl controllerID 替换成c0 c1 storcli /c0 show ----------------------------------------------------------------------------- EID:Slt DID State DG Size Intf Med SED PI SeSz Model Sp ----------------------------------------------------------------------------- 2:5 1 UGood - 16.369 TB SATA HDD - - 512B ST18000NM000J-2TV103 - 4:27 3 UGood - 16.369 TB SATA HDD - - 512B ST18000NM000J-2TV103 - :0 0 UGood - 893.137 GB SATA SSD - - 512B SE005-960GB-H - ----------------------------------------------------------------------------- #Ctl/EID/slt Controller ID(raid卡) Enclosure ID(背板) Slot ID(盘序) #保存到文件 storcli /c0 show all logfile=logfile.txt #查看日志 storcli64 /ccontroller_id show termlog storcli64 /ccontroller_id show events storcli64 /ccontroller_id show snapdump storcli64 /ccontroller_id delete termlog storcli64 /ccontroller_id delete events storcli64 /ccontroller_id delete snapdump force storcli64 /ccontroller_id set snapdump state=on|off #导入导出配置 storcli64 /ccontroller_id get config file=filename storcli64 /ccontroller_id set config file=filename #查询某个盘的信息 storcli /c$x/e$y/s$z show all #点亮某个盘的故障灯/使某个盘的灯闪烁 storcli /c$x/e$y/s$z start locate storcli /c$x/e$y/s$z stop locate #例子 storcli /c0/e2/s5 start locate storcli /c0/e2/s5 stop locate storcli /c0/e4/s27 start locate storcli /c0/e /s0 start locate #切换Personality storcli /c0 set personality = jbod storcli /c0 set personality = raid #设置JBOD storcli /c0/e252/s1 set jbod storcli /c0/e252/s1 del jbod force #取消直通 将“Unconfigured Bad”状态下的slot 1硬盘设置为“Unconfigured Good”(UGood)状态 storcli /c0/e252/s1 set good force #循环 storcli64 /c0/e8/sall set jbod #关闭sCC=Scheduled Check Consistency检查一致性 ./storcli64 /c0/vall stop cc storcli /c0 set CC=conc starttime=2012/02/21 00 #删除raid storcli /c0/vall show storcli /c0/v0 delete force #增加raid storcli /c0 add VD r1 drives=30:3,30:4 storcli /c0 add VD r5 drives=252:0-3 storcli /c0 add VD r0 drives=93:3-4 storcli /c0 add vd type=raid5 size=all drives=8:0,8:1,8:2 awb ra #开启Raid5写缓存命令: storcli /c0 /v1 set wrcache=awb storcli /c0 /vall set rdcache=RA wrcache=WB pdcache=off # 清除raid卡、物理磁盘cache storcli /c0 flushcache #删除掉控制器c0的所有外部配置信息 storcli /c0/fall delete #擦除硬盘 erase mode:可选simple|normal|thorough,分别对硬盘进行一遍|三遍|九遍擦除。 storcli /c0/e2/s11 start erase simple storcli /c0/e2/s11 show erase storcli /c0/e2/s11 stop erase #蜂鸣器开关 storcli64 /ccontroller_id show alarm storcli64 /ccontroller_id set alarm={on|off|silence} #全局热备开启 关闭 storcli64 /c0 set eghs eug=on storcli64 /c0 set eghs smarter=on storcli64 /c0 set eghs eug=off storcli64 /c0 set eghs smarter=off #设置全局热备盘 storcli64 /c0/e8/s3 add hotsparedrive storcli64 /c0/e8/s3 delete hotsparedrive #设置vd0的局部热备盘 storcli64 /c0/e8/s3 add hotsparedrive dgs=0 #升级固件 storcli64 /c1 download file=TFM_70-26832-00.rom fwtype=2 storcli /c0 download file=mr3108fw.rom noverchk storcli64 /c1 restart 1、RAID重建 storcli /cx set rebuildrate=x # 整数,设置RAID重构速率 storcli /cx show rebuildrate # 查看重构速率 storcli /cx/ex/sx show rebuild # 查看某块盘的重构情况 storcli /cx/ex/sx pause rebuild # 暂停重构 2、巡读 storcli /cx set patrolread=[on|off] # 开启或关闭巡读 storcli /cx show patrolread # 查看控制器巡读相关信息 3、全局热备盘 storcli /cx/ex/sx add hotsparedrive # 设置某块盘为全局热备盘 storcli /cx/ex/sx delete hostsparedrive # 删除某块全局热备盘 storcli /cx/ex/sx add hotsparedrive dgs=0 # 设置某块盘为某个磁盘组的局部热备盘 4、定位磁盘 storcli /cx/ex/sx start locate # 打开磁盘指示灯 storcli /cx/ex/sx stop locate # 关闭磁盘指示灯 5、虚拟驱动器(逻辑磁盘) storcli /cx/vall show # 显示逻辑磁盘信息 storcli /cx/vall show all # 显示更详细的逻辑磁盘信息 storcli /cx/vx del # 删除逻辑磁盘,此命令会等待cache中的数据写入磁盘 storcli /cx/vx del force # 删除逻辑磁盘,此命令不会等待cache中的数据写入磁盘 storcli /cx/[vx|vall] set wrcache=wt/wb/awb # 设置逻辑磁盘的写策略 6、物理磁盘初始化 storcli /cx/ex/sx start initialization # 硬盘初始化 storcli /cx/ex/sx show initialization # 查询初始化进度 storcli /cx/ex/sx stop initialization 7、Raid初始化 storcli /cx/vx start init # 快速初始化 storcli /cx/vx start init full # 完全初始化 storcli /cx/vx [show|pause|resume|stop] bgi # 查看、暂停、继续、停止初始化 storcli64 /ccontroller_id/vraid_id set autobgi= storcli64 /c0 /vall set autobgi=off storcli64 /c0 /vall show autobgi 注: init:只把 RAID 的前 100MByte 空间进行全写0操作,随后此RAID的状态就变为“Optimal”。 init full:把整个RAID都初始化为0,才会结束初始化过程,在此之前RAID状态为“initialization”。 8、其它 storcli /cx download file=filepath # 升级raid卡固件,需要重启 storcli /cx flushcache # 清除raid卡、物理磁盘cache #megacli megacli -PDList -aALL #查看raid megacli ldinfo lall a0 #创建一个raid5阵列,由物理盘2,3,4构成,该阵列的热备盘是物理盘5 megacli -CfgLdAdd -r5 [1:2,1:3,1:4] WB Direct -Hsp[1:5] -a0 #创建阵列,不指定热备 megacli -CfgLdAdd -r5 [14:0,14:1,14:2,14:3,14:4,14:5,14:6,14:7,14:8,14:9,14:10,14:11] WB Direct -a0 #创建一个raid10阵列,由物理盘2,3和4,5分别做raid1,在将两组raid1做raid0 megacli –CfgSpanAdd –r10 –Array0[1:2,1:3] –Array1[1:4,1:5] WB Direct -a0