指令 #smartctl – https://benjr.tw/95984 是透過硬碟本身所提供的 S.M.A.R.T. (Self-Monitoring Analysis and Reporting Technology )技術 ,他可以根據檢測屬性的結果來決定該顆硬碟的使用是否快故障.但手動的總是不方便,我們可以使用 smartd (Daemon) 自動執行.
測試環境為 Ubuntu14.04
啟用 smartd, 並設定檢查間隔時間為 interval=1800 秒
root@ubuntu:~# nano /etc/default/smartmontools start_smartd=yes smartd_opts="--interval=1800"
剛剛設定 smartd 服務是否啟動與間隔時間,詳細的測試項目須參考這一檔案.
root@ubuntu:~# nano /etc/smartd.conf DEVICESCAN -d removable -n standby -m root -M exec /usr/share/smartmontools/smartd-runner
參數說明如下:
- -d TYPE
- ata – the device type is ATA.
- scsi – the device type is SCSI.
- 3ware,N – the device consists of one or more ATA disks connected to a 3ware RAID controller.
- removable – the device or its media is removable. This indicates to smartd that it should continue
- -n POWERMODE
- never – smartd will poll (check) the device regardless of its power mode.
- sleep – check the device unless it is in SLEEP mode.
- standby – check the device unless it is in SLEEP or STANDBY mode.
- idle – check the device unless it is in SLEEP, STANDBY or IDLE mode.
- -m
: specifies an email address to send test reports to. - -M
: specifies the desired type of delivery for an email report.- once: sends only one warning email for each type of disk problem detected.
- daily: sends additional warning reminder emails, once per day, for each type of disk problem detected.
- diminishing: sends additional warning reminder emails, after a one-day interval, then a two-day interval, then a four-day interval, and so on for each type of disk problem detected.
- test: sends a single test email immediately upon smartd startup.
- exec PATH: runs the executable PATH instead of the default mail command.
啟動服務
root@ubuntu:~# service smartmontools start
沒有解決問題,試試搜尋本站其他內容
One thought on “Linux command – smartd”