查看centos服務器硬盤狀態信息
本來轉載自:www.ttkmwl.com --最給力的程序源碼下載平台論壇-通天源碼論壇
windows下有HDTune可以查看磁盤的狀態,防止磁盤掛掉才會自己知道,CentOS下有SMART (Self-Monitoring, Analysis and Reporting Technology System) 同樣對磁盤做狀態檢測
下麵以dell R720服務器舉例,/dev/sda是1T的scsi接口普通硬盤,/dev/sdd 是三塊盤做的raid5
# df -h #查看磁盤的名字
# dmesg |grep sdd #查看開機信息裏麵的磁盤info
sd 0:2:0:0: [sdd] Attached SCSI disk
# hdparm -I /dev/sda #查看磁盤硬件信息、開啟的功能等,信息特別詳細
下麵用smart查看磁盤的狀態:
# yum install smartmontools //安裝SMART
# smartctl -H /dev/sdd //磁盤健康狀況查看
smartctl 5.43 2012-06-30 r3573 [x86_64-linux-3.10.56-11.el6.centos.alt.x86_64] (local build)
Copyright (C) 2002-12 by Bruce Allen,
SMART Health Status: OK
# smartctl -A /dev/sda 或者 smartctl --all /dev/sda #硬盤的smart信息
# smartctl -a /dev/sdd
smartctl 5.43 2012-06-30 r3573 [x86_64-linux-3.10.56-11.el6.centos.alt.x86_64] (local build)
Copyright (C) 2002-12 by Bruce Allen,
https://smartmontools.sourceforge.net
Vendor: DELL
Product: PERC H310
Revision: 2.12
User Capacity: 598,879,502,336 bytes [598 GB]
Logical block size: 512 bytes
Logical Unit id:
Serial number:
Device type: disk
Local Time is: Wed Jan 14 15:37:39 2015 CST
Device does not support SMART
Error Counter logging not supported
Device does not support Self Test logging
這裏提示Device does not support SMART,所以按下麵方式查看
查看raid5中第一塊磁盤的狀態
# smartctl -a -d megaraid,0 /dev/sdd
同樣查看第二塊、第三塊磁盤的狀態,根據自己的監控情況,加速nagios、zabbix報警
# smartctl -a -d megaraid,1 /dev/sdd
# smartctl -a -d megaraid,2 /dev/sdd
最後更新:2017-06-17 19:31:52