Linux使用storcli工具查看服务器硬盘和raid组信息
1、简介
MegaCli 是LSI公司官方提供的SCSI卡管理工具,由于LSI被收购变成了现在的Broadcom,所以现在想下载MegaCli,需要去Broadcom官网查找Legacy产品支持,搜索MegaRAID即可。
现在官方有storcli,storcli已经基本代替了megacli,整合了LSI和3ware所有产品。安装方面比较简单,megacli还要Lib_Utils的支持,而storcli只用一个rpm包就可以下载,去Broadcom官网去找就行了:https://www.broadcom.com/site-search?q=storcli ,storcli支持json格式输出,信息解析更加方便。
2、 安装storcli
rpm -ivh storcli-1.03.11-1.noarch.rpm
目录: /opt/Mega/storcli
2.1 一些参数定义:
/cx = Controller ID
/vx = Virtual Drive Number.
/ex = Enclosure ID
/sx = Slot ID
2.2 为了管理方便,建立软连接
ln -s /opt/MegaRAID/storcli/storcli64 /bin/storcli
ln -s /opt/MegaRAID/storcli/storcli64 /sbin/storcli
如果不想建立软连接,就在/opt/MegaRAID/storcli 目录下 执行./storcli64 指令
3、查看当前设备raid控制器相关信息
[root@localhost storcli]# ./storcli64 show all #可以看到只有一个控制器
Status Code = 0
Status = Success
Description = None
Number of Controllers = 1
Host Name = localhost.localdomain
Operating System = Linux2.6.32-358.el6.x86_64
3.1、查看控制器c0的相关信息
[root@localhost storcli]# ./storcli64 /c0 show
Controller = 0
Status = Success
Description = None
Product Name = PERC H710P Mini #【控制器型号】
Serial Number = 26300UP
SAS Address = 5d4ae520a6bcbc00
Mfg. Date = 06/04/12
System Time = 05/22/2019 16:22:28
Controller Time = 05/22/2019 08:22:28
FW Package Build = 21.0.2-0001
BIOS Version = 5.30.00_4.12.05.00_0x05110000
FW Version = 3.130.05-1587
Driver Name = megaraid_sas
Driver Version = 06.504.01.00-rh1
Controller Bus Type = N/A
PCI Slot = N/A
PCI Bus Number = 2
PCI Device Number = 0
PCI Function Number = 0
Drive Groups = 3
TOPOLOGY :
DG Arr Row EID:Slot DID Type State BT Size PDC PI SED DS3 FSpace
0 - - - - RAID1 Optl N 278.875 GB dflt N N dflt N
0 0 - - - RAID1 Optl N 278.875 GB dflt N N dflt N
0 0 0 32:24 24 DRIVE Onln N 278.875 GB dflt N N dflt -
0 0 1 32:25 25 DRIVE Onln N 278.875 GB dflt N N dflt -
1 - - - - RAID5 Optl N 4.089 TB dflt N N dflt N
1 0 - - - RAID5 Optl N 4.089 TB dflt N N dflt N
1 0 0 32:0 0 DRIVE Onln N 837.75 GB dflt N N dflt -
1 0 1 32:1 1 DRIVE Onln N 837.75 GB dflt N N dflt -
1 0 2 32:2 2 DRIVE Onln N 837.75 GB dflt N N dflt -
1 0 3 32:3 3 DRIVE Onln N 837.75 GB dflt N N dflt -
1 0 4 32:4 4 DRIVE Onln N 837.75 GB dflt N N dflt -
1 0 5 32:5 5 DRIVE Onln N 837.75 GB dflt N N dflt -
2 - - - - RAID5 Optl N 4.089 TB dflt N N dflt N
2 0 - - - RAID5 Optl N 4.089 TB dflt N N dflt N
2 0 0 32:6 6 DRIVE Onln N 837.75 GB dflt N N dflt -
2 0 1 32:7 7 DRIVE Onln N 837.75 GB dflt N N dflt -
2 0 2 32:8 8 DRIVE Onln N 837.75 GB dflt N N dflt -
2 0 3 32:9 9 DRIVE Onln N 837.75 GB dflt N N dflt -
2 0 4 32:10 10 DRIVE Onln N 837.75 GB dflt N N dflt -
2 0 5 32:11 11 DRIVE Onln N 837.75 GB dflt N N dflt - #【可以看到服务器有几个RAID,每个RAID的级别和成员盘】
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
DS3=Dimmer Switch 3|dflt=Default|Msng=Missing|FSpace=Free Space Present
Virtual Drives = 3 #【服务器有三个RAID,两个RAID5一个RAID1】
4、查看raid组详细信息
4.1 查看系统里面有几个raid组:
[root@localhost storcli]# ./storcli64 /c0/vall show #【查看c0控制下的所有RAID信息】
Controller = 0
Status = Success
Description = None
Virtual Drives :
DG/VD TYPE State Access Consist Cache Cac sCC Size Name
0/0 RAID1 Optl RW Yes RaWBD R OFF 278.875 GB
1/1 RAID5 Optl RW Yes RaWBD R OFF 4.089 TB
2/2 RAID5 Optl RW Yes RaWBD R OFF 4.089 TB #【显示系统有三个raid组】
4.2查看V0 (虚拟磁盘0) raid的详细信息
[root@localhost storcli]# ./storcli64 /c0/v0 show all
Controller = 0
Status = Success
Description = None
/c0/v0 :
DG/VD TYPE State Access Consist Cache Cac sCC Size Name
0/0 RAID1 Optl RW Yes RaWBD R OFF 278.875 GB #【V0为RAID1】