dmdecodeとmegacliコマンドの使い方の参考

19517 ワード

試験機器10.199.12.28.69

dmdecode共通コマンド


マシンモデル
[root@test_raid ~]# dmidecode | grep "Product"
        Product Name: PowerEdge R720xd
        Product Name: 068CDY

メーカー
[root@test_raid ~]# dmidecode| grep  "Manufacturer"
        Manufacturer: Dell Inc.

シーケンス情報
[root@test_raid ~]# dmidecode | grep -B 4 "Serial Number"  | more
System Information
        Manufacturer: Dell Inc.
        Product Name: PowerEdge R720xd
        Version: Not Specified
        Serial Number: 8V3Q342
--
Base Board Information
        Manufacturer: Dell Inc.
        Product Name: 068CDY
        Version: A01
        Serial Number: ..CN779214AR02CC.

CPU情報
[root@test_raid ~]# dmidecode | grep  "CPU"
        Socket Designation: CPU1
        Version:       Intel(R) Xeon(R) CPU E5-2695 v2 @ 2.40GHz
        Socket Designation: CPU2
        Version:       Intel(R) Xeon(R) CPU E5-2695 v2 @ 2.40GHz

物理CPU個数
[root@test_raid ~]# dmidecode | grep  "Socket Designation: CPU" |wc -l
2

製造日
[root@test_raid ~]# dmidecode | grep "Date"
        Release Date: 07/09/2014

megacli共通コマンド


電源管理


じゅうでんじょうたい
[root@test_raid ~]# megacli -AdpBbuCmd -GetBbuStatus -aALL |grep "Charger Status"
Charger Status: Complete

充電率
[root@test_raid ~]# megacli -AdpBbuCmd -GetBbuStatus -aALL |grep "Relative State of Charge"
Relative State of Charge: 100 %

現在のRAID数
[root@test_raid ~]# megacli -cfgdsply -aALL |grep "Number of DISK GROUPS:"
Number of DISK GROUPS: 1

じょうほうけんしゅつ


RAIDカード情報
[root@test_raid ~]# megacli -cfgdsply –aALL  | more

==============================================================================
Adapter: 0
Product Name: PERC H710P Mini
Memory: 1024MB
BBU: Present
Serial No: 49F033N
==============================================================================
Number of DISK GROUPS: 1

DISK GROUP: 0
Number of Spans: 1
SPAN: 0
Span Reference: 0x00
Number of PDs: 2
Number of VDs: 1
Number of dedicated Hotspares: 0
Virtual Drive Information:
Virtual Drive: 0 (Target Id: 0)
Name                :system_vd
RAID Level          : Primary-1, Secondary-0, RAID Level Qualifier-0
Size                : 3.637 TB
Mirror Data         : 3.637 TB
State               : Optimal
Strip Size          : 64 KB
Number Of Drives    : 2
Span Depth          : 1
Default Cache Policy: WriteBack, ReadAdaptive, Direct, No Write Cache if Bad BBU
Current Cache Policy: WriteBack, ReadAdaptive, Direct, No Write Cache if Bad BBU
Default Access Policy: Read/Write
Current Access Policy: Read/Write
Disk Cache Policy   : Disk's Default
Ongoing Progresses:
  Background Initialization: Completed 13%, Taken 63 min.
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: Yes
Cache Cade Type : Read Only
Physical Disk Information:
Physical Disk: 0
Enclosure Device ID: 32
Slot Number: 0
Drive's postion: DiskGroup: 0, Span: 0, Arm: 0
Enclosure position: 1
Device Id: 0
WWN: 5000C50062A960D0
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: 3.638 TB [0x1d1c0beb0 Sectors]
Non Coerced Size: 3.637 TB [0x1d1b0beb0 Sectors]
Coerced Size: 3.637 TB [0x1d1b00000 Sectors]
Firmware state: Online, Spun Up
Device Firmware Level: GS0F
Shield Counter: 0
Successful diagnostics completion on :  N/A
SAS Address(0): 0x5000c50062a960d1
SAS Address(1): 0x0
Connected Port Number: 0(path0)
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z6ABTC
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 :29C (84.20 F)
PI Eligibility:  No
Drive is formatted for PI information:  No
PI: No PI
Port-0 :
Port status: Active
Port's Linkspeed: 6.0Gb/s
Port-1 :
Port status: Active
Port's Linkspeed: Unknown
Drive has flagged a S.M.A.R.T alert : No



