r/linuxadmin • u/laur_89 • Oct 21 '25
smartd setup - do we have to execute smartctl at system boot?
Have smartmontools pkg installed, which sets up smartd.service. Configuring /etc/smartd.conf is relatively straight-forward following manpage & wiki. Say we have set DEVICESCAN as
DEVICESCAN -a -o on -S on -n standby,q -s (S/../.././05|L/../../4/01) -W 5,36,45 -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?
1
u/aioeu Oct 21 '25 edited Oct 21 '25
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 data collection or testing, 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.
1
u/frymaster Oct 21 '25
apologies, I don't have first-hand knowledge, but this seems like it's something testable