使用MegaCli和Smartctl获取普通磁盘信息
[root@localhost ~]# cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 02 Id: 00 Lun: 00
Vendor: DELL Model: PERC H330 Mini Rev: 4.27
Type: Direct-Access ANSI SCSI revision: 05
Host: scsi0 Channel: 02 Id: 01 Lun: 00
Vendor: DELL Model: PERC H330 Mini Rev: 4.27
Type: Direct-Access ANSI SCSI revision: 05
Host: scsi10 Channel: 00 Id: 00 Lun: 00
Vendor: HL-DT-ST Model: DVD+-RW GU90N Rev: A3C0
Type: CD-ROM ANSI SCSI revision: 05
运行出错:
[root@localhost ~]# smartctl -i /dev/sda
smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-642.el6.x86_64] (local build)
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net
Smartctl open device: /dev/sda failed: DELL or MegaRaid controller, please try adding '-d megaraid,N'
MegaCli是一款管理维护硬件RAID软件,可以通过它来了解当前raid卡的所有信息,包括 raid卡的型号,raid的阵列类型,raid 上各磁盘状态,等等。通常,我们对硬盘当前的状态不太好确定,一般通过机房人员巡检来完成,有没有通过软件的方式来检查确定这个问题呢。MegaCli就 可以做到,一般通过 MegaCli 的
下载:http://ftp.cs.stanford.edu/pub/rpms/centos/5/x86_64/
http://ftp.cs.stanford.edu/pub/rpms/centos/5/x86_64/MegaCli-8.00.46-1.i386.rpm
wget http://ftp.cs.stanford.edu/pub/rpms/centos/5/x86_64/MegaCli-8.00.46-1.i386.rpm
[root@localhost ~]# rpm -ivh MegaCli-8.00.46-1.i386.rpm
error: Failed dependencies:
Lib_Utils is needed by MegaCli-8.00.46-1.i386
解决:
[root@localhost ~]# wget http://ftp.cs.stanford.edu/pub/rpms/centos/5/x86_64/Lib_Utils-1.00-08.noarch.rpm
[root@localhost ~]# rpm -ivh Lib_Utils-1.00-08.noarch.rpm
Preparing... ########################################### [100%]
Installing....
1:Lib_Utils ########################################### [100%]
[root@localhost ~]# rpm -ivh MegaCli-8.00.46-1.i386.rpm
Preparing... ########################################### [100%]
1:MegaCli ########################################### [100%]
[root@localhost ~]# ls -al /opt/MegaRAID/MegaCli/MegaCli64
-rwxr-xr-x. 1 root root 2247688 Feb 3 2011 /opt/MegaRAID/MegaCli/MegaCli64
查看RAID级别:
[root@localhost ~]# /opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -Lall -aALL
Adapter 0 -- Virtual Drive Information:
Virtual Drive: 0 (Target Id: 0)
Name :
RAID Level : Primary-0, Secondary-0, RAID Level Qualifier-0
Size : 223.0 GB
State : Optimal
Strip Size : 64 KB
Number Of Drives : 1
Span Depth : 1
Default Cache Policy: WriteThrough, ReadAheadNone, Direct, No Write Cache if Bad BBU
Current Cache Policy: WriteThrough, ReadAheadNone, Direct, No Write Cache if Bad BBU
Access Policy : Read/Write
Disk Cache Policy : Disk's Default
Encryption Type : None
Default Power Savings Policy: Controller Defined
Current Power Savings Policy: None
Can spin up in 1 minute: No
LD has drives that support T10 power conditions: No
LD's IO profile supports MAX power savings with cached writes: No
Bad Blocks Exist: No
Virtual Drive: 1 (Target Id: 1)
Name :
RAID Level : Primary-0, Secondary-0, RAID Level Qualifier-0
Size : 223.0 GB
State : Optimal
Strip Size : 64 KB
Number Of Drives : 1
Span Depth : 1
Default Cache Policy: WriteThrough, ReadAheadNone, Direct, No Write Cache if Bad BBU
Current Cache Policy: WriteThrough, ReadAheadNone, Direct, No Write Cache if Bad BBU
Access Policy : Read/Write
Disk Cache Policy : Disk's Default
Encryption Type : None
Default Power Savings Policy: Controller Defined
Current Power Savings Policy: None
Can spin up in 1 minute: No
LD has drives that support T10 power conditions: No
LD's IO profile supports MAX power savings with cached writes: No
Bad Blocks Exist: No
Exit Code: 0x00
命令使用:
#/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相关信息,设备的温度等】
参考地址:
http://www.lxway.com/441651466.htm
SSD硬盘寿命测试方法:
http://www.docin.com/p-2061116614.html
MegaRAID工具使用详解:
https://blog.51cto.com/dangzhiqiang/1569764
来源:51CTO
作者:wjw555
链接:https://blog.51cto.com/wujianwei/2052463