How to Let Drives Spin Down

willrun4fun

Dabbler
Joined
Jan 19, 2016
Messages
29
Here is the output and log from that one:

Code:
[root@freenas ~]# ./spincheck2.sh
How many minutes do you want between spin checks?
1
Saturday, Jul 02
  ada1    ada2    ada3    ada4    Tmax Tmean             
14:08:48  STANDBY STANDBY STANDBY STANDBY ^0    0.00  ERRc=  0.00
14:09:49  STANDBY STANDBY STANDBY STANDBY ^0    0.00  ERRc=  0.00

Code:
[root@freenas ~]# cat spincheck.log
How many minutes do you want between spin checks?
Saturday, Jul 02
  ada1    ada2    ada3    ada4    Tmax Tmean             
14:08:48  STANDBY STANDBY STANDBY STANDBY ^0    0.00  ERRc=  0.00
14:09:49  STANDBY STANDBY STANDBY STANDBY ^0    0.00  ERRc=  0.00


I then ran it again with the drives spinning and got this:
Code:
[root@freenas ~]# ./spincheck2.sh
How many minutes do you want between spin checks?
5
Saturday, Jul 02
  ada1    ada2    ada3    ada4    Tmax Tmean              
14:18:57  Spin 6) ./spincheck2.sh: line 85: let: Tsum=0+6): syntax error in expression (error token is ")")
Spin 5) ./spincheck2.sh: line 85: let: Tsum=6+5): syntax error in expression (error token is ")")
Spin 0) ./spincheck2.sh: line 85: let: Tsum=11+0): syntax error in expression (error token is ")")
Spin 6) ./spincheck2.sh: line 85: let: Tsum=11+6): syntax error in expression (error token is ")")
./spincheck2.sh: line 42: printf: 6): invalid number
^6    4.25  ERRc= -29.32


Line 85
let Tsum=$Tsum+$TEMP
 
Last edited:

Glorious1

Guru
Joined
Nov 23, 2014
Messages
1,211
Sheesh! It's hard to troubleshoot a script that breaks on another system. But I suspect you're have the same issue that @meku had on the previous page of this thread. Drive manufacturers format their smartctl output differently. Apparently some have the pattern "Temp" on multiple lines. So just try changing line 75. Change grep "Temp" to grep "Temperature_Celsius".
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994

vatastala

Dabbler
Joined
Oct 9, 2014
Messages
20
Hi all, I'm going to understand how I can implement spindown on my Freenas system, It's a simple system with an Asus mobo + 4x3TB disks attached directly on the 4 sata ports. Looking at the system req, I see the following:

The first thing to know is that you can't spin down a volume that the system dataset is on. By default, this is the first volume you created. The system dataset gets written to constantly.

I don't understand what does It means, I have the Freenas os booting via USB and a ZFS Pool on my 4 disks with RaidZ-1. As you can see in files attached there's my pool and the activity of some KBs during the time in 2 of the 4 disks.

How can I manage this? I would like to have all my space of my 3x3TB available but I would like to spin down them.

Thank you
Cattura.PNG
Cattura2.PNG
 
Last edited:

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
How can I manage this?
You don't. It's a horrible idea that gets you nothing good and adds needless complexity.

In your case, you'd need to offload the system dataset to a second redundant pool. If that dataset goes down, so does your server.
 

vatastala

Dabbler
Joined
Oct 9, 2014
Messages
20
You don't. It's a horrible idea that gets you nothing good and adds needless complexity.

In your case, you'd need to offload the system dataset to a second redundant pool. If that dataset goes down, so does your server.

Thanks for the answer, but I really don't understand why I can't...consider It's not a complex server, It's a mini itx case with a mini itx mobo and 4 sata disk attached, with freenas booting via USB. I can create a configuration from scratch because all my data is backed up to another PC, so I would like to have my disks going in stand by If I don't use my NAS. Actually they don't go sleep even If I configured all the options on first page, I think that the only reason is this fact that the system dataset is on, so I moved It from the pool ( that of my 4 disks ) to my ssd boot disk, as you can see in attach.

So, because of I have all reconfigurable from scrath, can you help me to find the best configuration that permit to spindown my disks?

UPDATE: I stopped my plex media server jail and looking @the graphs there's no more activity every 5 minutes as before, so the jails for sure mantains the disks up.

So now the question is...how can I configure the plex jail to not poll my disks every 5 minutes?

Another useful information...I have 4x3TB disks on my integrated sata controller and 2x3TB disks on my PCI-E Syba SATA controller and all the disks goes to sleep :smile:
 

Attachments

  • 1.png
    1.png
    11.6 KB · Views: 433
Last edited:

Glorious1

