Installation
aptitude install hdparm smartmontools
Configuration
Since Debian 9, hdparm is not run during system startup anymore. Thus, a custom systemd service has to be created in /etc/systemd/system/rc-local.service
:
[Unit]
Description=/etc/rc.local
ConditionPathExists=/etc/rc.local
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target"
Create a dummy /etc/rc.local
:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
exit 0
Make it runnable and enable the systemd service:
chmod +x /etc/rc.local
systemctl enable rc-local
systemctl status rc-local.service
To check health status of all disks change the DEVICESCAN
line in /etc/smartd.conf
to the following based on an articel in c’t 17/2011, p178:
DEVICESCAN -a -n standby -m root -M test -o on -S on -s (S/../.././0|L/../../6/0)
Description of used options:
-a: equivalent to -H, -f, -t, -l selftest, -l error, -C 197, -U 198
-n: nocheck when in given powermode
-m: send warning email to ADD
-M: email-behaviour
-o: automatic offline tests
-S: attribute autosave
-s: start self-test when type/date matches regex
Letting smartd checking on the drives every 12h is sufficient for private use, so change /etc/default/smartmontools
to:
start_smartd=yes
smartd_opts="--interval=43200"