Physical Disk: 1
Enclosure Device ID: 32
Slot Number: 1
Drive's postion: DiskGroup: 0, Span: 0, Arm: 1
Enclosure position: 1
Device Id: 1
WWN: 5000C50062A98C78
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: 3.638 TB [0x1d1c0beb0 Sectors]
Non Coerced Size: 3.637 TB [0x1d1b0beb0 Sectors]
Coerced Size: 3.637 TB [0x1d1b00000 Sectors]
Firmware state: Online, Spun Up
Device Firmware Level: GS0F
Shield Counter: 0
Successful diagnostics completion on :  N/A
SAS Address(0): 0x5000c50062a98c79
SAS Address(1): 0x0
Connected Port Number: 0(path0)
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z6ABD4
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 :29C (84.20 F)
PI Eligibility:  No
Drive is formatted for PI information:  No
PI: No PI
Port-0 :
Port status: Active
Port's Linkspeed: 6.0Gb/s
Port-1 :
Port status: Active
Port's Linkspeed: Unknown
Drive has flagged a S.M.A.R.T alert : No

その他の物理情報
[root@test_raid ~]# megacli -PDList -aALL 

現在のRAIDディスク情報
[root@test_raid ~]# megacli -LDInfo -LALL –aAll


Adapter 0 -- Virtual Drive Information:
Virtual Drive: 0 (Target Id: 0)
Name                :system_vd
RAID Level          : Primary-1, Secondary-0, RAID Level Qualifier-0
Size                : 3.637 TB
Mirror Data         : 3.637 TB
State               : Optimal
Strip Size          : 64 KB
Number Of Drives    : 2
Span Depth          : 1
Default Cache Policy: WriteBack, ReadAdaptive, Direct, No Write Cache if Bad BBU
Current Cache Policy: WriteBack, ReadAdaptive, Direct, No Write Cache if Bad BBU
Default Access Policy: Read/Write
Current Access Policy: Read/Write
Disk Cache Policy   : Disk's Default
Ongoing Progresses:
  Background Initialization: Completed 14%, Taken 64 min.
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: Yes
Cache Cade Type : Read Only

raidコントローラ個数
[root@test_raid ~]# megacli  -adpCount


Controller Count: 1.

raidコントローラ時間
[root@test_raid ~]# megacli -AdpGetTime –aALL


Adapter 0:
    Date: 12/31/2014
    Time: 16:21:15

キャッシュおよびポリシー


raid cacheポリシー
[root@test_raid ~]# megacli  -cfgdsply -aALL |grep Polic
Default Cache Policy: WriteBack, ReadAdaptive, Direct, No Write Cache if Bad BBU
Current Cache Policy: WriteBack, ReadAdaptive, Direct, No Write Cache if Bad BBU
Default Access Policy: Read/Write
Current Access Policy: Read/Write
Disk Cache Policy   : Disk's Default
Default Power Savings Policy: Controller Defined
Current Power Savings Policy: None

ディスクキャッシュポリシーの表示
[root@test_raid ~]# megacli -LDGetProp -Cache -L0 -a0   <-   RAID
[root@test_raid ~]# megacli -LDGetProp -Cache -L1 -a0   <-   RAID
[root@test_raid ~]# megacli -LDGetProp -Cache -LALL -a0

Adapter 0-VD 0(target id: 0): Cache Policy:WriteBack, ReadAdaptive, Direct, No Write Cache if bad BBU

ディスクキャッシュポリシーの設定
キャッシュポリシーの説明:
WT    (Write through)
WB    (Write back)
NORA  (No read ahead)
RA    (Read ahead)
ADRA  (Adaptive read ahead)
Cached
Direct

-RW|RO|Blocked|RemoveBlocked | WT|WB|ForcedWB [-Immediate] |RA|NORA | DsblP | Cached|Direct | -EnDskCache|DisDskCache | CachedBadBBU|NoCachedBadBBU
        -Lx|-L0,1,2|-Lall -aN|-a0,1,2|-aALL

ダイレクトライトバックの設定
[root@test_raid ~]# megacli -LDSetProp WT -L0 -a0

