目前维护的dDell服务器,大多使用的都是LSI的MegaRAID卡。

查看系统使用的什么RAID卡,可以使用以下命令:# dmesg |grep -i raid

# cat /proc/scsi/scsi

# lspci

MegaRAID卡,可以通过官方提供的工具MegaCli来进行检查和控制。

下面是自动检查服务器RAID信息的SHELL脚本:#!/bin/sh

Hostname=`/bin/hostname`

Hostip=`ifconfig eth0|grep 'inet addr'|sed 's/.*addr:\(.*\) Bcast.*/\1/'`

Battery=`/opt/MegaCli -AdpBbuCmd -GetBbuStatus -aALL|grep "Charger Status"|awk -F: '{print $1":"$2}'`

raid=`/opt/MegaCli -cfgdsply -aALL|grep "RAID Level"|tail -1|awk -F: '{print $1"        :"$2}'`

Disknum=`/opt/MegaCli  -cfgdsply -aALL|grep  -c  "Non Coerced Size"`

Onlinedisk=`/opt/MegaCli -cfgdsply -aALL | grep “Online” | wc -l | sed 's/       //'`

Faileddisk=`/opt/MegaCli -AdpAllInfo -aALL | grep "Failed Disks"|awk -F' ' '{print $4}'`

echo "===================== Host Information ====================="

echo "HostName          : $Hostname"

echo  -e "HostIp            : $Hostip\n"

echo "===================== Raid  Information ====================="

#echo "$Raidmode"

case "$raid"

in

"RAID Level        : Primary-1, Secondary-0, RAID Level Qualifier-0") echo "Raid Level        :Raid 1";;

"RAID Level        : Primary-0, Secondary-0, RAID Level Qualifier-0") echo "Raid Level        :Raid 0";;

"RAID Level        : Primary-5, Secondary-0, RAID Level Qualifier-3") echo "Raid Level        :Raid 5";;

"RAID Level        : Primary-1, Secondary-3, RAID Level Qualifier-0") echo "Raid Level        :Raid 10";;

esac

if [ -z "$Battery" ];then

echo "Battery           :Null"

else

echo "$Battery"

fi

echo "Total  Diak Number:$Disknum"

echo "Online Disk Number:$Onlinedisk"

echo  "Failed Disk Number:$Faileddisk"

脚本运行结果:===================== Host Information =====================

HostName          : vps.cszhi.com

HostIp                 : 199.15.166.*

===================== Raid  Information =====================

Raid Level        :Raid 5

Charger Status: Complete

Charger Status: Complete

Total  Diak Number:9

Online Disk Number:0

Failed Disk Number:0

MegaCli常用参数组合介绍:MegaCli -cfgdsply -aALL | grep "Error"              【正常都是0】

MegaCli -LDGetProp -Cache -LALL -a0                 【写策略】

MegaCli -cfgdsply -aALL   | grep "Memory"      【内存大小】

MegaCli -LDInfo -Lall -aALL                     【查RAID级别】

MegaCli -AdpAllInfo -aALL                      【查RAID卡信息】

MegaCli -PDList -aALL                             【查看硬盘信息】

MegaCli -AdpBbuCmd -aAll                    【查看电池信息】

MegaCli -FwTermLog -Dsply -aALL         【查看RAID卡日志】

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

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

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

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

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

MegaCli -AdpBbuCmd -GetBbuStatus -aALL |grep "Charger Status" 【查看充电状态】

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

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

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

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

MegaCli -cfgdsply -aALL                                                     【显示RAID卡型号,RAID设置,DISK相关信息】

磁带状态的变化,从拔盘,到插盘的过程中:Device |Normal|Damage|Rebuild|Normal

Virtual Drive |Optimal|Degraded|Degraded|Optimal

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

磁盘各个状态说明:A physical disk drive property indicating the status of the drive. A physical disk drive can be in one of

the following states:

>Unconfigured Good

A disk accessible to the RAID controller but not configured as a part of a virtual disk or as a hotspare.

