1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
我的博客已迁移到xdoujiang.com请去那边和我交流
======================================Debian============================================
一、Debian下安装Megacli命令
1、当前版本
cat
/etc/debian_version
5.0.1
2、安装包
apt-get -y
install
axel --force-
yes
apt-get -y
install
unzip --force-
yes
apt-get -y
install
rpm --force-
yes
axel - light download accelerator - console version
unzip - De-archiver
for
.zip files
rpm - Red Hat package manager
3、下载8.07.10_MegaCLI_Linux.zip
axel -n 10 http:
//www
.lsi.com
/downloads/Public/RAID
%20Controllers
/RAID
%20Controllers%20Common%20Files
/8
.07.10_MegaCLI_Linux.zip
Initializing download: http:
//www
.lsi.com
/downloads/Public/RAID
%20Controllers
/RAID
%20Controllers%20Common%20Files
/8
.07.10_MegaCLI_Linux.zip
Opening output
file
8.07.10_MegaCLI_Linux.zip
Server unsupported, starting from scratch with one connection.
Starting download
[ 0%] .......... .......... .......... .......... .......... [ 9.9KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 13.7KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 17.2KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 19.8KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 21.9KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 23.9KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 22.0KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 19.7KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 20.7KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 22.2KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 23.5KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 24.1KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 25.4KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 26.8KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 28.2KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 29.5KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 29.8KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 30.2KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 29.5KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 29.6KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 29.0KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 29.5KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 29.6KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 29.6KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 30.3KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 31.0KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 30.5KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 30.8KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 30.9KB
/s
]
[ 0%] .......... .......... .......... .......... .......... [ 31.0KB
/s
]
[ 0%] .......
Connection 0 finished
Downloaded 1507.5 kilobytes
in
48 seconds. (30.96 KB
/s
)
4、解压
unzip 8.07.10_MegaCLI_Linux.zip
Archive: 8.07.10_MegaCLI_Linux.zip
inflating: 8.07.10_MegaCLI_Linux
/Linux
MegaCLI 8.07.10.txt
creating: 8.07.10_MegaCLI_Linux
/Linux
MegaCLI 8.07.10/
inflating: 8.07.10_MegaCLI_Linux
/Linux
MegaCLI 8.07.10
/MegaCli-8
.07.10-1.noarch.rpm
5、安装
cd
/root/8
.07.10_MegaCLI_Linux
/Linux
\ MegaCLI\ 8.07.10/
rpm2cpio MegaCli-8.07.10-1.noarch.rpm|cpio -idmv
.
/opt/MegaRAID/MegaCli/MegaCli
.
/opt/MegaRAID/MegaCli/MegaCli64
.
/opt/MegaRAID/MegaCli/libstorelibir-2
.so.14.07-0
11187 blocks
6、找下相关命令
find
/ -name
"MegaCli*"
/root/8
.07.10_MegaCLI_Linux
/Linux
MegaCLI 8.07.10
/opt/MegaRAID/MegaCli
/root/8
.07.10_MegaCLI_Linux
/Linux
MegaCLI 8.07.10
/opt/MegaRAID/MegaCli/MegaCli
/root/8
.07.10_MegaCLI_Linux
/Linux
MegaCLI 8.07.10
/opt/MegaRAID/MegaCli/MegaCli64
/root/8
.07.10_MegaCLI_Linux
/Linux
MegaCLI 8.07.10
/MegaCli-8
.07.10-1.noarch.rpm
7、将相关命令复制到
/usr/local/sbin/
cp
/root/8
.07.10_MegaCLI_Linux
/Linux
MegaCLI 8.07.10
/opt/MegaRAID/MegaCli/MegaCli
*
/usr/local/sbin/
8、说明
dpkg -S
/usr/bin/rpm2cpio
rpm:
/usr/bin/rpm2cpio
dpkg -S
/bin/cpio
cpio:
/bin/cpio
cpio - GNU cpio -- a program to manage archives of files
-i, --extract Extract files from an archive (run
in
copy-
in
mode)
-d, --
make
-directories Create leading directories where needed
-m, --preserve-modification-
time
Retain previous
file
modification
times
when creating files
-
v
, --verbose Verbosely list the files processed
======================================Centos============================================
二、Centos下安装Megacli命令
1、当前版本
cat
/etc/redhat-release
CentOS release 6.5 (Final)
2、安装包
yum -y
install
wget
yum -y
install
unzip
3、下载8.07.10_MegaCLI_Linux.zip
wget http:
//www
.lsi.com
/downloads/Public/RAID
%20Controllers
/RAID
%20Controllers%20Common%20Files
/8
.07.10_MegaCLI_Linux.zip
--2015-05-13 17:27:56-- http:
//www
.lsi.com
/downloads/Public/RAID
%20Controllers
/RAID
%20Controllers%20Common%20Files
/8
.07.10_MegaCLI_Linux.zip
Resolving www.lsi.com... 192.19.195.176
Connecting to www.lsi.com|192.19.195.176|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1543709 (1.5M) [application
/x-zip-compressed
]
Saving to: 8.07.10_MegaCLI_Linux.zip.1
100%[=============================================================================================================================================>] 1,543,709 18.1K
/s
in
72s
2015-05-13 17:29:08 (21.0 KB
/s
) - 8.07.10_MegaCLI_Linux.zip.1 saved [1543709
/1543709
]
PS:目前已经下载不到这个软件了 我这里上传到博客附件里
4、解压
unzip 8.07.10_MegaCLI_Linux.zip
Archive: 8.07.10_MegaCLI_Linux.zip
inflating: 8.07.10_MegaCLI_Linux
/Linux
MegaCLI 8.07.10.txt
creating: 8.07.10_MegaCLI_Linux
/Linux
MegaCLI 8.07.10/
inflating: 8.07.10_MegaCLI_Linux
/Linux
MegaCLI 8.07.10
/MegaCli-8
.07.10-1.noarch.rpm
5、安装
cd
/root/8
.07.10_MegaCLI_Linux
/Linux
\ MegaCLI\ 8.07.10/
rpm -ivh MegaCli-8.07.10-1.noarch.rpm
Preparing...
########################################### [100%]
1:MegaCli
########################################### [100%]
11187 blocks
6、找下相关命令
find
/ -name
"MegaCli*"
/root/MegaCli-8
.07.10-1.noarch.rpm
/opt/MegaRAID/MegaCli
/opt/MegaRAID/MegaCli/MegaCli64
7、将相关命令复制到
/usr/local/sbin/
cp
/opt/MegaRAID/MegaCli/MegaCli
*
/usr/local/sbin
=======================================================================================
三、命令参考
1、一般使用这2个命令来检查硬盘状态(无论那个数字是1都是要更换硬盘的)
MegaCli64 -AdpAllInfo -aALL -NoLog|
awk
'/Critical Disks/ {print $4}'
1
MegaCli64 -AdpAllInfo -aALL -NoLog|
awk
'/Failed Disks/ {print $4}'
0
2、MegaCli64 -PDList -aALL(查看具体信息,只截图了部分)
Media Error Count: 119
Other Error Count: 0
Predictive Failure Count: 1
Media Error Count: 28
Other Error Count: 0
Predictive Failure Count: 0
确实硬盘是有问题存在的
Media Error一般是指RAID卡发现的磁盘读写错误。通过这个指标我们可以简单的判断磁盘介质的情况,
有media error并不意味者磁盘一定需要更换,因为磁盘的firmware会对坏块进行屏蔽及迁移。
但应建议对磁盘进行诊断,依据诊断结果来判断是否需要更换该磁盘。
Other error一般是指RAID发现的SCSI总线通信错误。一般表明SCSI总线中存在硬件设备故障,
一般是SCSI线缆,硬盘背板,SCSI终结器等。
3、表示正在更换硬盘状态
MegaCli64 -PDList -aALL |
grep
"Firmware state"
Firmware state: Rebuild
Firmware state: Online
Firmware state: Online
Firmware state: Online
Firmware state: Online
Firmware state: Online
Firmware state: Online
Firmware state: Online
4、查看rebuild状态(32:0这个是表示Enclosure Device ID: 32和Device Id和Slot Number)
MegaCli64 -PDRbld -ProgDsply -PhysDrv [32:0] -a0
|
本文转自 xdoujiang 51CTO博客,原文链接:http://blog.51cto.com/7938217/1651041,如需转载请自行联系原作者