Set Write Policy to WriteThrough on Adapter 0, VD 0 (target id: 0) success

ダイレクトライトバック
[root@test_raid ~]# megacli -LDSetProp -Direct -L0 -a0

Set Cache Policy to Direct on Adapter 0, VD 0 (target id: 0) success

キャッシュを閉じる
[root@test_raid ~]# megacli -LDSetProp -DisDskCache -L0 -a0

Set Disk Cache Policy to Disabled on Adapter 0, VD 0 (target id: 0) success

raid管理


ディスク検出方法
クエリー・ディスクの数、シーケンス番号
[root@test_raid ~]# megacli -PDList -aALL | grep 'Inquiry Data:'
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z6ABTC
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z6ABD4
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z69SFJ
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z6A4Z7
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z6A4X5
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z6A5YG
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z6AB8R
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z6AALM
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z6A4N0
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z6A51S
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z69ST5
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z6A4V1
[root@test_raid ~]# megacli -PDList -aALL | grep WWN
WWN: 5000C50062A960D0
WWN: 5000C50062A98C78
WWN: 5000C50062A9AF54
WWN: 5000C50062A98F30
WWN: 5000C50062A993AC
WWN: 5000C50062A93EA4
WWN: 5000C50062A9998C
WWN: 5000C50062A9CB4C
WWN: 5000C50062A9B52C
WWN: 5000C50062A98CB0
WWN: 5000C50062A99CF0
WWN: 5000C50062A99990

ディスクIDを検出する注意、このID値はディスクを表示するために使用される
[root@test_raid ~]# megacli -PDlist -aALL | grep "ID"  | uniq
Enclosure Device ID: 32

現在のraidグループおよび各raidグループに対応するディスクの検出
[root@test_raid ~]#  megacli -cfgdsply –aALL  | grep -E "DISK\ GROUP|Slot\ Number"
Number of DISK GROUPS: 1
DISK GROUP: 0
Slot Number: 0
Slot Number: 1

現在のディスクのシーケンス番号を問い合せ、ディスクが破損しているかどうかを検出します(注、現在6番目のディスクで問題が発生しています)
[root@test_raid ~]# megacli -PDList -aALL | grep -E "Drive\:\ \ Not\ Supported|Slo"
Slot Number: 0
Slot Number: 1
Slot Number: 2
Slot Number: 3
Slot Number: 4
Slot Number: 5
Drive:  Not Supported
Slot Number: 6
Slot Number: 7
Slot Number: 8
Slot Number: 9
Slot Number: 10
Slot Number: 11

foreign管理


RAIDを作成する前に、foreign構成があるかどうかを検出する必要があります.クリアする必要がある場合(foreign=新しく追加されたディスクの前にRAIDが作成されている場合は、初期化する必要があります)
[root@test_raid ~]# megacli -PDlist -aALL | grep "Foreign State"
Foreign State: None
Foreign State: None
Foreign State: None
Foreign State: None
Foreign State: None
Foreign State: None  (Foreign)   foreign  ,    (  Slot Number: 5 )
Foreign State: None
Foreign State: None
Foreign State: None
Foreign State: None
Foreign State: None
Foreign State: None

Foreignディスクをunconfigrue goodと表記する
[root@test_raid ~]# megacli -PDMakeGood -PhysDrv[32:5] -a0

Adapter: 0: Failed to change PD state at EnclId-32 SlotId-5.  [  foreign  ,  ]

Exit Code: 0x01

foreign構成のクリア
[root@test_raid ~]# megacli -CfgForeign -Scan -a0

There is no foreign configuration on controller 0.

Exit Code: 0x00

raid 0管理


raid 0メソッドの作成(3ディスク)
[root@test_raid ~]#  megacli -CfgLdAdd -r0 [32:2,32:3,32:4] WB Direct -a0

Adapter 0: Created VD 1

Adapter 0: Configured the Adapter!!

Exit Code: 0x00