>Online

A physical disk can be accessed by the RAID controller and is part of the virtual disk.

>rebuild

A physical disk to which data is being written to restore full redundancy for a virtual disk.

>failed

A physical disk that was originally configured as Online but on which the firmware detects an unrecoverable error.

>Unconfigured bad

A physical disk on which the firmware detects an unrecoverable error; the physical disk was Unconfigured Good or the physical disk could not be initialized.

Disks with a status of "Unconfigured bad" cannot be used for RAID configurations.

>Missing

A physical disk that was Online, but which has been removed from its location.

>offline

The drive is offline or absent. No actions can be performed on the drive until it is back online.

>Global hotspare

The drive will be used to repair any array in the system that had a drive failure, if the failed drive is equal to, or smaller than the hot spare drive.

>Ready

The drive is online and operating correctly.

>Foreign

The drive is part of an array created on a different controller, or created within one enclosure and moved to another on the same controller. It can be used to create a new array after clearing configuration.

>None

A physical disk with the unsupported flag set. An Unconfigured Good or Offline physical disk that has completed the prepare for removal operation.

>copyback

A bad physical disk replaced by a good one, then hotspare will copyback data to the good one and change back to hotspare

命令使用:#/opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -Lall -aALL 查raid级别#/opt/MegaRAID/MegaCli/MegaCli64 -AdpAllInfo -aALL 查raid卡信息#/opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL 查看硬盘信息#/opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -aAll 查看电池信息#/opt/MegaRAID/MegaCli/MegaCli64 -FwTermLog -Dsply -aALL 查看raid卡日志#/opt/MegaRAID/MegaCli/MegaCli64 -adpCount 【显示适配器个数】#/opt/MegaRAID/MegaCli/MegaCli64 -AdpGetTime –aALL 【显示适配器时间】#/opt/MegaRAID/MegaCli/MegaCli64 -AdpAllInfo -aAll 【显示所有适配器信息】#/opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -LALL -aAll 【显示所有逻辑磁盘组信息】#/opt/MegaRAID/MegaCli/MegaCli64 -PDList -aAll 【显示所有的物理信息】#/opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -GetBbuStatus -aALL |grep ‘Charger Status’ 【查看充电状态】#/opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -GetBbuStatus -aALL【显示BBU状态信息】#/opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -GetBbuCapacityInfo -aALL【显示BBU容量信息】#/opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -GetBbuDesignInfo -aALL 【显示BBU设计参数】#/opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -GetBbuProperties -aALL 【显示当前BBU属性】#/opt/MegaRAID/MegaCli/MegaCli64 -cfgdsply -aALL 【显示Raid卡型号,Raid设置,Disk相关信息】

3.磁带状态的变化,从拔盘,到插盘的过程中。Device |Normal|Damage|Rebuild|NormalVirtual Drive |Optimal|Degraded|Degraded|OptimalPhysical Drive |Online|Failed –> Unconfigured|Rebuild|Online

4.查看磁盘缓存策略#/opt/MegaRAID/MegaCli/MegaCli64 -LDGetProp -Cache -L0 -a0or#/opt/MegaRAID/MegaCli/MegaCli64 -LDGetProp -Cache -L1 -a0or#/opt/MegaRAID/MegaCli/MegaCli64 -LDGetProp -Cache -LALL -a0ro#/opt/MegaRAID/MegaCli/MegaCli64 -LDGetProp -Cache -LALL -aALLro#/opt/MegaRAID/MegaCli/MegaCli64 -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/MegaRAID/MegaCli/MegaCli64 -LDSetProp WT|WB|NORA|RA|ADRA -L0 -a0or#/opt/MegaRAID/MegaCli/MegaCli64 -LDSetProp -Cached|-Direct -L0 -a0orenable / disable disk cache#/opt/MegaRAID/MegaCli/MegaCli64 -LDSetProp -EnDskCache|-DisDskCache -L0 -a0

