Running smartctl -H will wake a disk in standby.
Avoid this by passing -n standby to smartctl and at the same time turn led color to $COLOR_DISK_STANDBY (blue by default).
Led is reset in check disk online status loop.
This might delay led turning blue up to smartctl interval time (5 min), however I wanted to avoid running smartctl more frequently. For disks in standby, status is rechecked in check disk online status loop as this would not really call into smart health status. Led is reset if disk is woken or failed. This reacts faster and usually the led is reset before the disk is completely spun up.
An alternative would be I suppose to use hdparm to check for power status in disk online loop and react faster but I did not want to bring new dependencies.
Disks would probably still be woken if put into sleep mode as that reqires interface reset before getting any response from the disk. Users should just use standby instead.
I've also changed smartctl check, it's now checking for return code (which would indicate any failure) and used return status 1 as disk in standby (which is originally used for Command line did not parse. but hopefully that should not happen).
Running
smartctl -H
will wake a disk in standby. Avoid this by passing-n standby
tosmartctl
and at the same time turn led color to$COLOR_DISK_STANDBY
(blue by default). Led is reset incheck disk online status
loop.This might delay led turning blue up to smartctl interval time (5 min), however I wanted to avoid running smartctl more frequently. For disks in standby, status is rechecked in
check disk online status
loop as this would not really call into smart health status. Led is reset if disk is woken or failed. This reacts faster and usually the led is reset before the disk is completely spun up.An alternative would be I suppose to use
hdparm
to check for power status in disk online loop and react faster but I did not want to bring new dependencies.Disks would probably still be woken if put into
sleep
mode as that reqires interface reset before getting any response from the disk. Users should just usestandby
instead.I've also changed smartctl check, it's now checking for return code (which would indicate any failure) and used return status 1 as disk in standby (which is originally used for
Command line did not parse.
but hopefully that should not happen).