Guru
Joined
Nov 23, 2014
Messages
1,211
So vatastala, you got it working with Plex or it's jail turned off, is that what you're saying? I can't help you with configuring Plex, I don't use it, but you could try some Plex forums or look through the settings. It's good to know you got it to work through your PCI-E card also.

I think "horrible idea" may be a bit of an overstatement. It's true most of the experts here think it does little to prolong drive lifespan, and could even reduce it, as stated in the original post.

And I don't know, but a SSD might be a more reliable place for your system dataset than a pool in Raid-Z1. But you said in the first post you were booting from USB, so I guess it must be a USB-connected SSD?
 

vatastala

Dabbler
Joined
Oct 9, 2014
Messages
20
So vatastala, you got it working with Plex or it's jail turned off, is that what you're saying? I can't help you with configuring Plex, I don't use it, but you could try some Plex forums or look through the settings. It's good to know you got it to work through your PCI-E card also.

I think "horrible idea" may be a bit of an overstatement. It's true most of the experts here think it does little to prolong drive lifespan, and could even reduce it, as stated in the original post.

And I don't know, but a SSD might be a more reliable place for your system dataset than a pool in Raid-Z1. But you said in the first post you were booting from USB, so I guess it must be a USB-connected SSD?

Yes, when I turn off Plex jail my disks goes to sleep, so there's some activity...I installed my Freenas OS in an SSD right now and moved the system-dataset on It, and I use another SSD as L2ARC...My intention is to add a third SSD ( or a 2,5 5400rpm disk ) only for PLEX, in this way I think there will be no activity on my pool.
 

toadman

Guru
Joined
Jun 4, 2013
Messages
619
Thanks for the answer, but I really don't understand why I can't...consider It's not a complex server, It's a mini itx case with a mini itx mobo and 4 sata disk attached, with freenas booting via USB.

Sure, technically, yes, you can do it. People were just advising it's not a good idea.

UPDATE: I stopped my plex media server jail and looking @the graphs there's no more activity every 5 minutes as before, so the jails for sure mantains the disks up.

So now the question is...how can I configure the plex jail to not poll my disks every 5 minutes?

Personally I don't know. I doubt it's possible to stop plex from accessing the pool where it's installed. You might check it's logging settings as perhaps the issue lies there.
 

toadman

Guru
Joined
Jun 4, 2013
Messages
619
Yes, when I turn off Plex jail my disks goes to sleep, so there's some activity...I installed my Freenas OS in an SSD right now and moved the system-dataset on It, and I use another SSD as L2ARC...My intention is to add a third SSD ( or a 2,5 5400rpm disk ) only for PLEX, in this way I think there will be no activity on my pool.

Did you do an economic model on this? Just curious. I see a couple issues:
  1. The hard drives are more likely to fail being started/stopped, and you are investing in another drive (perhaps 2) for alternate pools. So I wonder if in the long run you are not just better off letting the drives run. It's probably cheaper.
  2. There is no redundancy on your new pool(s). What happens to the Plex jail when the new SSD or 5400 drive goes down?

I hope you get it working as you wanted. I'm not saying don't do it, I am just curious about the economics. When I thought about this it didn't pencil out for me. I just leave my drives running as that was cheaper than my extra HW alternative, at least over the lifetime of the model. :)
 

vatastala

Dabbler
Joined
Oct 9, 2014
Messages
20
Did you do an economic model on this? Just curious. I see a couple issues:
  1. The hard drives are more likely to fail being started/stopped, and you are investing in another drive (perhaps 2) for alternate pools. So I wonder if in the long run you are not just better off letting the drives run. It's probably cheaper.
  2. There is no redundancy on your new pool(s). What happens to the Plex jail when the new SSD or 5400 drive goes down?

I hope you get it working as you wanted. I'm not saying don't do it, I am just curious about the economics. When I thought about this it didn't pencil out for me. I just leave my drives running as that was cheaper than my extra HW alternative, at least over the lifetime of the model. :)

Yes, I created an home NAS with economic parts like:

  • Asus Mini-itx mobo with 4 sata ports
  • Extra 4 sata porta with a Syba PCI-e card
  • RAM 16GB non-ECC
  • 6x3TB disks in RaidZ-1
  • 1 SSD OS disk
  • 1 SSD L2ARC
I understand and have read about the fact that spinning down the disks is not crucial, but intend...when they spun down I see a consumption ~20/25w less on my APC, so If I install Plex on a disk that can fail ( sometimes I can backup Plex library ) and without affecting my pool, but only when I need to watch a movie, for me is better. I don't have my pool mounted via smb in my main PC but I read data as network share, and I saw that in this way there's no wake up...for the rest, there's no other service or process that wake up my disks, so at the end I think without doubt that my solution is cheaper :)

