HDD Spindown Timer

HDD Spindown Timer 2.2.0

ngandrass

Explorer
Joined
Jun 26, 2019
Messages
68
Here it the warning... Pay attention to your Load_Cycle_Count and Start_Stop_Count on your hard drive. [...] My personal opinion (just my opinion) is if the head load count is more than 12 in 24 hours then that is too high, and if the motor start count increases more than 5 in 24 hours, that too is too high.

So if you look at these values and you feel they are climbing faster than you would like, examine the settings you have set in the script because it appears that the script is well written and does what it claims, but you have to be smart enough to know how to setup the script to not cause more damage than the benefits gained.

I can only strongly second this! This script is clearly targeted at small home systems that are idle most of the time. Please don't apply this technique in a mid to large scale deployment.

Thanks @joeschmuck for emphasizing this again!

For my part: I spin down the drives of my "colder" storage array containing data such as backups (only updated once nightly).
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
For my part: I spin down the drives of my "colder" storage array containing data such as backups (only updated once nightly).
I agree with certain applications of spinning down drives but the system must be setup correctly to inhibit frequent spinups, and done properly as I suspect you have done, it can benefit a person. I didn't mean to rain on your thread, I just wanted to ensure that people verify if they are benefiting from sleeping drives and not causing an early death of those drives.

Thanks for your thread, it is good work.
 

GreaseMonkey88

Dabbler
Joined
Dec 8, 2019
Messages
27
Will your script work on TrueNAS 12 CORE?

I don´t see the "Standby" option under SMART service configuration. Will that be problem?

FreeNAS 11.3
SMART Service.png


TrueNAS 12 RC1
Bildschirmfoto 2020-09-15 um 22.35.28.png
 

ngandrass

Explorer
Joined
Jun 26, 2019
Messages
68
Will your script work on TrueNAS 12 CORE?

I don´t see the "Standby" option under SMART service configuration. Will that be problem?

Unfortunately I haven't been able to test it yet. In your case I'd just give it a try on TrueNAS 12 CORE without the power mode explicitly specified.

It would be very appreciated if you could report whether it works on the new version or not. Thanks :)
 

MikeyG

Patron
Joined
Dec 8, 2017
Messages
442
I've been using it on 12 beta 2 for a few weeks. I'm pretty sure it's working correctly.
 

GreaseMonkey88

Dabbler
Joined
Dec 8, 2019
Messages
27
I have the script running for almost 24h now and so far I have only seen 1 or 2 "unscheduled" spin-ups. One seemed to be exactly at midnight.
 

ngandrass

Explorer
Joined
Jun 26, 2019
Messages
68
I've been using it on 12 beta 2 for a few weeks. I'm pretty sure it's working correctly.
Awesome! Thanks for reporting.

I have the script running for almost 24h now and so far I have only seen 1 or 2 "unscheduled" spin-ups. One seemed to be exactly at midnight.
Can you determine the cause of the spin-ups? I don't have a TrueNAS 12 instance running at the moment and therefore can't investigate... I hope to find some time in the next weeks, at the latest when it is officially released :)
 

GreaseMonkey88

Dabbler
Joined
Dec 8, 2019
Messages
27
Actually I have no idea where to look at what caused the spin-up. :smile: Are there any logs I could send you?
 

ngandrass

Explorer
Joined
Jun 26, 2019
Messages
68
Actually I have no idea where to look at what caused the spin-up. :smile: Are there any logs I could send you?
Unfortunately I know of no logs that explicitly indicate the service that caused the disk to spin up.

However: I just uploaded the script that I use to monitor spindowns on my system. Maybe this already helps you to pinpoint the problem:

EDIT: As I think about it... A possible (and totally valid) wakeup cause may also be a ZFS scrub :)
 
Last edited:

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
@GreaseMonkey88 while you could be running a perfectly fine FreeNAS VM, it is possible that VMWare woke the drives, but my first thought is FreeNAS woke them during routine maintenance since it was at midnight. Or, something on your LAN accessed it. I'm a little bit curious what the cause was.
 

GreaseMonkey88

Dabbler
Joined
Dec 8, 2019
Messages
27
@joeschmuck
- In FreeNAS 11.3 the script was working fine. So something must be different in TrueNAS 12 RC1.
- I have the SATA controller passed through to the VM, so ESXi should not be able to wake the drives or do anything to them.
- Nothing in my network accesses this particular disk, which is only used for backup via replication task.

@ngandrass
- I installed your monitoring script. I'll wait until the weekend to gather some data and look into the log then.
- There was no scheduled scrub running, but good hint!
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
In FreeNAS 11.3 the script was working fine. So something must be different in TrueNAS 12 RC1.
I have to agree with your logic, odds are TrueNAS 12 RC1 is causing the spin up operation. I suspect that TrueNAS was originally designed with the corporate user in mind and thus sleeping hard drives was never considered when coding, meaning that if the system wanted to poll the pool or hard drives just for the heck of it, they did it. I wouldn't be surprised if FreeNAS was adjusted a bit to make some people happy. Just a guess on my part, I honestly do not know for certain. And if TrueNAS code is the culprit, would iXsystems be willing to change the code? Probably but it could take time.

If your drives only spin up at midnight (without outside query) then you could adjust the script to perform a daily SMART test to take advantage of the spinup. It there any other positive spin (ha ha) that could be put on this? I'm just providing food for thought.
 

GreaseMonkey88

Dabbler
Joined
Dec 8, 2019
Messages
27
Short update: I still have some "unscheduled" spin-ups, but some of them might be triggered from a replication task not setup correctly. I changed that specific replication task and will further investigate.
 

GreaseMonkey88

Dabbler
Joined
Dec 8, 2019
Messages
27
The script seems to work quite well. Since October 6 I had only four spin-ups, of which two were scheduled. The other two were on each of the two scheduled days. Maybe there's a connection...
I will make further tests once the next TrueNAS release is released.
 

blemasle

Dabbler
Joined
Mar 1, 2021
Messages
13
Hi,

I'm trying to use your script which fits my use case perfectly. Sadly, the drives are spinning up from a few seconds to no more than a minute after spinning down.

I'm running the script in a terminal for debugging purpose right now, and the system dataset is on another pool.

I noticed that disabling S.M.A.R.T. in the drives configuration does prevent them from spinning up. I thought the script was especially made to prevent S.M.A.R.T. reading from waking the drives ?

By the way, I'm running on TrueNAS 12.0-U2.1

Thanks
 
Top