目录
From Lin.Wang
Section One : Introduction
strocli是megacli的升级版本,针对于戴尔服务器是perccli,用法完全一致
smartctl可以查看磁盘的主控芯片smart信息
lsscsi可以查看系统的scsi信息,数据来源/proc/scsi/scsi相关,该文档此处暂不介绍
这些工具都是查看磁盘相关信息的常用工具,对于排查磁盘状态和raid卡问题都有帮助
Section Two : Install package
安装一下storcli或者perccli,并且将命令软连接到/usr/bin/目录下,方便使用命令:
ln -s /opt/MegaRAID/storcli/storcli64 /usr/bin/
ln -s /opt/MegaRAID/perccli/percclie64 /usr/bin/
Section Three : Step
由系统磁盘盘符/dev/sdf定位对应的硬盘盘位思路如下:
perccli64 /c0/eall/sall show 看到该磁盘有
img-/c0/eall/sall 从该图看到有四个jbod分区,根据经验一般人为jbod的分区系统盘符会在raid分区之前,也就是说jbod的分区会从/dev/sda > /dev/sdd,raid的分区从/dev/sde开始;
DG代表drive group,是配置raid建分组的顺序,有图上看到32:4和32:5是一个卷组。
perccli64 /c0/vall show看到该磁盘的DG与VD的对应关系如下
img-/c0/vall 由图上看到DG/VD就是raid的卷组和系统里卷组的顺序对应关系,一般如果服务器只有raid卷组来说的话,VD0就是操作系统里的/dev/sda,以此类推;但是如果服务器包括了jbod卷组,则raid的卷组从jbod后开始排序,本例中也就是VD0=/dev/sde,则要定位/dev/sdf的话VD=1,对应DG=1;
回到img-/c0/eall/sall上,DG为1时,DID=6,DID就是device id,这个概念后边有用;同时Slot NO.也就是slt = 6对应的服务器上盘位就是第7个(从0开始到6),此时即定位到了/dev/sdf的物理盘位。
反之从服务器上看到硬盘故障灯,可以反推对应的系统分区盘符
Note:
如果服务器没有jbod卷组,全是raid的,则此时/c0/vall找到对应关系即可定位关联关系
实际操作时还可以通过 perccli64 /c0/e32/s6 start/stop locate点亮关闭磁盘灯,来判断定位是否正确
Section Four : storcli/perccli Usage
查看控制器的信息
perccli64 show ctrlcount 查看有几个控制器即几个raid卡
perccli64 show 显示raid卡信息
[root@node-15 ~]# perccli64 show
Status Code = 0
Status = Success
Description = None
Number of Controllers = 1
Host Name = node-15.domain.tld
Operating System = Linux3.10.0-327.20.1.es2.el7.x86_64
System Overview :
===============
------------------------------------------------------------------------
Ctl Model Ports PDs DGs DNOpt VDs VNOpt BBU sPR DS EHS ASOs Hlth
------------------------------------------------------------------------
0 PERCH730Mini 8 16 11 0 11 0 Opt On 3 N 0 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
可以看到只有一个raid卡,ctrl 0也是就是/c0
storcli64 /c0 show
[root@node-15 ~]# perccli64 /c0 show
Generating detailed summary of the adapter, it may take a while to complete.
Controller = 0
Status = Success
Description = None
Product Name = PERC H730 Mini
Serial Number = 663021Z
SAS Address = 51866da066153000
PCI Address = 00:03:00:00
System Time = 01/10/2019 20:48:38
Mfg. Date = 06/17/16
Controller Time = 01/10/2019 12:44:21
FW Package Build = 25.4.0.0017
BIOS Version = 6.29.00.0_4.16.07.00_0x06120100
FW Version = 4.260.00-6259
Driver Name = megaraid_sas
Driver Version = 06.807.10.00-rh1
Current Personality = RAID-Mode
Vendor Id = 0x1000
Device Id = 0x5D
SubVendor Id = 0x1028
SubDevice Id = 0x1F49
Host Interface = PCI-E
Device Interface = SAS-12G
Bus Number = 3
Device Number = 0
Function Number = 0
Drive Groups = 11
TOPOLOGY :
========
---------------------------------------------------------------------------
DG Arr Row EID:Slot DID Type State BT Size PDC PI SED DS3 FSpace TR
---------------------------------------------------------------------------
0 - - - - RAID1 Optl N 931.0 GB dflt N N dflt N N
0 0 - - - RAID1 Optl N 931.0 GB dflt N N dflt N N
0 0 0 32:4 4 DRIVE Onln N 931.0 GB dflt N N dflt - N
0 0 1 32:5 5 DRIVE Onln N 931.0 GB dflt N N dflt - N
1 - - - - RAID0 Optl N 931.0 GB dflt N N dflt N N
1 0 - - - RAID0 Optl N 931.0 GB dflt N N dflt N N
1 0 0 32:6 6 DRIVE Onln N 931.0 GB dflt N N dflt - N
2 - - - - RAID0 Optl N 931.0 GB dflt N N dflt N N
2 0 - - - RAID0 Optl N 931.0 GB dflt N N dflt N N
2 0 0 32:7 7 DRIVE Onln N 931.0 GB dflt N N dflt - N
3 - - - - RAID0 Optl N 931.0 GB dflt N N dflt N N
3 0 - - - RAID0 Optl N 931.0 GB dflt N N dflt N N
3 0 0 32:8 8 DRIVE Onln N 931.0 GB dflt N N dflt - N
4 - - - - RAID0 Optl N 931.0 GB dflt N N dflt N N
4 0 - - - RAID0 Optl N 931.0 GB dflt N N dflt N N
4 0 0 32:9 9 DRIVE Onln N 931.0 GB dflt N N dflt - N
5 - - - - RAID0 Optl N 931.0 GB dflt N N dflt N N
5 0 - - - RAID0 Optl N 931.0 GB dflt N N dflt N N
5 0 0 32:10 10 DRIVE Onln N 931.0 GB dflt N N dflt - N
6 - - - - RAID0 Optl N 931.0 GB dflt N N dflt N N
6 0 - - - RAID0 Optl N 931.0 GB dflt N N dflt N N
6 0 0 32:11 11 DRIVE Onln N 931.0 GB dflt N N dflt - N
7 - - - - RAID0 Optl N 931.0 GB dflt N N dflt N N
7 0 - - - RAID0 Optl N 931.0 GB dflt N N dflt N N
7 0 0 32:12 12 DRIVE Onln N 931.0 GB dflt N N dflt - N
8 - - - - RAID0 Optl N 931.0 GB dflt N N dflt N N
8 0 - -