smartd setup - do we have to execute smartctl at system boot?
Posted by laur_89@reddit | linuxadmin | View on Reddit | 2 comments
Have smartmontools pkg installed, which sets up smartd.service. Configuring /etc/smartd.conf is relatively straight-forward following manpage & wiki. Let's assume we have set DEVICESCAN as
DEVICESCAN -a -o on -S on -n standby,q -s (S/../.././02|L/../../6/03) -W 4,35,40 -m <nomailer> -M exec /usr/local/bin/notifier.sh
But what I don't understand is whether we're supposed to execute smartctl -s on -o on -S on /dev/X for each disk device at startup as well or not. Note smartctl manpage under examples states:
smartctl --smart=on --offlineauto=on --saveauto=on /dev/hda
Enable SMART on drive /dev/hda, enable automatic offline testing every four hours, and enable autosaving of SMART Attributes. This is a good start-up line for your system's init files.
This implies it should be executed at system startup. DEVICESCAN in smartd.conf has two of these options duplicated (DEVICESCAN -o on -S on) so perhaps the startup command can be shortened as smartctl --smart=on /dev/X
Is my understanding correct and above command should be executed at system startup? How do you set up your smartd instance?
frymaster@reddit
apologies, I don't have first-hand knowledge, but this seems like it's something testable
aioeu@reddit
I've never run it, and the
smartd.serviceon my systems does not run it.It might be the case that some devices don't enable SMART by default, so perhaps
--snart=onmight be necessary. The documentation says--saveauto=is preserved across drive power cycles, so it shouldn't need to be used on every boot.So that just leaves
--offlineauto=. If you want automatic offline tests, that could possibly be useful.The documentation also says the underlying ATA commands behind all of these settings are obsolete... so maybe they won't work anyway.