使用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
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)
Smartctl open device: /dev/sda failed: DELL or MegaRaid controller, please try adding '-d megaraid,N'
MegaCli是一款管理維護硬體RAID軟體,可以通過它來了解目前raid卡的所有資訊,包括 raid卡的型号,raid的陣列類型,raid 上各磁盤狀态,等等。通常,我們對硬碟目前的狀态不太好确定,一般通過機房人員巡檢來完成,有沒有通過軟體的方式來檢查确定這個問題呢。MegaCli就 可以做到,一般通過 MegaCli 的
<a href="http://ftp.cs.stanford.edu/pub/rpms/centos/5/x86_64/MegaCli-8.00.46-1.i386.rpm">http://ftp.cs.stanford.edu/pub/rpms/centos/5/x86_64/MegaCli-8.00.46-1.i386.rpm</a>
[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 ~]# rpm -ivh Lib_Utils-1.00-08.noarch.rpm
Preparing... ########################################### [100%]
Installing....
1:Lib_Utils ########################################### [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)
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相關資訊,裝置的溫度等】
參考位址:
<a href="http://www.lxway.com/441651466.htm">http://www.lxway.com/441651466.htm</a>
SSD硬碟壽命測試方法:
<a href="http://www.docin.com/p-2061116614.html">http://www.docin.com/p-2061116614.html</a>
MegaRAID工具使用詳解:
<a href="http://blog.51cto.com/dangzhiqiang/1569764">http://blog.51cto.com/dangzhiqiang/1569764</a>
本文轉自 wjw555 51CTO部落格,原文連結:http://blog.51cto.com/wujianwei/2052463