HDD Spindown Timer

HDD Spindown Timer 2.2.0

ngandrass

Explorer
Joined
Jun 26, 2019
Messages
68
ngandrass updated HDD Spindown Timer with a new update entry:

Version 1.3.2 (2022-01-10) released

  • Include an option to shutdown the system after all monitored drives are idle for a specified number of seconds. Thanks to @hschwane
    +1
For more details see: https://github.com/ngandrass/freenas-spindown-timer

Read the rest of this update entry...
 

emk2203

Guru
Joined
Nov 11, 2012
Messages
573
The script works fine at least on one of my devices, but another one has issues. When I start the script, it aborts with the following error(s):
Code:
N54LNAS% sudo ./multi_report_v1.6e_11_Nov_2022.sh
Multi-Report v1.6e dtd:2022-11-11 (TrueNAS Core 13.0-U3.1)
Configuration File Version Date: 2022-11-11
Failed conversion of ``2020-Oct-19_03:58:30'' using format ``%Y-%b-%e_%H:%M:%S''
date: illegal time format
usage: date [-jnRu] [-I[date|hours|minutes|seconds]] [-f input_fmt]
            [-r filename|seconds] [-v[+|-]val[y|m|w|d|H|M|S]]
            [[[[[[cc]yy]mm]dd]HH]MM[.SS] | new_date] [+output_fmt]
Failed conversion of ``2022-Aug-28_19:37:29'' using format ``%Y-%b-%e_%H:%M:%S''
date: illegal time format
usage: date [-jnRu] [-I[date|hours|minutes|seconds]] [-f input_fmt]
            [-r filename|seconds] [-v[+|-]val[y|m|w|d|H|M|S]]
            [[[[[[cc]yy]mm]dd]HH]MM[.SS] | new_date] [+output_fmt]
