工具介绍
lsscsi 看到每个设备:
[root@ip-10-169-10-100 ~]# dmesg | grep -i raid
[ 19.780227] smartpqi 0000:5c:00.0: added 0:1:0:0 4000000000000000 Direct-Access HPE LOGICAL VOLUME SSDSmartPathCap- En- RAID-1(1+0)
[ 19.780653] smartpqi 0000:5c:00.0: added 0:1:0:1 4000000100000000 Direct-Access HPE LOGICAL VOLUME SSDSmartPathCap+ En+ RAID-0
[ 19.781053] smartpqi 0000:5c:00.0: added 0:1:0:2 4000000200000000 Direct-Access HPE LOGICAL VOLUME SSDSmartPathCap- En- RAID-0
[ 19.781572] smartpqi 0000:5c:00.0: added 0:1:0:3 4000000300000000 Direct-Access HPE LOGICAL VOLUME SSDSmartPathCap- En- RAID-0
[ 19.782376] smartpqi 0000:5c:00.0: added 0:1:0:4 4000000400000000 Direct-Access HPE LOGICAL VOLUME SSDSmartPathCap- En- RAID-0
[ 19.782895] smartpqi 0000:5c:00.0: added 0:1:0:5 4000000500000000 Direct-Access HPE LOGICAL VOLUME SSDSmartPathCap- En- RAID-0
[ 19.783337] smartpqi 0000:5c:00.0: added 0:1:0:6 4000000600000000 Direct-Access HPE LOGICAL VOLUME SSDSmartPathCap- En- RAID-0
[ 19.783733] smartpqi 0000:5c:00.0: added 0:1:0:7 4000000700000000 Direct-Access HPE LOGICAL VOLUME SSDSmartPathCap- En- RAID-0
[ 19.784172] smartpqi 0000:5c:00.0: added 0:1:0:8 4000000800000000 Direct-Access HPE LOGICAL VOLUME SSDSmartPathCap- En- RAID-0
[ 19.784595] smartpqi 0000:5c:00.0: added 0:1:0:9 4000000900000000 Direct-Access HPE LOGICAL VOLUME SSDSmartPathCap- En- RAID-0
[ 19.785020] smartpqi 0000:5c:00.0: added 0:1:0:10 4000000a00000000 Direct-Access HPE LOGICAL VOLUME SSDSmartPathCap- En- RAID-0
[ 19.785623] smartpqi 0000:5c:00.0: added 0:1:0:11 4000000b00000000 Direct-Access HPE LOGICAL VOLUME SSDSmartPathCap- En- RAID-0
[ 19.786475] smartpqi 0000:5c:00.0: added 0:1:0:12 4000000c00000000 Direct-Access HPE LOGICAL VOLUME SSDSmartPathCap- En- RAID-0
[ 19.786875] smartpqi 0000:5c:00.0: added 0:1:0:13 4000000d00000000 Direct-Access HPE LOGICAL VOLUME SSDSmartPathCap- En- RAID-0
[ 19.787298] smartpqi 0000:5c:00.0: added 0:2:0:0 0000000000000000 RAID HPE P816i-a SR Gen10
[ 19.788873] scsi 0:2:0:0: RAID HPE P816i-a SR Gen10 3.53 PQ: 0 ANSI: 5
执行: [root@ip-10-169-10-100 ~]# lspci -s 5c:00.0 -vvv
[root@ip-10-169-10-100 ~]#
[root@ip-10-169-10-100 ~]#
[root@ip-10-169-10-100 ~]# lspci -s 5c:00.0 -vvv
5c:00.0 Serial Attached SCSI controller: Adaptec Smart Storage PQI 12G SAS/PCIe 3 (rev 01)
Subsystem: Hewlett-Packard Company Smart Array P816i-a SR Gen10
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr+ Stepping- SERR+ FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 30
NUMA node: 0
Region 0: Memory at e6f00000 (64-bit, non-prefetchable) [size=32K]
Region 4: I/O ports at 9000 [size=256]
Capabilities: [80] Power Management version 3
Flags: PMEClk- DSI- D1+ D2- AuxCurrent=0mA PME(D0+,D1+,D2-,D3hot+,D3cold-)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [b0] MSI-X: Enable+ Count=64 Masked-
Vector table: BAR=0 offset=00002000
PBA: BAR=0 offset=00003000
Capabilities: [c0] Express (v2) Endpoint, MSI 00
DevCap: MaxPayload 512 bytes, PhantFunc 0, Latency L0s <4us, L1 <1us
ExtTag+ AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 0.000W
DevCtl: Report errors: Correctable- Non-Fatal+ Fatal+ Unsupported-
RlxdOrd+ ExtTag+ PhantFunc- AuxPwr- NoSnoop+
MaxPayload 256 bytes, MaxReadReq 4096 bytes
DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
LnkCap: Port #0, Speed 8GT/s, Width x8, ASPM L1, Exit Latency L0s <1us, L1 <1us
ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp+
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk+
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 8GT/s, Width x8, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
DevCap2: Completion Timeout: Range B, TimeoutDis+, LTR-, OBFF Via message
DevCtl2: Completion Timeout: 65ms to 210ms, TimeoutDis-, LTR-, OBFF Disabled
LnkCtl2: Target Link Speed: 8GT/s, EnterCompliance- SpeedDis-
Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
Compliance De-emphasis: -6dB
LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete+, EqualizationPhase1+
EqualizationPhase2+, EqualizationPhase3+, LinkEqualizationRequest-
Capabilities: [100 v2] Advanced Error Reporting
UESta: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UEMsk: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UESvrt: DLP- SDES+ TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
CESta: RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-
CEMsk: RxErr+ BadTLP+ BadDLLP+ Rollover+ Timeout+ NonFatalErr+
AERCap: First Error Pointer: 00, GenCap+ CGenEn- ChkCap+ ChkEn-
Capabilities: [300 v1] #19
Kernel driver in use: smartpqi
Kernel modules: smartpqi
raid命令: storcli64
/cx = Controller ID
/vx = Virtual Drive Number.
/ex = Enclosure ID
/sx = Slot ID
1 storcli64 -h # 查看帮助信息
2 storcli64 show # 查看RAID卡、系统内核、主机名等信息
3 storcli64 /c0 show all # 查看第一块RAID卡版本、功能、状态、以及raid卡下的物理磁、逻辑盘信息。c0代表第一块raid卡,如果有多块则命令以此类推。
4 storcli64 /c0 show freespace # 查看第一块RAID卡剩下的磁盘空间
5 storcli64 /c0 show rebuildrate # 查看第一块RAID卡rebuildrate速度
6 storcli64 /c0 download file=mr3108fw.rom # 升级第一块RAID卡固件
7 storcli64 /c0 restart # 升级固件后重启RAID卡以便新固件及时生效
8 storcli64 /c0 flushcache # 清除第一块RAID卡缓存
9 storcli64 /c0 /eall /sall show all # 查看第一块RAID卡上物理磁盘详细信息
10 storcli64 /c0 /e252 /s0 start locate # 定位第一块RAID上某块物理磁盘,物理磁盘的绿色的定位灯会闪烁。 e代表Enclosure,s代表Slot或PD
11 storcli64 /c0 /ex /sx stop locate # 停止定位,定位灯停止闪烁。
12 storcli64 /c0 /e252 /sall show rebuild # 查看磁盘重建进度
13 storcli64 /c0 /ex /sx start rebuild # 开始重建
14 storcli64 /c0 /ex /sx stop rebuild # 停止重建
15 storcli64 /c0 /ex /sx add hostsparedrive dgs=0 # 设置某块物理磁盘为磁盘组0的热备盘,如果不指定dgs,则为该RAID卡上全局热备盘。
16 storcli64 /c0 /ex /sx delete hostsparedrive # 删除热备磁盘
17 storcli64 /c0 add vd each type=raid0 drives=252:0,1,2,3 # 单独为每一块物理磁盘创建raid0
18 storcli64 /c0 add vd type=raid5 size=all names=tmp1 drives=32:2-4 # 由第3、4、5块物理磁盘来构建RAID5,分配所有空间的逻辑磁盘命名tmp1。
19 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。)
20 storcli64 /c0 add vd type=raid10 size=100GB,200GB names=tmp1,tmp2 drives=32:0-3 pdperarray=2 # 由前四块物理磁盘构建raid10,分别分配多个逻辑磁盘。
21 storcli64 /c0 add vd type=raid10 size=all names=tmp3 drives=32:0-3 pdperarray=2 # 剩下的所有空间分配给逻辑磁盘tmp3。
22 storcli64 /c0 /vall show all # 显示第一块RAID卡上所有逻辑磁盘相关信息,也可指定某个逻辑磁盘v0,v1等等。
23 storcli64 /c0 /v0 show # 显示第一块RAID卡上第一个逻辑磁盘信息
24 storcli64 /c0 /v0 del force # 强制删除某个逻辑磁盘
25 storcli64 /c0 /bbu show all # 显示bbu信息
26 storcli64 /c0 /vall set wrcache=wt/wb/awb # 设置写策略
27 storcli64 /c0 show alarm # 查看报警器信息
28 storcli64 /c0 set alarm=silence # 暂时关闭报警器鸣叫
29 storcli64 /c0 set alarm=off # 始终关闭报警器鸣叫
30 storcli64 /c0 /e252 /s3 set good # 改变插入的物理磁盘的状态
31 storcli64 /c0 /e252 /s3 start initialization # 初始化某个物理磁盘
32 storcli64 /c0 /e252 /s3 show initialization # 查看某个初始化的物理磁盘进度
33 storcli64 /c0 /v0 set wrcache=wt # 修改vd的写策略
34 storcli64 /c0 /v0 set rdcache=nora # 修改vd的读策略
35 storcli64 /c0 /fall show # 查看foreign信息
36 storcli64 /c0 /fall import # 导入foreign
37 storcli64 /c0 show termlog type=contents # 在线查看日志
38 storcli64 /c0 show termlog type=contents | grep "rebuild" # 在线查看日志抽取关键字
39 storcli64 /c0 show events file=/home/eventreports # 将日志存储为文件