Also, 3 of my 6 disks are very old, they where installed in a WD nas that for sure stopped these disks many many times, If you look at the file attached I have a disks with 1900days and more that 16.000 start/stop operation

UPDATE: analyzing the crontab inside my Plex jail, I found the problem that wakeuop my disks every 5 minutes, so I moved the activity every 8 hours and that's It, no more 2,5 disk is necessary for plex and everything is going fine, If I don't watch movies my disks wake up only 3 times x day :smile: Very happy for this...
 

Attachments

  • Cattura.PNG
    Cattura.PNG
    77.1 KB · Views: 426
Last edited:
Joined
Dec 2, 2015
Messages
730
I understand and have read about the fact that spinning down the disks is not crucial, but intend...when they spun down I see a consumption ~20/25w less on my APC
How much does electricity cost where you live? In many places, the electricity cost has a fixed component (that is constant no matter how much you use) + a cost per kWh used (this is the portion of the bill that varies depending on how much is used).
 

vatastala

Dabbler
Joined
Oct 9, 2014
Messages
20
How much does electricity cost where you live? In many places, the electricity cost has a fixed component (that is constant no matter how much you use) + a cost per kWh used (this is the portion of the bill that varies depending on how much is used).

Hi, my media consumption per Kw is near 0,23€, so finally in this way I can take more coffe every year :smile:
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
That is under the mistaken belief that you wouldn't have to replace the disk sooner, wiping out the savings.
 
Joined
Dec 2, 2015
Messages
730
Hi, my media consumption per Kw is near 0,23€, so finally in this way I can take more coffe every year :)
I assume the 0,23€ is for one KW, for one hour (the usual way to describe costs, and in line with costs in Europe).

If the power reduction is 20W, 24 hours per day, that works out to about 40€ per year. How much would it cost to replace 6 x 3TB drives, if they have a shorter life because of this?
 

vatastala

Dabbler
Joined
Oct 9, 2014
Messages
20
I assume the 0,23€ is for one KW, for one hour (the usual way to describe costs, and in line with costs in Europe).

If the power reduction is 20W, 24 hours per day, that works out to about 40€ per year. How much would it cost to replace 6 x 3TB drives, if they have a shorter life because of this?

Mmmm at the moment I want to experiment this, because as I said before:

Also, 3 of my 6 disks are very old, they where installed in a WD nas that for sure stopped these disks many many times, If you look at the file attached I have a disks with 1900days and more that 16.000 start/stop operation

So, If I have disks that after ~6 years works, considering that I buy 3TB disks ~67€, maybe there's an improvement in costs, maybe not, maybe is the same, but I hear less less noise, the temperatures are low and at the moment I'm happy this way :smile:

Thank you very much for your answers and considerations, I like to share my experiences in this forum
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
and I use another SSD as L2ARC...My intention is to add a third SSD ( or a 2,5 5400rpm disk ) only for PLEX, in this way I think there will be no activity on my pool.
Not sure what you expect the L2ARC to do for you, can you explain the benefit you think or have proven to obtain from adding an L2ARC?

Also, glad to see you figured out how to sleep your drives, but I'm not certain it is the best move but I gues it's really up to the user. I know I played with sleeping drives for a while but my old WD Red have been running for over 5 years non-stop, I just can't aregue with those results. I moved the Reds into a secondary NAS box when I replaced them with other drives that are okay, just hope they last as long.
 

vatastala

Dabbler
Joined
Oct 9, 2014
Messages
20
Not sure what you expect the L2ARC to do for you, can you explain the benefit you think or have proven to obtain from adding an L2ARC?

Also, glad to see you figured out how to sleep your drives, but I'm not certain it is the best move but I gues it's really up to the user. I know I played with sleeping drives for a while but my old WD Red have been running for over 5 years non-stop, I just can't aregue with those results. I moved the Reds into a secondary NAS box when I replaced them with other drives that are okay, just hope they last as long.

About L2ARC, I have It working on a 120GB SSD from different months and I see the benefit in terms of minor accesses to the disks, infact using Plex I can see by the graphs that data is moved from disks to RAM and L2ARC and It plays for example 4K video smoother than a configuration without L2ARC.

For the rest agree with you, is up to the user and for me the actual configuration is very good
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
and It plays for example 4K video smoother than a configuration without L2ARC.
And that is why I asked, I'm glad you have seen a benefit to running it otherwise if you hadn't then everyone would have advised you to remove it. Most of the time people use an L2ARC incorrectly and plug it in thinking it will make up for a RAM shortage and it really doesn't, it just adds a minor delay to data retrieval that typically can only be seen in a test environment.
 
Top