Add runtime check and README note to clarify that spin down time must be larger than temp check interval
This commit is contained in:
@@ -103,14 +103,14 @@ SATA drives can be configured to automatically spin down after a certain period
|
||||
This is due to the fact that HDD Fan control will query temperature at fixed interval, which the drive will consider an activity and reset the spin down timeout.
|
||||
To fix that, you can either:
|
||||
|
||||
* use a value for the `--interval` parameter higher than your SATA spin down time (not recommended unless your spin down time is very low, ie < 2 min)
|
||||
* use the `--spin-down-time` parameter that will monitor drive activity and spin it down if inactive, independantly of the SATA feature (recommended)
|
||||
* Use a value for the `-i`/`--interval` parameter higher than your SATA spin down time (not recommended unless your spin down time is very low, ie < 2 min). In that case you do not need to use hddfancontrol's `--spin-down-time` switch, because the builtin SATA drive timeout (that you can set for example with [`hdparm -S XXX` command](https://linux.die.net/man/8/hdparm)) should take effect.
|
||||
* Use the `--spin-down-time` parameter that will monitor drive activity and spin it down if inactive, independantly of the SATA feature (recommended)
|
||||
|
||||
**Keep in mind that spinning down and up a drive repeatedly wears it prematurly, so unless you are in a power constrained environement (ie. laptop), do not set the spin down time too low.**
|
||||
|
||||
Reading temperature while a drive is in low power state will make it spin up, so HDD Fan control will stop querying temperature in that case, and wait for the drive (which will be cooling down in low power state anyway) to spin up.
|
||||
|
||||
Some Hitachi (now HGST) drives support a special way of querying temperature that does not spin up drives, which HDD Fan control will detect and use, however it still prevents them from spinning down, so the above instructions still apply.
|
||||
Some HGST (previously Hitachi) drives support a special way of querying temperature that does not spin up drives, which HDD Fan control will detect and use, however it still prevents them from spinning down, so the above instructions still apply.
|
||||
|
||||
|
||||
## Command line usage
|
||||
|
||||
@@ -559,7 +559,7 @@ def main(drive_filepaths, fan_pwm_filepaths, fan_start_values, fan_stop_values,
|
||||
|
||||
# start spin down threads if needed
|
||||
spin_down_threads = []
|
||||
if (spin_down_time_s is not None) and (spin_down_time_s > interval_s):
|
||||
if (spin_down_time_s is not None) and (spin_down_time_s >= interval_s):
|
||||
for drive in drives:
|
||||
spin_down_threads.append(DriveSpinDownThread(drive, spin_down_time_s))
|
||||
for thread in spin_down_threads:
|
||||
@@ -727,7 +727,12 @@ def cl_main():
|
||||
if (((args.fan_start_value is not None) and (len(args.fan_pwm_filepath) != len(args.fan_start_value))) or
|
||||
((args.fan_stop_value is not None) and (len(args.fan_pwm_filepath) != len(args.fan_stop_value)))):
|
||||
print("Invalid parameter count")
|
||||
exit(1)
|
||||
exit(os.EX_USAGE)
|
||||
if (args.spin_down_time_s is not None) and (args.spin_down_time_s < args.interval_s):
|
||||
print("Spin down time %us is lower than temperature check interval %us.\n"
|
||||
"Please set a higher spin down time, or use hdparm's -S switch "
|
||||
"to set SATA spin down time." % (args.spin_down_time_s, args.interval_s))
|
||||
exit(os.EX_USAGE)
|
||||
|
||||
# setup logger
|
||||
logging_level = {"warning": logging.WARNING,
|
||||
|
||||
Reference in New Issue
Block a user