使用MegaCli監控Linux硬盤

1.首先查看機器是否使用的是MegaRAID卡ubuntu

dmesg | grep RAID
[    6.932741] scsi host0: Avago SAS based MegaRAID driver

2.添加 megaraid 源:bash

修改 /etc/apt/sources.list 在末尾添加工具

deb http://hwraid.le-vert.net/ubuntu precise main

而後執行:ui

apt-get update
apt-get install megacli megactl megaraid-status

若是執行提示 GPG 錯誤,須要執行以下命令添加證書:spa

wget -O - http://hwraid.le-vert.net/debian/hwraid.le-vert.net.gpg.key | sudo apt-key add -

而後再次執行:.net

apt-get install megacli megactl megaraid-status

3.使用megacli命令進行一些簡單的查詢orm

<i>顯示全部RAID級別、設置及邏輯盤信息blog

sudo megacli -LDInfo -Lall -aALL 

輸出ip

                                     
Adapter 0 -- Virtual Drive Information:
Virtual Drive: 0 (Target Id: 0)
Name                :
RAID Level          : Primary-1, Secondary-0, RAID Level Qualifier-0
Size                : 1.090 TB
Sector Size         : 512
Is VD emulated      : No
Mirror Data         : 1.090 TB
State               : Optimal
Strip Size          : 64 KB
Number Of Drives    : 2
Span Depth          : 1
Default Cache Policy: WriteBack, ReadAhead, Direct, No Write Cache if Bad BBU
Current Cache Policy: WriteBack, ReadAhead, Direct, No Write Cache if Bad BBU
Default Access Policy: Read/Write
Current 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: Yes
LD has drives that support T10 power conditions: Yes
LD's IO profile supports MAX power savings with cached writes: No
Bad Blocks Exist: No
Is VD Cached: No



Exit Code: 0x00

<ii>顯示全部的物理信息ci

sudo megacli -PDList -aAll

過濾輸出

sudo megacli -PDList -aAll  | grep "Firmware state\|Slot Number\|Error"

 參考輸出

Enclosure Device ID: 32
Slot Number: 11
Enclosure position: 1
Device Id: 11
WWN: 50000397eb88257a
Sequence Number: 2
Media Error Count: 0
Other Error Count: 4
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SATA

Raw Size: 7.277 TB [0x3a3812ab0 Sectors]
Non Coerced Size: 7.276 TB [0x3a3712ab0 Sectors]
Coerced Size: 7.276 TB [0x3a3700000 Sectors]
Sector Size:  512
Logical Sector Size:  512
Physical Sector Size:  4096
Firmware state: JBOD
Device Firmware Level: GX4D
Shield Counter: 0
Successful diagnostics completion on :  N/A
SAS Address(0): 0x500056b3295a37cb
Connected Port Number: 0(path0) 
Inquiry Data:         77N4K3BIFYRDTOSHIBA MG05ACA800E                         GX4D
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None 
Device Speed: 6.0Gb/s 
Link Speed: 6.0Gb/s 
Media Type: Hard Disk Device
Drive Temperature :28C (82.40 F)
PI Eligibility:  No 
Drive is formatted for PI information:  No
PI: No PI
Drive's NCQ setting : N/A
Port-0 :
Port status: Active
Port's Linkspeed: 6.0Gb/s 
Drive has flagged a S.M.A.R.T alert : No



Enclosure Device ID: 32
Slot Number: 12
Drive's position: DiskGroup: 0, Span: 0, Arm: 0
Enclosure position: 1
Device Id: 12
WWN: 5000CCA02D78FCDB
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS

Raw Size: 1.090 TB [0x8bba0cb0 Sectors]
Non Coerced Size: 1.090 TB [0x8baa0cb0 Sectors]
Coerced Size: 1.090 TB [0x8ba80000 Sectors]
Sector Size:  512
Logical Sector Size:  512
Physical Sector Size:  512
Firmware state: Online, Spun Up
Device Firmware Level: FU29
Shield Counter: 0
Successful diagnostics completion on :  N/A
SAS Address(0): 0x5000cca02d78fcd9
SAS Address(1): 0x0
Connected Port Number: 0(path0) 
Inquiry Data: HGST    HUC101812CSS200 FU2906J4JPYZ            
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None 
Device Speed: 12.0Gb/s 
Link Speed: 12.0Gb/s 
Media Type: Hard Disk Device
Drive Temperature :55C (131.00 F)
PI Eligibility:  No 
Drive is formatted for PI information:  Yes 
PI: PI with type 2
Port-0 :
Port status: Active
Port's Linkspeed: 12.0Gb/s 
Port-1 :
Port status: Active
Port's Linkspeed: 12.0Gb/s 
Drive has flagged a S.M.A.R.T alert : No

 

參考:Linux系統下安裝MegaCli64工具查看和管理raid卡

MegaCli 監控raid狀態 

相關文章
相關標籤/搜索