使用smartmontools检测硬盘状态

一台DEBIAN服务器因为硬盘损坏,已经倒下了,虽然在倒下之前已经抢救了大部分的数据,但是ORACLE数据库因为无备份非存档模式,数据丢失。
因此想找个硬盘状态检测的软件,以方便在硬盘出问题之前,能够预作准备。

安装非常简单:
sudo aptitude install smartmontools
然后要进行相关的配置,首先要编辑/etc/default/smartmontools:
把start_smartd=yes前面的注释去掉,然后在enable_smart里设置你想要检测的设备。
然后编辑/etc/smartd.conf文件:
把DEVICESCAN这一行给注释掉,然后在后面添加你想要检测的参数。
如我的监测:

/dev/sda -d scsi -s L/../../3/01 -m myemail
/dev/sdb -d scsi -s L/../../7/01 -m myemail
/dev/sdc -d scsi -s L/../../7/02 -m myemail
/dev/sda -d scsi -H -m myemail
/dev/sdb -d scsi -H -m myemail
/dev/sdc -d scsi -H -m myemail

然后重新启动服务:

sudo /etc/init.d/smartmontools restart

参考:
1 https://help.ubuntu.com/community/Smartmontools
2 http://blog.ssh.tw/?p=778

This entry was posted in Linux and tagged , , , . Bookmark the permalink.

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please copy the string z2ji3f to the field below:

以新浪微博帐号登录