./multi_report_v1.6e_11_Nov_2022.sh: line 2414: [[: ---: syntax error: operand expected (error token is "-")
./multi_report_v1.6e_11_Nov_2022.sh: line 2415: [[: ---: syntax error: operand expected (error token is "-")


It's in both the same TrueNAS version, and they should have a very similar configuration. So what's going on here?
 

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,142
The script works fine at least on one of my devices, but another one has issues. When I start the script, it aborts with the following error(s):
Code:
N54LNAS% sudo ./multi_report_v1.6e_11_Nov_2022.sh
Multi-Report v1.6e dtd:2022-11-11 (TrueNAS Core 13.0-U3.1)
Configuration File Version Date: 2022-11-11
Failed conversion of ``2020-Oct-19_03:58:30'' using format ``%Y-%b-%e_%H:%M:%S''
date: illegal time format
usage: date [-jnRu] [-I[date|hours|minutes|seconds]] [-f input_fmt]
            [-r filename|seconds] [-v[+|-]val[y|m|w|d|H|M|S]]
            [[[[[[cc]yy]mm]dd]HH]MM[.SS] | new_date] [+output_fmt]
Failed conversion of ``2022-Aug-28_19:37:29'' using format ``%Y-%b-%e_%H:%M:%S''
date: illegal time format
usage: date [-jnRu] [-I[date|hours|minutes|seconds]] [-f input_fmt]
            [-r filename|seconds] [-v[+|-]val[y|m|w|d|H|M|S]]
            [[[[[[cc]yy]mm]dd]HH]MM[.SS] | new_date] [+output_fmt]
./multi_report_v1.6e_11_Nov_2022.sh: line 2414: [[: ---: syntax error: operand expected (error token is "-")
./multi_report_v1.6e_11_Nov_2022.sh: line 2415: [[: ---: syntax error: operand expected (error token is "-")


It's in both the same TrueNAS version, and they should have a very similar configuration. So what's going on here?
Wrong thread. You want to post here and probably contact @joeschmuck.
 

ngandrass

Explorer
Joined
Jun 26, 2019
Messages
68

ngandrass

Explorer
Joined
Jun 26, 2019
Messages
68
ngandrass updated HDD Spindown Timer with a new update entry:

Version 2.1.0 (2023-02-19) released - ZFS Pool operation mode

This version introduces a new ZFS pool based operation mode. The script is now able to work on both per-disk or on a ZFS pool basis. It was tested to work on TrueNAS CORE and SCALE :)

Check the updated README.md for more details.

Changelog​

  • A new CLI argument was introduced to switch between disk and zpool operation mode: -u <MODE>...

Read the rest of this update entry...
 

wittyet

Cadet
Joined
Jul 25, 2023
Messages
6
just registered, so I can come here and say thank you.
now my server power consumption goes from 110w to 53s with 7x4T installed.
and I can safely spin up the DS4246 knowing that most of the time the disks will be spin down, lol
 

wittyet

Cadet
Joined
Jul 25, 2023
Messages
6
A quick question, what will happen if I write to the spun down disk array?
I am also trying the hd-idle on OMV and when all disk spun down if I write to them, they through I/O errors all over the console.
 

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,142

wittyet

Cadet
Joined
Jul 25, 2023
Messages
6
I would say the array spins up.
what will be my guess, but the thing is the spin-up takes time, but the writing operating happens the moment I hit enter of click paste,
so the time difference in between may cause problem, unless there is a cache for temp storage, like a ssd.
 

wittyet

Cadet
Joined
Jul 25, 2023
Messages
6
I guess I am too new to be able to edit my own post, I think ZFS uses RAM as write cache, I will experiment during the weekend.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,970
I think ZFS uses RAM as write cache
It sure does, as well as a read cache. But writing to a dataset that has drives not spinning will immediately trigger them to spin up and once up to speed (drives are ready) TrueNAS will write the data to the hard drives.
 

ngandrass

Explorer
Joined
Jun 26, 2019
Messages
68
It sure does, as well as a read cache. But writing to a dataset that has drives not spinning will immediately trigger them to spin up and once up to speed (drives are ready) TrueNAS will write the data to the hard drives.
Yes, this is exactly what happens. Whenever I access a pool whose disks are currently spun down and the requested data is not cached, the first access is delayed by the time it takes to spin up the drives. In my case, this works for both SMB and Jail/VM access equally.
 

Say Heading

Dabbler
Joined
Dec 18, 2023
Messages
20
Hi all,

first post in this forum, trueNAS CORE beginner, mostly noob.
Just used to a bit of hackintoshing with handling open core related issues, and also (but just) a bit of ssh-ing via terminal with the very, very basics. That said, I´m just in a trueNAS (13.0-U6.1) playground with available unused hardware evaluating if such a device would fit in my future needs as homer server, replacing my DAS orientated workflow as I will have to leave my (tower-) hacks behind once I have to migrate to silicon.
So for me a homeserver setup with spinning down disks and system shutdown (sleep is not an option as I´ve learned so far…) seems to be the way to go.

Initially I had the impression (by what I read during my investigation) that HDD spindown was not reliably available by the trueNAS OS, so I came across this thread and the spindown_timer. But as I was not able to get this running I eventually just tried the GUI provided settings for HDD Standby - and it works!

So finally (please excuse my long introduction):

Can the spindown_timer.sh be used only for the automatic shutdown based on inactivity, so that the spinndown part doesn´t interfere with the GUI HDD standby?

And if yes, how can I copy that script to my boot-pool?

My current test setup is a USB boot SSD (including system dataset) and 3x SATA 2TB HDD (only these enter standby) in one pool.
I manage to navigate around the server via ssh, but never and nowhere found the path to the boot-pool to create a scripts folder on it. Where is it located?

Sorry again for too much text for two simple questions…
 

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,142
So for me a homeserver setup with spinning down disks and system shutdown (sleep is not an option as I´ve learned so far…) seems to be the way to go.
If you shutdown your system there is no point in spinning down the drives: having the drives stop is usually done in order to limit power and noise instead of shutting down the system and thus having it ready in a few seconds. Frequently spinning down and up the drives puts them under stress, which for some users decreases the drives' lifespan.​

Initially I had the impression (by what I read during my investigation) that HDD spindown was not reliably available by the trueNAS OS, so I came across this thread and the spindown_timer. But as I was not able to get this running I eventually just tried the GUI provided settings for HDD Standby - and it works!
The script allows you to customize the spindown in many ways not possible from the WebUI (especially the spindown timer since it's apparently a bit bugged in the WebUI).​

Can the spindown_timer.sh be used only for the automatic shutdown based on inactivity, so that the spinndown part doesn´t interfere with the GUI HDD standby?
Look here.​

And if yes, how can I copy that script to my boot-pool?
[...] I manage to navigate around the server via ssh, but never and nowhere found the path to the boot-pool to create a scripts folder on it. Where is it located?
Since you have SSH it's easy, because you start in the boot-pool (under /mnt you have the other pools).
Initiate the SSH connection and use mkdir scripts for creating a folder you will put any scripts you want to use, then cd scripts in order to enter it.
Once inside use fetch https://raw.githubusercontent.com/ngandrass/truenas-spindown-timer/master/spindown_timer.sh to download the script (it should be an almost instant download); you can confirm it by using ls and finding the spindown_timer.sh in the list.
Then we give execution permissions with chmod +x spindown_timer.sh and you can now run the script using ./spindown_timer.sh if you are inside the folder or ./scripts/spindown_timer.sh if you are not inside the folder (ie when setting a Post Init command from the WebUI).
Check the GitHub page for instructions about how to use the script and how to correctly configure it to run at every startup.

Edited for insertion of the correct fetch link.
 
Last edited:
Top