欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  网络运营

linux系统下一个冷门的RAID卡ioc0及其监控mpt-status

程序员文章站 2022-11-18 18:14:12
新接手了一台linux服务器,准备检查是否有配置raid。   先查看是否有raid卡: 复制代码 代码如下: # dmesg|grep -i raid...

新接手了一台linux服务器,准备检查是否有配置raid。
 
先查看是否有raid卡:

复制代码 代码如下:

# dmesg|grep -i raid
mptsas: ioc0: attaching raid volume, channel 1, id 0
device-mapper: dm-raid45: initialized v0.2594l
md: autodetecting raid arrays.

很明显是有的,只是无法确定raid卡的类型是ioc0还是dm-raid45,于是开始百度。后来找到了这样一个工具:mpt-status,而且在下载界面里,有这样几句话:
 
mpt-status: get status of lsi 1030 raid (mptlinux, fusion, mpt, ioc) controller
 
this driver has many names. as best i understand their use:
lsi 1030
    the make and model of the controller
mptlinux
    the name of the driver distribution. /proc/mpt/version might say, for example, mptlinux-2.05.11.03.
fusion
    the trade name for the chipset (?). the driver distribution, though called mptlinux, actually lives in drivers/message/fusion.
mpt
    message passing technology; the prefix used for all things that related to the driver. the /proc device is /proc/mptctl, for example.
ioc
    the name of the controller within linux. for example the first controller is ioc0.
 
大意是说lsi 1030 raid卡有很多个名字,ioc是其中之一。这刚好与之前dmesg的结果吻合。因此基本上可以确定raid卡的类型是ioc0,属于lsi的产品,可以用mpt-status来对其进行监控。

mpt-status下载地址:
 
接着下载安装:rpm -ihv mpt-status-1.2.0_rc7-3.i386.rpm
 
建立字符设备:mknod /dev/mptctl c 10 220
加载内核模块mptctl:modprobe mptctl
 
查看raid状态:

复制代码 代码如下:

# mpt-status       
ioc0 vol_id 0 type im, 2 phy, 465 gb, state optimal, flags enabled
ioc0 phy 1 scsi_id 8 ata      wdc wd5002abys-1 3b04, 465 gb, state online, flags none
ioc0 phy 0 scsi_id 1 ata      wdc wd5002abys-1 3b04, 465 gb, state online, flags none

可以看出,该raid由两块465g的物理硬盘组成,状态良好。可问题是,raid级别是多少(0,1,5...)呢?
 
于是接着百度。
 
但这次没有结果。
 
后来在mpt-status的文档(/usr/share/doc/mpt-status-1.2.0_rc7/faq )里看到这样一句话:
 
> 1) could you tell me from example #1, #2 and #3 where can you see the raid level of each hard disk ?
 
好激动,这不就是我要问的问题吗?再看看答案:
 
the raid level is not visible, would you like to get this information as well? or do you want to extract the health state of each disk?
 
尼玛,回答跟没回答一样...
 
接着往下看。终于,在文档的最后,给出来了答案:
 
> is=?
integrated striping (raid 0)
> im=?
integrated mirroring (raid 1)
 
即mpt-status输出的type表示raid级别。如上例中的:
 
ioc0 vol_id 0 type im, 2 phy, 465 gb, state optimal, flags enabled
 
表示raid1。
 
最后附上mpt-status的rpm包。
 
mpt-status 下载地址: