官网地址
官网下载安装
安装 注意:安装MegaCLI需要root权限
rpm -i MegaCli-8.07.14-1.noarch.rpm
使用
1. 命令使用:
2. #/opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -Lall -aALL 查raid级别
3. #/opt/MegaRAID/MegaCli/MegaCli64 -AdpAllInfo -aALL 查raid卡信息
4. #/opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL 查看硬盘信息
5. #/opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -aAll 查看电池信息
6. #/opt/MegaRAID/MegaCli/MegaCli64 -FwTermLog -Dsply -aALL 查看raid卡日志
7. #/opt/MegaRAID/MegaCli/MegaCli64 -adpCount 【显示适配器个数】
8. #/opt/MegaRAID/MegaCli/MegaCli64 -AdpGetTime –aALL 【显示适配器时间】
9. #/opt/MegaRAID/MegaCli/MegaCli64 -AdpAllInfo -aAll 【显示所有适配器信息】
10. #/opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -LALL -aAll 【显示所有逻辑磁盘组信息】
11. #/opt/MegaRAID/MegaCli/MegaCli64 -PDList -aAll 【显示所有的物理信息】
12. #/opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -GetBbuStatus -aALL |grep ‘Charger Status’ 【查看充电状态】
13. #/opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -GetBbuStatus -aALL【显示BBU状态信息】
14. #/opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -GetBbuCapacityInfo -aALL【显示BBU容量信息】
15. #/opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -GetBbuDesignInfo -aALL 【显示BBU设计参数】
16. #/opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -GetBbuProperties -aALL 【显示当前BBU属性】
17. #/opt/MegaRAID/MegaCli/MegaCli64 -cfgdsply -aALL 【显示Raid卡型号,Raid设置,Disk相关信息】
18. 3.磁带状态的变化,从拔盘,到插盘的过程中。
19. Device |Normal|Damage|Rebuild|Normal
20. Virtual Drive |Optimal|Degraded|Degraded|Optimal
21. Physical Drive |Online|Failed –> Unconfigured|Rebuild|Online
22. 4.查看磁盘缓存策略
23. #/opt/MegaRAID/MegaCli/MegaCli64 -LDGetProp -Cache -L0 -a0
24. or
25. #/opt/MegaRAID/MegaCli/MegaCli64 -LDGetProp -Cache -L1 -a0
26. or
27. #/opt/MegaRAID/MegaCli/MegaCli64 -LDGetProp -Cache -LALL -a0
28. ro
29. #/opt/MegaRAID/MegaCli/MegaCli64 -LDGetProp -Cache -LALL -aALL
30. ro
31. #/opt/MegaRAID/MegaCli/MegaCli64 -LDGetProp -DskCache -LALL -aALL
32. 5.设置磁盘缓存策略
33. 缓存策略解释:
34.
35. WT (Write through
36. WB (Write back)
37. NORA (No read ahead)
38. RA (Read ahead)
39. ADRA (Adaptive read ahead)
40. Cached
41. Direct
42. 例子:
43. #/opt/MegaRAID/MegaCli/MegaCli64 -LDSetProp WT|WB|NORA|RA|ADRA -L0 -a0
44. or
45. #/opt/MegaRAID/MegaCli/MegaCli64 -LDSetProp -Cached|-Direct -L0 -a0
46. or
47. enable / disable disk cache
48. #/opt/MegaRAID/MegaCli/MegaCli64 -LDSetProp -EnDskCache|-DisDskCache -L0 -a0
49. 6.创建一个 raid5 阵列,由物理盘 2,3,4 构成,该阵列的热备盘是物理盘 5
50. #/opt/MegaRAID/MegaCli/MegaCli64 -CfgLdAdd -r5 [1:2,1:3,1:4] WB Direct -Hsp[1:5] -a0
51. 7.创建阵列,不指定热备
52. #/opt/MegaRAID/MegaCli/MegaCli64 -CfgLdAdd -r5 [1:2,1:3,1:4] WB Direct -a0
53. 8.删除阵列
54. #/opt/MegaRAID/MegaCli/MegaCli64 -CfgLdDel -L1 -a0
55. 9.在线添加磁盘
56. #/opt/MegaRAID/MegaCli/MegaCli64 -LDRecon -Start -r5 -Add -PhysDrv[1:4] -L1 -a0
57. 10.阵列创建完后,会有一个初始化同步块的过程,可以看看其进度。
58. #/opt/MegaRAID/MegaCli/MegaCli64 -LDInit -ShowProg -LALL -aALL
59. 或者以动态可视化文字界面显示
60. #/opt/MegaRAID/MegaCli/MegaCli64 -LDInit -ProgDsply -LALL -aALL
61. 11.查看阵列后台初始化进度
62. #/opt/MegaRAID/MegaCli/MegaCli64 -LDBI -ShowProg -LALL -aALL
63. 或者以动态可视化文字界面显示
64. #/opt/MegaRAID/MegaCli/MegaCli64 -LDBI -ProgDsply -LALL -aALL
65. 12.指定第 5 块盘作为全局热备
66. #/opt/MegaRAID/MegaCli/MegaCli64 -PDHSP -Set [-EnclAffinity] [-nonRevertible] -PhysDrv[1:5] -a0
67. 13.指定为某个阵列的专用热备
68. #/opt/MegaRAID/MegaCli/MegaCli64 -PDHSP -Set [-Dedicated [-Array1]] [-EnclAffinity] [-nonRevertible] -PhysDrv[1:5] -a0
69. 14.删除全局热备
70. #/opt/MegaRAID/MegaCli/MegaCli64 -PDHSP -Rmv -PhysDrv[1:5] -a0
71. 15.将某块物理盘下线/上线
72. #/opt/MegaRAID/MegaCli/MegaCli64 -PDOffline -PhysDrv [1:4] -a0
73. #/opt/MegaRAID/MegaCli/MegaCli64 -PDOnline -PhysDrv [1:4] -a0
74. 16.查看物理磁盘重建进度
75. #/opt/MegaRAID/MegaCli/MegaCli64 -PDRbld -ShowProg -PhysDrv [1:5] -a0
76. 或者以动态可视化文字界面显示
77. #/opt/MegaRAID/MegaCli/MegaCli64 -PDRbld -ProgDsply -PhysDrv [1:5] -a0
78.
79. 磁带状态的变化,从拔盘,到插盘的过程中:
80. Device |Normal|Damage|Rebuild|Normal
81. Virtual Drive |Optimal|Degraded|Degraded|Optimal
82. Physical Drive |Online|Failed –> Unconfigured|Rebuild|Online