linux查看raid情况工具,使用MegaCli工具查看Raid磁盘阵列状态

转载自:http://home.51.com/chenjianghui1987/diary/item/10051836.html

文章本身我不做过多修改了,在这里我就把自己在安装时候碰到的难点跟大家提下。

1.何处下载?

首先,根据文章中的路径已经下载不到相应的文件了,在此我们就自己到http://www.lsi.com的网站上去搜,尝试了各种组合

最后终于用linux_cli.zip在搜索栏中搜索出相应结果,找到linux版本,下载即可。

为了安全起见我还将文件上传至下载空间,以备不时之需。

http://down.51cto.com/data/342011

2.如何使用?

安装完后的文件依然存放在/opt目录下,但是内部多了几层目录。

/opt/MegaRAID/MegaCli/MegaCli64 后跟着相应的参数即可。

megacli功能还是非常强大的。在想获得更多raid信息及硬盘细节问题等细节上,得到了更多底层的数据

Linux操作系统下使用MegaCli工具查看Raid磁盘阵列状态

新版本的MegaCli-1.01.24-0.i386.rpm会把程序安装在/opt下,可以自定义安装目录,例如:rpm –relocate

/opt/=/usr/sbin/ -i MegaCli-1.01.24-0.i386.rpm 即把安装目录 /opt 替换成

/usr/sbin。下载地址:http://www.lsi.com/support/downloads/megaraid/miscellaneous/linux/Linux_MegaCLI_1.01.24.zip 我这里介绍安装在/opt下。

1. 首先介绍下Linux系统本身查看

软件raid:查看raid级别,状态等信息

#cat /proc/mdstat

硬件raid:查看raid的厂商,型号,级别

#dmesg | grep -i raid

#cat /proc/scsi/scsi

2.硬件raid最佳的办法是通过已安装的raid厂商的管理工具来查看,下面安装MegaCLI工具查看

首先下载MegaCli,解压缩。#rpm -ivh MegaCli-1.01.24-0.i386.rpm  安装在/opt下,所以执行命令都是/opt/MegaCli 哦。

命令使用:

#/opt/MegaCli  -LDInfo -Lall -aALL 查raid级别

#/opt/MegaCli -AdpAllInfo -aALL 查raid卡信息

#/opt/MegaCli -PDList -aALL 查看硬盘信息

#/opt/MegaCli -AdpBbuCmd -aAll 查看电池信息

#/opt/MegaCli -FwTermLog -Dsply -aALL 查看raid卡日志

#/opt/MegaCli -adpCount 【显示适配器个数】

#/opt/MegaCli -AdpGetTime –aALL 【显示适配器时间】

#/opt/MegaCli -AdpAllInfo -aAll    【显示所有适配器信息】

#/opt/MegaCli -LDInfo -LALL -aAll    【显示所有逻辑磁盘组信息】

#/opt/MegaCli -PDList -aAll    【显示所有的物理信息】

#/opt/MegaCli -AdpBbuCmd -GetBbuStatus -aALL |grep ‘Charger Status’ 【查看充电状态】

#/opt/MegaCli -AdpBbuCmd -GetBbuStatus -aALL【显示BBU状态信息】

#/opt/MegaCli -AdpBbuCmd -GetBbuCapacityInfo -aALL【显示BBU容量信息】

#/opt/MegaCli -AdpBbuCmd -GetBbuDesignInfo -aALL    【显示BBU设计参数】

#/opt/MegaCli -AdpBbuCmd -GetBbuProperties -aALL    【显示当前BBU属性】

#/opt/MegaCli -cfgdsply -aALL    【显示Raid卡型号,Raid设置,Disk相关信息】

3.磁带状态的变化,从拔盘,到插盘的过程中。

Device        |Normal|Damage|Rebuild|Normal

Virtual Drive    |Optimal|Degraded|Degraded|Optimal

Physical Drive    |Online|Failed –> Unconfigured|Rebuild|Online

4.查看磁盘缓存策略

#/opt/MegaCli -LDGetProp -Cache -L0 -a0

or

#/opt/MegaCli -LDGetProp -Cache -L1 -a0

or

#/opt/MegaCli -LDGetProp -Cache -LALL -a0

ro

