2

I'm trying to let my backup server have its disks in standby as often as possible. Outside of smartd or actual backup usage, the disks currently spin up once per day (various cron tasks).

smartd, by default, writes attribute logs and state files. This wakes up the disks.

It seems attribute logs are written even when smartd is configured to skip disks in standby (-n standby,48,q in smartd.conf). The man page notes this can be disabled by passing -A '' to smartd. State saving can be disabled by passing -s '' to smartd. (These are parameters to the smartd executable, not in smartd.conf.)

The man page does not note what functionality relies on these saved states or attribute logs. It does mention it uses state files to note, among other things, the last email it sent.

What functionality will I lose by disabling these writes? Will smartd send an email each time it checks attributes because it does not know it already sent one? Or is the state information also cached in memory and will it only resend warning emails when restarting smartd?

Current smartd.conf:

/dev/disk/by-id/scsi-SATA_WDC_WD40EFRX-68_XYZ -n standby,24,q -o on -S on -m root -a -l xerror -I 194 -I 3 -W 0,55,60

3 Answers3

0

Have you considered running smartd with a very large value for -i, and then trigger the checks by sending SIGUSR1 to the daemon when it is okay to do so (say when the crons are running).

This way the daemon will not spin up your disks.

Sorry, this does not actually answer your question.

chutz
  • 7,569
  • 1
  • 28
  • 57
0

You won't lose any functionality of smartd, it's just a csv log of the values of the attributes at that time.

If you want to keep them change the prefix to a tmpfs dir and backup those files with your weekly backup. If you haven't found a need to check by yourself just disable it.

Jorge Nerín
  • 1,128
  • 8
  • 8
  • Thank you for your reply! Yes, it seems the attribute logs are just a CSV log and disabling them won't impact any smartd functionality (besides attribute logging). Do you also know what functionality will be impacted when the state files are disabled? – Tomas Creemers Nov 26 '14 at 13:12
  • from man smartd: preserves attributes, drive min and max temps, last sent email info, time of next check (-s regexp) across reboots. The state files are read on smartd startup. After a normal check cycle, a state file is only rewritten if an important change (which usually results in a SYSLOG output) occurred. – Jorge Nerín Nov 26 '14 at 15:04
  • Thanks. I read that paragraph from the man page as well, but I was wondering which functionality that makes me lose. Will it send more emails because it did not store when the last email was sent? – Tomas Creemers Nov 26 '14 at 15:07
  • If the server is always on I don't think that there would be any change. Probably only if the system is powered off and skips a check, or repeats one if you reboot during the time window of one check, say you check each day at 2am (-s S/../.././02) if the test completes and you reboot before 3am it would repeat the test as it wouldn't know it did it a few minutes before. And the email works very similar, it avoids sending repeated emails for conditions you already know, so rebooting would repeat those emails. It's explained in man smartd.conf under -m flag and -s flag, look for "state" there. – Jorge Nerín Nov 26 '14 at 15:53
0

I may not be answering your question directly, but I highly recommend against doing this. Spinning up the disks puts a larger strain on the mechanical components inside the drive (hence why the power cycle count is a good indicator of a drive's age). It's recommended to keep the disks spinning as much as possible to extend drive life.

Nathan C
  • 14,901
  • 4
  • 42
  • 62
  • *"Oh, but this is a home server that I use to store my movie collection..."* – ewwhite Nov 26 '14 at 14:24
  • @ewwhite Right...unless it's pure archive storage (drives will be spun up very infrequently), I can see those drives failing well before he fills them with movies. ;) – Nathan C Nov 26 '14 at 14:25
  • @NathanC, ewwhite: thanks for your help with the context of the question :-) It just seems to me that a monitoring tool should not have such a large influence on the thing it's monitoring. I believe my question remains valid even if the drives are almost never spun down. (The drives will spin up ~3-4 times per day. Power saved by spinning them down is ~€40/year. Drives are rated for 600 000 cycles. The storage is very redundant.) – Tomas Creemers Nov 26 '14 at 14:35