raidグループと対応するディスクの確認
[root@test_raid ~]# megacli -cfgdsply –aALL  | grep -E "DISK\ GROUP|Slot\ Number|RAID\ Level|Target"
Number of DISK GROUPS: 2
DISK GROUP: 0
Virtual Drive: 0 (Target Id: 0)          [  ID,  ]
RAID Level          : Primary-1, Secondary-0, RAID Level Qualifier-0      [primay-1]  raid 1
Slot Number: 0
Slot Number: 1
DISK GROUP: 1
Virtual Drive: 1 (Target Id: 1)
RAID Level          : Primary-0, Secondary-0, RAID Level Qualifier-0      [primary-0]  raid 0
Slot Number: 2
Slot Number: 3
Slot Number: 4

ディスクが作成中かどうかを問い合わせる
[root@test_raid ~]# megacli -PDRbld -ProgDsply -PhysDrv [32:3,32,2,32,4] -aALL
Device(Encl-32 Slot-3) is not in rebuild process
Device(Encl-32 Slot-2) is not in rebuild process
Device(Encl-32 Slot-4) is not in rebuild process

RAIDを削除
[root@test_raid ~]# megacli -CfgLdDel -L1 -a0

 Virtual Disk is associate with Cache Cade. Please Use force option to delete   <-   force  


[root@test_raid ~]# megacli -CfgLdDel -L1 -force -a0

Adapter 0: Deleted Virtual Drive-1(target id-1)

Exit Code: 0x00

raid 1管理
2つのディスクでRAID 1を作成
[root@test_raid ~]# megacli -CfgLdAdd -r1 [32:5,32:6] WB Direct -a0

Adapter 0: Created VD 2

Adapter 0: Configured the Adapter!!

Exit Code: 0x00

検出方法
[root@test_raid ~]# megacli -cfgdsply –aALL  | grep -E "DISK\ GROUP|Slot\ Number|RAID\ Level|Target"
Number of DISK GROUPS: 3
DISK GROUP: 0
Virtual Drive: 0 (Target Id: 0)
RAID Level          : Primary-1, Secondary-0, RAID Level Qualifier-0
Slot Number: 0
Slot Number: 1
DISK GROUP: 1
Virtual Drive: 1 (Target Id: 1)
RAID Level          : Primary-0, Secondary-0, RAID Level Qualifier-0
Slot Number: 2
Slot Number: 3
Slot Number: 4
DISK GROUP: 2
Virtual Drive: 2 (Target Id: 2)
RAID Level          : Primary-1, Secondary-0, RAID Level Qualifier-0
Slot Number: 5
Slot Number: 6

削除方法同上
[root@test_raid ~]# megacli -CfgLdDel -L2 -force -a0

RAID 5管理


1つのホットスペア3つのグループRAID方法
[root@test_raid ~]# megacli -CfgLdAdd -r5 [32:7,32:8,32:9] WB Direct -Hsp[32:10] -a0

Adapter 0: Created VD 3
Adapter: 0: Set Physical Drive at EnclId-32 SlotId-10 as Hot Spare Success.

Adapter 0: Configured the Adapter!!

Exit Code: 0x00

グループRAIDはすぐに完成して、グループRAIDの後で、すぐにディスクの上で設備の名称を見ることができます
[root@test_raid ~]# megacli -PDRbld -ProgDsply -PhysDrv [32:7,32:8,32:9] -aALL

Device(Encl-32 Slot-7) is not in rebuild process
Device(Encl-32 Slot-8) is not in rebuild process
Device(Encl-32 Slot-9) is not in rebuild process

現在のRAID 5ディスクサイズを問い合わせる
[root@test_raid ~]#  fdisk -l /dev/sdd
Disk /dev/sdd: 8000.5 GB, 8000450330624 bytes
255 heads, 63 sectors/track, 972666 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

