2

Is there a way to tell smartd to say run smartd long test once a week, say Sunday and run small tests every half and hour or a hour, dunno what is good practise but going with this at the moment. I have enough space in / so I could use something like /var/log/smart and have the output in .json or something which is readable.

$ df -h /
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda7       641G   36G  573G   6% /

I am running smartmontools 7.0 as can be seen -

$ sudo smartctl --version
smartctl 7.0 2018-12-30 r4883 [x86_64-linux-5.3.0-3-amd64] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org

smartctl comes with ABSOLUTELY NO WARRANTY. This is free
software, and you are welcome to redistribute it under
the terms of the GNU General Public License; either
version 2, or (at your option) any later version.
See http://www.gnu.org for further details.

smartmontools release 7.0 dated 2018-12-30 at 14:47:55 UTC

This is from https://tracker.debian.org/pkg/smartmontools

I did see in the manpage that there is support for json as an experimental feature but doesn't say much except for -

~$ man smartctl | grep json
       -j, --json[=cgiosuv]
              'json.KEY1[INDEX2].KEY3 = VALUE;'.

Looking forward to know more. I could just make the directory in /var/log/ as smart but how to make sure that the messages will go /var/log/smart ?

Another point would it need some space in userspace /home/shirish or having space in / and swap which is around 60GB is enough or do need to make in /home also ?

$ free -h 
              total        used        free      shared  buff/cache   available
Mem:           23Gi       3.9Gi        11Gi       282Mi       7.7Gi        18Gi
Swap:          59Gi          0B        59Gi
Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
shirish
  • 11,967
  • 27
  • 107
  • 190
  • 1
    Consider using selective tests instead of long test https://unix.stackexchange.com/a/92663/30851 - this also depends on hard drive size and server load. Regarding JSON the man page is actually quite verbose? Not sure what else you need here. – frostschutz Dec 29 '19 at 12:42
  • 2
    Look at `/etc/smartd.conf`, you’ll find examples of periodic self-test setups there. – Stephen Kitt Dec 29 '19 at 13:36

0 Answers0