定位硬盘盘位和盘符的方法
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 - - - raid0 optl n 931.0 gb dflt n n dflt n n
8 0 0 32:13 13 drive onln n 931.0 gb dflt n n dflt - n
9 - - - - raid0 optl n 931.0 gb dflt n n dflt n n
9 0 - - - raid0 optl n 931.0 gb dflt n n dflt n n
9 0 0 32:14 14 drive onln n 931.0 gb dflt n n dflt - n
10 - - - - raid0 optl n 931.0 gb dflt n n dflt n n
10 0 - - - raid0 optl n 931.0 gb dflt n n dflt n n
10 0 0 32:15 15 drive onln n 931.0 gb dflt n n dflt - n
---------------------------------------------------------------------------
dg=disk group index|arr=array index|row=row index|eid=enclosure device id
did=device id|type=drive type|onln=online|rbld=rebuild|dgrd=degraded
pdgd=partially degraded|offln=offline|bt=background task active
pdc=pd cache|pi=protection info|sed=self encrypting drive|frgn=foreign