6.创建一个 raid5 阵列,由物理盘 2,3,4 构成,该阵列的热备盘是物理盘 5#/opt/MegaRAID/MegaCli/MegaCli64 -CfgLdAdd -r5 [1:2,1:3,1:4] WB Direct -Hsp[1:5] -a0

7.创建阵列,不指定热备#/opt/MegaRAID/MegaCli/MegaCli64 -CfgLdAdd -r5 [1:2,1:3,1:4] WB Direct -a0

8.删除阵列#/opt/MegaRAID/MegaCli/MegaCli64 -CfgLdDel -L1 -a0

9.在线添加磁盘#/opt/MegaRAID/MegaCli/MegaCli64 -LDRecon -Start -r5 -Add -PhysDrv[1:4] -L1 -a0

10.阵列创建完后,会有一个初始化同步块的过程,可以看看其进度。#/opt/MegaRAID/MegaCli/MegaCli64 -LDInit -ShowProg -LALL -aALL或者以动态可视化文字界面显示#/opt/MegaRAID/MegaCli/MegaCli64 -LDInit -ProgDsply -LALL -aALL

11.查看阵列后台初始化进度#/opt/MegaRAID/MegaCli/MegaCli64 -LDBI -ShowProg -LALL -aALL或者以动态可视化文字界面显示#/opt/MegaRAID/MegaCli/MegaCli64 -LDBI -ProgDsply -LALL -aALL

12.指定第 5 块盘作为全局热备#/opt/MegaRAID/MegaCli/MegaCli64 -PDHSP -Set [-EnclAffinity] [-nonRevertible] -PhysDrv[1:5] -a0

13.指定为某个阵列的专用热备#/opt/MegaRAID/MegaCli/MegaCli64 -PDHSP -Set [-Dedicated [-Array1]] [-EnclAffinity] [-nonRevertible] -PhysDrv[1:5] -a0

14.删除全局热备#/opt/MegaRAID/MegaCli/MegaCli64 -PDHSP -Rmv -PhysDrv[1:5] -a0

15.将某块物理盘下线/上线#/opt/MegaRAID/MegaCli/MegaCli64 -PDOffline -PhysDrv [1:4] -a0#/opt/MegaRAID/MegaCli/MegaCli64 -PDOnline -PhysDrv [1:4] -a0

16.查看物理磁盘重建进度#/opt/MegaRAID/MegaCli/MegaCli64 -PDRbld -ShowProg -PhysDrv [1:5] -a0或者以动态可视化文字界面显示#/opt/MegaRAID/MegaCli/MegaCli64 -PDRbld -ProgDsply -PhysDrv [1:5] -a0

磁带状态的变化,从拔盘,到插盘的过程中:Device |Normal|Damage|Rebuild|NormalVirtual Drive |Optimal|Degraded|Degraded|OptimalPhysical Drive |Online|Failed –> Unconfigured|Rebuild|Online