#/opt/MegaCli -LDGetProp -Cache -LALL -aALL

ro

#/opt/MegaCli -LDGetProp -DskCache -LALL -aALL

5.设置磁盘缓存策略

缓存策略解释:

WT    (Write through

WB    (Write back)

NORA  (No read ahead)

RA    (Read ahead)

ADRA  (Adaptive read ahead)

Cached

Direct

例子:

#/opt/MegaCli -LDSetProp WT|WB|NORA|RA|ADRA -L0 -a0

or

#/opt/MegaCli -LDSetProp -Cached|-Direct -L0 -a0

or

enable / disable disk cache

#/opt/MegaCli -LDSetProp -EnDskCache|-DisDskCache -L0 -a0

6.创建一个 raid5 阵列,由物理盘 2,3,4 构成,该阵列的热备盘是物理盘 5

#/opt/MegaCli -CfgLdAdd -r5 [1:2,1:3,1:4] WB Direct -Hsp[1:5] -a0

7.创建阵列,不指定热备

#/opt/MegaCli -CfgLdAdd -r5 [1:2,1:3,1:4] WB Direct -a0

8.删除阵列

#/opt/MegaCli -CfgLdDel -L1 -a0

9.在线添加磁盘

#/opt/MegaCli -LDRecon -Start -r5 -Add -PhysDrv[1:4] -L1 -a0

10.阵列创建完后,会有一个初始化同步块的过程,可以看看其进度。

#/opt/MegaCli -LDInit -ShowProg -LALL -aALL

或者以动态可视化文字界面显示

#/opt/MegaCli -LDInit -ProgDsply -LALL -aALL

11.查看阵列后台初始化进度

#/opt/MegaCli -LDBI -ShowProg -LALL -aALL

或者以动态可视化文字界面显示

#/opt/MegaCli -LDBI -ProgDsply -LALL -aALL

12.指定第 5 块盘作为全局热备

#/opt/MegaCli -PDHSP -Set [-EnclAffinity] [-nonRevertible] -PhysDrv[1:5] -a0

13.指定为某个阵列的专用热备

#/opt/MegaCli -PDHSP -Set [-Dedicated [-Array1]] [-EnclAffinity] [-nonRevertible] -PhysDrv[1:5] -a0

14.删除全局热备

#/opt/MegaCli -PDHSP -Rmv -PhysDrv[1:5] -a0

15.将某块物理盘下线/上线

#/opt/MegaCli -PDOffline -PhysDrv [1:4] -a0

#/opt/MegaCli -PDOnline -PhysDrv [1:4] -a0

16.查看物理磁盘重建进度

#/opt/MegaCli -PDRbld -ShowProg -PhysDrv [1:5] -a0

或者以动态可视化文字界面显示

#/opt/MegaCli -PDRbld -ProgDsply -PhysDrv [1:5] -a0

#-----------------------------------

/opt/MegaRAID/MegaCli/MegaCli64 -PDRbld -ShowProg -physdrv[32:2] -aALL

下面转自:

http://blog.sina.com.cn/s/blog_57c70e190101ebl9.html

今天给服务器DELL

R710加硬盘,准备在线做raid,以前不太注意这些事,搞起来花了一些时间,不过还好是搞定了,赶紧记录下来,免的日后忘记了。

用MegaCli做阵列,最重要是就是这三个系数:

Adapter #0

Enclosure Device ID: 32

Slot Number: 0

分别代表了 -PhysDrv[E0:S0,E1:S1,...] -aN

#物理磁盘的

enclosure号:slot号  -a是阵列卡号

这些参数可以通过下面的命令得到。

查看阵列卡信息

lspci -v

/opt/MegaRAID/MegaCli/MegaCli64 -AdpAllInfo -aALL

查看所有物理硬盘状态

/opt/MegaRAID/MegaCli/MegaCli64 -PDList -a0

# /opt/MegaRAID/MegaCli/MegaCli64 help |grep -i pdinfo

MegaCli -pdInfo -PhysDrv[E0:S0,E1:S1,...] -aN|-a0,1,2|-aALL

MegaCli -LdPdInfo -aN|-a0,1,2|-aALL

查看逻辑盘详细信息

# /opt/MegaRAID/MegaCli/MegaCli64 -LdPdInfo

-aALL

查看单个盘的详细信息

# /opt/MegaRAID/MegaCli/MegaCli64 -pdInfo -PhysDrv[32:3] -aALL

Adapter 0: Device at Enclosure - 32, Slot - 3 is not

found.

像我新增加的硬盘就是 [32:2]

cfe39b63d04d2a21beedeb13268d9d32.png

aeaf6d40f70eae238e3b2ba6a5842eab.png

fc8c1817489f0d1d03d935f09c168c96.png

这里我的硬盘被标记为“Foreign”外来配置,要清除一下,不然会报下面这个错误:

The specified physical disk does not have the appropriate

attributes to complete

the requested command.

Exit Code: 0x26

扫描外来配置的个数:

# /opt/MegaRAID/MegaCli/MegaCli64 -cfgforeign -scan -a0

There are 1 foreign configuration(s) on controller 0.

Exit Code: 0x00

清除外来配置:

# /opt/MegaRAID/MegaCli/MegaCli64 -cfgforeign -clear -a0

Foreign configuration 0 is cleared on controller 0.

Exit Code: 0x00

再次扫描外来配置的个数:

# /opt/MegaRAID/MegaCli/MegaCli64 -cfgforeign -scan

-a0

There is no foreign configuration on controller 0.

Exit Code: 0x00

创建Raid0

# /opt/MegaRAID/MegaCli/MegaCli64 -CfgLdAdd -r0[32:2] WB

Direct -a0

Adapter 0: Created VD 2

Adapter 0: Configured the Adapter!!

Exit Code: 0x00

eef4bc748077755c05387431d3ad8ceb.png

9eddcc5981ebe73f0a8b9140b934e0ef.png

2efe9a9fea110783a0b0b60ca3c03eee.png

删除阵列:

# /opt/MegaRAID/MegaCli/MegaCli6  -cfgclr

-a0    清除所有的raid组的配置

# /opt/MegaRAID/MegaCli/MegaCli6  -cfglddel

-L0 -a0  删除指定的raid组(Target Id:

0)的raid组,可以通过上面的“查看逻辑盘详细信息”得到。

查看硬盘的重建情况:

# /opt/MegaRAID/MegaCli/MegaCli64 -PDRbld -ProgDsply -PhysDrv

[12:7] -aALL

Device(Encl-12 Slot-7) is not in rebuild process

  • 0
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
智慧校园整体解决方案是响应国家教育信息化政策,结合教育改革和技术创新的产物。该方案以物联网、大数据、人工智能和移动互联技术为基础,旨在打造一个安全、高效、互动且环保的教育环境。方案强调从数字化校园向智慧校园的转变,通过自动数据采集、智能分析和按需服务,实现校园业务的智能化管理。 方案的总体设计原则包括应用至上、分层设计和互联互通,确保系统能够满足不同用户角色的需求,并实现数据和资源的整合与共享。框架设计涵盖了校园安全、管理、教学、环境等多个方面,构建了一个全面的校园应用生态系统。这包括智慧安全系统、校园身份识别、智能排课及选课系统、智慧学习系统、精品录播教室方案等,以支持个性化学习和教学评估。 建设内容突出了智慧安全和智慧管理的重要性。智慧安全管理通过分布式录播系统和紧急预案一键启动功能,增强校园安全预警和事件响应能力。智慧管理系统则利用物联网技术,实现人员和设备的智能管理,提高校园运营效率。 智慧教学部分,方案提供了智慧学习系统和精品录播教室方案,支持专业级学习硬件和智能化网络管理,促进个性化学习和教学资源的高效利用。同时,教学质量评估中心和资源应用平台的建设,旨在提升教学评估的科学性和教育资源的共享性。 智慧环境建设则侧重于基于物联网的设备管理,通过智慧教室管理系统实现教室环境的智能控制和能效管理,打造绿色、节能的校园环境。电子班牌和校园信息发布系统的建设,将作为智慧校园的核心和入口,提供教务、一卡通、图书馆等系统的集成信息。 总体而言,智慧校园整体解决方案通过集成先进技术,不仅提升了校园的信息化水平,而且优化了教学和管理流程,为学生、教师和家长提供了更加便捷、个性化的教育体验。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值