ホットディスクメソッドの問合せ
[root@test_raid ~]# megacli -PDList -aALL |  grep -E "DISK\ GROUP|Slot\ Number|postion:|Firmware\ state:"
Slot Number: 0                                      <-  
Drive's postion: DiskGroup: 0, Span: 0, Arm: 0      <- DiskGroup: 0   RAID  
Firmware state: Online, Spun Up                     <- Online  
Slot Number: 1
Drive's postion: DiskGroup: 0, Span: 0, Arm: 1
Firmware state: Online, Spun Up
Slot Number: 2
Drive's postion: DiskGroup: 1, Span: 0, Arm: 0
Firmware state: Online, Spun Up
Slot Number: 3
Drive's postion: DiskGroup: 1, Span: 0, Arm: 1
Firmware state: Online, Spun Up
Slot Number: 4
Drive's postion: DiskGroup: 1, Span: 0, Arm: 2
Firmware state: Online, Spun Up
Slot Number: 5
Drive's postion: DiskGroup: 2, Span: 0, Arm: 0
Firmware state: Online, Spun Up
Slot Number: 6
Drive's postion: DiskGroup: 2, Span: 0, Arm: 1
Firmware state: Online, Spun Up
Slot Number: 7
Drive's postion: DiskGroup: 3, Span: 0, Arm: 0
Firmware state: Online, Spun Up
Slot Number: 8
Drive's postion: DiskGroup: 3, Span: 0, Arm: 1
Firmware state: Online, Spun Up
Slot Number: 9
Drive's postion: DiskGroup: 3, Span: 0, Arm: 2
Firmware state: Online, Spun Up
Slot Number: 10
Firmware state: Hotspare, Spun Up                   <- HotSpare  
Slot Number: 11
Firmware state: Unconfigured(good), Spun Up

RAID 5拡張[失敗]
[root@test_raid ~]# megacli -LDRecon -Start -r5 -Add -PhysDrv[32:11] -L3 -a0

Failed to Start Reconstruction of Virtual Drive.

FW error description:
  The requested virtual drive operation cannot be performed because consistency check is in progress.

Exit Code: 0x17

こしょうシミュレーション


障害ディスクをシミュレートし、障害が発生した後、ディスクをOFFLINE操作する必要がある
[root@test_raid ~]# megacli -PDOffline -PhysDrv [32:9] -a0

Adapter: 0: EnclId-32 SlotId-9 state changed to OffLine.

Exit Code: 0x00

ディスク9がOFFLINEを実行すると、ホットスペアは自動的にREBUILDする
[root@test_raid ~]# megacli -PDList -aALL |  grep -E "DISK\ GROUP|Slot\ Number|postion:|Firmware\ state:"

Drive's postion: DiskGroup: 3, Span: 0, Arm: 0
Firmware state: Online, Spun Up
Slot Number: 8
Drive's postion: DiskGroup: 3, Span: 0, Arm: 1
Firmware state: Online, Spun Up
Slot Number: 9
Firmware state: Unconfigured(good), Spun Up         <- offline  
Slot Number: 10
Drive's postion: DiskGroup: 3, Span: 0, Arm: 2
Firmware state: Rebuild                             <---   rebuild  

クエリーrebuildステータス
[root@test_raid ~]# megacli -PDRbld -ProgDsply -PhysDrv [32:10] -aALL

    Rebuild progress of physical drives...

  Enclosure:Slot               Percent Complete                       Time Elps
       032 :10     ***********************00 %*********************** 00:03:44

9番目のディスクをホットスペアとして再使用
[root@test_raid ~]# megacli -PDHSP   -Set   -Dedicated  -Array3  -physdrv[32:9] -a0

Adapter: 0: Set Physical Drive at EnclId-32 SlotId-9 as Hot Spare Success.

Exit Code: 0x00

クエリーのステータス
Firmware state: Online, Spun Up
Slot Number: 7
Drive's postion: DiskGroup: 3, Span: 0, Arm: 0
Firmware state: Online, Spun Up
Slot Number: 8
Drive's postion: DiskGroup: 3, Span: 0, Arm: 1
Firmware state: Online, Spun Up
Slot Number: 9
Firmware state: Hotspare, Spun Up
Slot Number: 10
Drive's postion: DiskGroup: 3, Span: 0, Arm: 2
Firmware state: Rebuild

障害のあるディスクをフラッシュする
[root@test_raid ~]# megacli -PdLocate -start -physdrv[32:11]  -a0

Adapter: 0: Device at EnclId-32 SlotId-11  -- PD Locate Start Command was successfully sent to Firmware

Exit Code: 0x00

ストップフラッシュ
[root@test_raid ~]# megacli -PdLocate -stop -physdrv[32:11]  -a0

Adapter: 0: Device at EnclId-32 SlotId-11  -- PD Locate Stop Command was successfully sent to Firmware

Exit Code: 0x00

管理の開始


起動raidグループの指定
megacli -AdpBootDrive -set -L0 -a0