linux查看硬盘阵列卡信息命令,查看服务器RAID卡信息的SHELL脚本及MegaCLI命令介绍...相关推荐

  1. hp服务器增加raid卡,惠普ProLiant服务器Raid卡配置过程详解

    [IT168 技术]Raid(Redundant Array of Independent Disk)独立冗余磁盘阵列,就是将多个硬盘通过Raid控制器整合成虚拟的单个大容量的硬盘.Raid是服务器数 ...

  2. 联想sr950配置raid卡_联想ThinkServerrd服务器raid卡设置教程LSIiraid卡设置教程

    联 想 T h i n k S e r v e r r d 6 4 0 服 务 器 r a i d 卡 设 置 教 程 LSI9260-8i raid 卡设置教程 服务器启动到此界面: 服务器启动到此 ...

  3. 中兴服务器raid配置_-服务器Raid卡更换后如何恢复硬盘Raid组信息

    问题描述 服务器Raid卡更换后如何恢复硬盘Raid组信息? 解决方案 服务器Raid卡更换后,会自动检测到硬盘头部的Raid组信息,需要手动激活Raid组信息. LSI 1068 系列操作方式如下: ...

  4. sr550服务器配置硬盘,华为服务器 RAID卡配置 SR450C-M (Avago3508)

    Avago SAS3508不支持Legacy配置,支持UEFI配置:支持Legacy和UEFI启动. BIOS中"Boot Type"设置为"EFI Boot Type& ...

  5. 华为3108raid安linux,华为服务器 RAID卡配置 SR430 LSISAS3108(EFI/UEFI模式)

    SR430C-M/ SR430C 卡 LSISAS3108 芯片 EFI/UEFI 模式 配置指南 初始配置(EFI/UEFI模式) BIOS中"Boot Type"设置为&quo ...

  6. Linux shell 脚本结构化命令 if-then

    shell 脚本结构化命令 1. if-then 语句基本使用 if-then 语句的基本格式: if command thencommands elifcommands elsecommands f ...

  7. Linux shell脚本中的命令正确写法

    shell脚本中的命令需加反引号``

  8. Dell服务器RAID卡介绍及监控

    Dell服务器RAID卡介绍及监控 本文包含如下内容 一.Dell服务器 RAID卡介绍 二.阵列卡的Stripe size介绍 三.megacli介绍.安装.使用.crontab监控脚本 四.查看S ...

  9. 服务器只显示raid卡,服务器RAID卡介绍及监控

    一.服务器 RAID卡介绍 1.内部 使用megacli命令查看得到的 SAS 6/iR :只支持2块硬盘做 raid0,或者raid1,或者不做阵列卡  (Dell硬件聊天室获得) PERC 6/i ...

最新文章

  1. EasyUI学习总结(五)——EasyUI组件使用
  2. C语言/C++中怎么表示8进制数或者16进制数?(8进制数用数字0开头,16进制数用0x或者0X开头)
  3. 补补算术基础:编程中的进制问题
  4. 小明分享|WiFi协议迭代历程
  5. wpf mysql存储过程_MySQL存储过程的创建及调用
  6. jar k8s 自己的 部署_微服务架构 - 离线部署k8s平台并部署测试实例
  7. 蓝桥杯java龟兔赛跑_蓝桥杯 1476: [蓝桥杯][基础练习VIP]龟兔赛跑预测
  8. idea java web mysql_JavaWeb 开发环境配置 — 基于IDEA 2019.2
  9. Thingsboard 3.1.0 - UI修改
  10. mysql简易购物车系统_jsp+mysql实例简单的购物车
  11. 学生成绩管理系统(Java)
  12. 自动旁注并多进程调用wwwscan扫描旁注结果的python脚本。
  13. 安装的时候出现SPSS中can not create java virtual machine问题怎么办
  14. 枢纽披红彩车上路 申城公交传递城市年味
  15. java中的保护(protected)修饰符的理解
  16. python更新的命令_python升级命令
  17. Ubuntu常用磁盘工具Disks、GParted和系统清理应用Cleaner
  18. 网易云发布“工业智能平台”,开放技术赋能工业企业
  19. Flutter-解决Try catch出现异常:type ‘_TypeError‘ is not a subtype of type ‘Exception‘ in type cast
  20. 三菱PLC梯形图入门操作指令

热门文章

  1. Javascript实现元素选择器功能
  2. 大数据如何解决行业挑战?大数据在10个垂直行业中的应用
  3. MAX7221数码管驱动的多种探索
  4. 前端批量下载文件、图片、打包成压缩包,JZip和file-saver
  5. 计算机无法安装cad怎么办,win7系统不能安装cad怎么办 win7电脑安装cad失败的解决方法...
  6. fabric网络搭建问题汇集
  7. 计算机电源没有工作怎么解决,电脑开机电源不工作
  8. 4-6 Aruba Central 升级维护配置
  9. 一、Fmcw毫米波雷达原理
  10. DAO 的去中心化程度判定:钟形曲线