[Plugin] Spin Down SAS Drives


doron

Recommended Posts

On 6/22/2022 at 5:47 PM, doron said:

Very good. Now let's hope @bonienl considers adding the code fix into the plugin.

Hey doron, it might be that the plug-in won't get updated as it's been about 2 years since.

 

I might do a script to automate the process. I've already used the User Scripts plug-in to do the cp/chmod part. Is there a way to toggle the fans disabled/enabled in cli or will this need to be done manually via gui?

 

Cheers

Link to comment
3 hours ago, SimonF said:

can you run sdparm -C sense /dev/sdx with the correct drive for the 3 WDCs once you think the drives are spun down?

 

or you can do smartctl -n standby /dev/sdx

 

 

What output to you get?

:~# sdparm -C sense /dev/sdr
    /dev/sdr: WD        WDC WD3001FYYG-0  VR02
Additional sense: Standby condition activated by command

:~# smartctl -n standby /dev/sdr
SAS Assist Plugin: /dev/sdr is in standby mode (spun down), smartctl exits(2)

So they are spun down if I understand correctly? 

Is it then normal for the disk activity LED's to stay lit continuously?

 

For all the other disks they turn off, that was why I was so confused...

Link to comment
33 minutes ago, jeffrey.el said:
:~# sdparm -C sense /dev/sdr
    /dev/sdr: WD        WDC WD3001FYYG-0  VR02
Additional sense: Standby condition activated by command

:~# smartctl -n standby /dev/sdr
SAS Assist Plugin: /dev/sdr is in standby mode (spun down), smartctl exits(2)

So they are spun down if I understand correctly? 

Is it then normal for the disk activity LED's to stay lit continuously?

 

For all the other disks they turn off, that was why I was so confused...

Yes that is the result I expect from the system commands. Not sure why the LED is still lit, are other devices SATA? 

 

What are you using for the enclosure/server?

Link to comment
2 hours ago, DavidNguyen said:

I might do a script to automate the process. I've already used the User Scripts plug-in to do the cp/chmod part. Is there a way to toggle the fans disabled/enabled in cli or will this need to be done manually via gui?

Try this:

/etc/rc.d/rc.autofan restart

 

Link to comment
7 hours ago, SimonF said:

Yes that is the result I expect from the system commands. Not sure why the LED is still lit, are other devices SATA? 

 

What are you using for the enclosure/server?

 

Yes the other devices are all SATA.

 

As a case I'm using an Inter-Tech 4U 4424: https://www.inter-tech.de/en/products/ipc/storage-cases/4u-4424

It has a built in SAS backplane.

Edited by jeffrey.el
Link to comment
On 7/7/2022 at 7:38 AM, drc13 said:

Hi

Hopefully this is the correct thread to ask for advice.

I currently have a 11 disk array with a combination of SATA and SAS drives. Spin down works perfectly except for any SAS drives with model number ST2000NM0001 they won't spin down when triggered either automatically or manually. All my other SATA and SAS drives spin down and stay spun down perfectly using this plugin.

I replaced 2 of the ST2000NM0001 with alternate drives and they immediately worked with spinning down so I now have 1 remaining ST2000NM0001 that is the only drive in my array spinning permanently

With some guidance I'm open to doing some troubleshooting and I've attached the diagnostics log.

Thanks in advance

tower-diagnostics-20220707-0727.zip 139 kB · 0 downloads

Any advice guys? All drives bar this one spin down and stay spun down

Link to comment
5 hours ago, drc13 said:

Any advice guys? All drives bar this one spin down and stay spun down

Not much except that per your findings, ST2000NM0001 seems to not honor the "spin down" (standby) command. 

As discussed in this thread, unfortunately not all drives / controllers handle this instruction the same way. Some do the right thing, some spin it down and require an explicit "wake up" instruction (resulting in red-x in Unraid systems), and some just ignore it.

 

If you want to run a test, then assuming the HDD is /dev/sdx, try this:

 

sg_start -rp3 /dev/sdx && sleep 1s && sdparm -C sense /dev/sdx

 

Let us know what you get on output.

Link to comment
15 hours ago, doron said:

There's a chance it has to do with the enclosure / backplane/ controller.
I'd check whether there's updated firmware for either. Long shot but worth a search.

Sent from my tracking device using Tapatalk
 

Nah it's alright :)

At least I now know they are actually spun down.

I just also noticed that when I stop the array all disk LED Indicators turn off except those, so it's probably nothing.

Link to comment

Hi, noob here! I have 4 SAS drives that are unassigned and in reserve in my system. On boot, these 4 drives all spin up. I have this plugin installed and can manually spin them down just fine. However, I would like these drives to automatically spin down whenever my system boots. I was thinking a script at boot would be a good option here, but I can't seem to figure out a spin down command that works.

 

I have tried "sg_start -S /dev/sdx" in the console as a test on a drive that is spun up, but that doesn't seem to spin down the drive.

 

Any tips? Sorry if this isn't necessarily related to the plugin!

Link to comment
4 minutes ago, CheeseJam said:

Hi, noob here! I have 4 SAS drives that are unassigned and in reserve in my system. On boot, these 4 drives all spin up. I have this plugin installed and can manually spin them down just fine. However, I would like these drives to automatically spin down whenever my system boots. I was thinking a script at boot would be a good option here, but I can't seem to figure out a spin down command that works.

 

I have tried "sg_start -S /dev/sdx" in the console as a test on a drive that is spun up, but that doesn't seem to spin down the drive.

 

Any tips? Sorry if this isn't necessarily related to the plugin!

you can run sdspin sdx down or sdspin sdx up. Which vers of OS are you on as in 6.9.2+ the UD devices should spin down automatically.

 

if you want to use sg_start

 

sg_start  --readonly --pc=3 /dev/sdx

 

pc is the power condition. 1 is active, 3 is standby.

 

image.png.760bd3ab8e8ac61ec096796fd20ec911.png

Edited by SimonF
  • Like 1
Link to comment
8 minutes ago, SimonF said:

you can run sdspin sdx down or sdspin sdx up.

Thanks for the suggestion! When I run this command ("sdspin sdx down") on a spun up device, my log shows this: "SAS Assist v2022.05.25: Spinning down device /dev/sdx"

 

However, the disk doesn't seem to actually spin down. It still shows up as green and with a temperature reading (the spun down devices do not seem to give a temperature reading, which makes sense to me). I attached a picture of what it looks like after trying that command on two of my drives (sdd and sde). 

 

The "sdspin sdx up" command works correctly. Any idea what's going on?

Screenshot from 2022-07-16 08-10-44.png

Link to comment
15 minutes ago, CheeseJam said:

Thanks for the suggestion! When I run this command ("sdspin sdx down") on a spun up device, my log shows this: "SAS Assist v2022.05.25: Spinning down device /dev/sdx"

 

However, the disk doesn't seem to actually spin down. It still shows up as green and with a temperature reading (the spun down devices do not seem to give a temperature reading, which makes sense to me). I attached a picture of what it looks like after trying that command on two of my drives (sdd and sde). 

 

The "sdspin sdx up" command works correctly. Any idea what's going on?

Screenshot from 2022-07-16 08-10-44.png

Sorry forgot that the GUI wouldnt know its spun down, let me see if I can find the option cmd to doit.

 

But they should spindown after the spindown timer. You can set individual ones per disk also

  • Like 1
Link to comment
13 minutes ago, SimonF said:

Sorry forgot that the GUI wouldnt know its spun down, let me see if I can find the option cmd to doit.

 

But they should spindown after the spindown timer. You can set individual ones per disk also

Ahh okay, so they are actually spun down, the GUI just isn't reporting it?

 

I just saw your edit and had the same results using sg_start. 

 

I am on Unraid 6.10.3. My entire array is SAS drives (all of the drives are periodically accessed throughout the day), and I was under the impression it is best to not repeatedly spin SAS drives up/down, so I have my default spin down delay set to "never" in my disk settings. Should I not be doing this? I am able to override this spin down delay on disks in my array, however, I do not see this option on any of my unassigned devices.

Edited by CheeseJam
Link to comment
11 minutes ago, CheeseJam said:

Ahh okay, so they are actually spun down, the GUI just isn't reporting it?

 

I just saw your edit and had the same results using sg_start. 

 

I am on Unraid 6.10.3. My entire array is SAS drives (all of the drives are periodically accessed throughout the day), and I was under the impression it is best to not repeatedly spin SAS drives up/down, so I have my default spin down delay set to "never" in my disk settings. Should I not be doing this? I am able to override this spin down delay on disks in my array, however, I do not see this option on any of my unassigned devices.

I spin down all of my SAS drives, but its only on a test system. But others do on their main ones.

 

Command to spin down is below but you have to use the unraid name i.e. dev1 dev2 dev3 and dev4 in your case. But they can change i.e. if you had a usb device connected a boot etc.

 

in /usr/local/sbin is emcmd

emcmd "cmdSpindown="

emcmd "cmdSpinup="

 

Ok, didnt know you cannot set UD individual spin down timers. 

 

Other option is to set default  spindown at xxmins, and set all your array drives to never, not an elegant solution.

  • Like 1
Link to comment
1 minute ago, SimonF said:

I spin down all of my SAS drives, but its only on a test system. But others do on their main ones.

 

Command to spin down is below but you have to use the unraid name i.e. dev1 dev2 dev3 and dev4 in your case. But they can change i.e. if you had a usb device connected a boot etc.

 

in /usr/local/sbin is emcmd

emcmd "cmdSpindown="

emcmd "cmdSpinup="

 

Ok, didnt know you cannot set UD individual spin down timers. 

 

Other option is to set default  spindown at xxmins, and set all your array drives to never, not an elegant solution.

Thank you so much! Actually, your last suggestion is a great idea (even though it is not super elegant haha). I will just do that, thanks for your help!

  • Like 1
Link to comment
  • 4 weeks later...

Hi all,

Similar issue here, my 8 SAS drives spin back up immediately after spin-down. Getting the below both when manually or automatically spun down.

Aug 12 01:45:25 MKRAID emhttpd: spinning down /dev/sdh
Aug 12 01:45:25 MKRAID SAS Assist v2022.08.02: Spinning down device /dev/sdh
Aug 12 01:45:25 MKRAID emhttpd: read SMART /dev/sdh

 

So had the SAS plugin installed since it's early days. It didn't work at the time so left it alone until a few days ago.

 

  • A few days ago tested out manual spin down and it worked mostly fine but had a few things that had to be moved to cache pool to prevent drives spinning up unnecessarily.
  • While was doing that decided to add another HBA and add some more SAS drives to the array on that HBA...... also installed Dynamix Autofan ..... realised the drives no longer spin down and the additional HBA consumes about 50W by itself..... Removed new unmapped drives and the HBA.
  • Restarted, spin-down still not working....
  • Shutdown all Docker containers. Same Issue.
  • After some digging discovered that Dynamix Autofan can mess with the spin-down....
  • Tried the custom file for autofan that supposedly fixes it from earlier in the thread,  still no luck. Nuked Dynamix Autofan... same problem.
  • Found info somewhere on this forum that adding blank slots with unassigned devices to the array will prevent spin-down. Stopped the array and removed blank slots with unassigned devices that I added earlier when was planning on adding more drives. Same issue.
  • Tried the wrapper for smartctl from earlier in the thread... it only gets me as far as emhttpd
Aug 12 02:19:27 MKRAID emhttpd: spinning down /dev/sdl
Aug 12 02:19:27 MKRAID SAS Assist v2022.08.02: Spinning down device /dev/sdl
Aug 12 02:19:28 MKRAID emhttpd: read SMART /dev/sdl
Aug 12 02:19:28 MKRAID smartctl wrappper[7713]: Caller is smartctl_type, grandpa is emhttpd, args "-A /dev/sdl"
Aug 12 02:19:28 MKRAID smartctl wrappper[7713]: stdin passed "", hex ""
Aug 12 02:19:28 MKRAID smartctl wrappper[7713]: RC=0
  • Restored to an Unraid flash backup from a day before, when spin-down worked. Same issue.
  • Nuked all Dynamix utilities. Same issue.
  • Nuked most of the other plugins, only have Community Applications, Spin Down SAS Drives, User Scripts (no scripts scheduled to run or active), Same issue.
  • Added a SATA drive to the array, paused DISK-CLEAN, spin-down works fine on that SATA Drive.  (it is still being prepped so not fully part of the array, so the test is not 100% conclusive)
  • Switched from UEFI to Legacy boot to test things out. Same Result.

 

 

P.S. I may have updated the Spin Down SAS Drives plugin when I was adding drives.

 

My Drives are SEAGATE ST320004CLAR2000 BS17

The HBA is SAS9205-8i rebranded by HP it is in IT mode

Unraid is 6.10.3

 

Diag is attached bellow, hope the devs can help :)

mkraid-diagnostics-20220812-0308.zip

Edited by Strider27
Link to comment
3 hours ago, Strider27 said:

Hi all,

Similar issue here, my 8 SAS drives spin back up immediately after spin-down. Getting the below both when manually or automatically spun down.

Aug 12 01:45:25 MKRAID emhttpd: spinning down /dev/sdh
Aug 12 01:45:25 MKRAID SAS Assist v2022.08.02: Spinning down device /dev/sdh
Aug 12 01:45:25 MKRAID emhttpd: read SMART /dev/sdh

 

So had the SAS plugin installed since it's early days. It didn't work at the time so left it alone until a few days ago.

 

  • A few days ago tested out manual spin down and it worked mostly fine but had a few things that had to be moved to cache pool to prevent drives spinning up unnecessarily.
  • While was doing that decided to add another HBA and add some more SAS drives to the array on that HBA...... also installed Dynamix Autofan ..... realised the drives no longer spin down and the additional HBA consumes about 50W by itself..... Removed new unmapped drives and the HBA.
  • Restarted, spin-down still not working....
  • Shutdown all Docker containers. Same Issue.
  • After some digging discovered that Dynamix Autofan can mess with the spin-down....
  • Tried the custom file for autofan that supposedly fixes it from earlier in the thread,  still no luck. Nuked Dynamix Autofan... same problem.
  • Found info somewhere on this forum that adding blank slots with unassigned devices to the array will prevent spin-down. Stopped the array and removed blank slots with unassigned devices that I added earlier when was planning on adding more drives. Same issue.
  • Tried the wrapper for smartctl from earlier in the thread... it only gets me as far as emhttpd
Aug 12 02:19:27 MKRAID emhttpd: spinning down /dev/sdl
Aug 12 02:19:27 MKRAID SAS Assist v2022.08.02: Spinning down device /dev/sdl
Aug 12 02:19:28 MKRAID emhttpd: read SMART /dev/sdl
Aug 12 02:19:28 MKRAID smartctl wrappper[7713]: Caller is smartctl_type, grandpa is emhttpd, args "-A /dev/sdl"
Aug 12 02:19:28 MKRAID smartctl wrappper[7713]: stdin passed "", hex ""
Aug 12 02:19:28 MKRAID smartctl wrappper[7713]: RC=0
  • Restored to an Unraid flash backup from a day before, when spin-down worked. Same issue.
  • Nuked all Dynamix utilities. Same issue.
  • Nuked most of the other plugins, only have Community Applications, Spin Down SAS Drives, User Scripts (no scripts scheduled to run or active), Same issue.
  • Added a SATA drive to the array, paused DISK-CLEAN, spin-down works fine on that SATA Drive.  (it is still being prepped so not fully part of the array, so the test is not 100% conclusive)
  • Switched from UEFI to Legacy boot to test things out. Same Result.

 

 

P.S. I may have updated the Spin Down SAS Drives plugin when I was adding drives.

 

My Drives are SEAGATE ST320004CLAR2000 BS17

The HBA is SAS9205-8i rebranded by HP it is in IT mode

Unraid is 6.10.3

 

Diag is attached bellow, hope the devs can help :)

mkraid-diagnostics-20220812-0308.zip 163.87 kB · 0 downloads

Have you tried installing the file activity plugin to see if files are be written changed on those drives.

Link to comment
6 hours ago, Strider27 said:

Similar issue here, my 8 SAS drives spin back up immediately after spin-down. Getting the below both when manually or automatically spun down.

 

Just to make sure, can you start your server without plugins "Network Stats" and "Recycle Bin" and see if the issue persists?

Link to comment

@SimonF Yes, I tried several, "Active Streams", "File Activity" and "Open Files". The first two showed nothing, "Open Files" showed a large list including docker etc. which live on the cache drive anyway, disabled Docker and VM manager. Was only getting "find" popping up every 10 secs or so, disabled "Dynamix Cache Directories", "find" stopped popping up, nothing else in the list, still same issue.

 

@doron Removed both plugins as well as Dynamix System Stats and rebooted, same issue.

 

Every time a drive tries to spin down, there is a tiny read from that drive that wakes it up, it is like something is monitoring the drives and spins them up if they try to spin down.

The SATA drive is now fully provisioned and is in the same array, seems to spin down no problem (no files on it yet though)

 

Selected New Config and removed the array, drives would not spin down when in unassigned devices list either.

 

EDIT:

installed iotop + python 2.7  (needed for iotop)

Stopped docker, when spinning down drives, no IO at all in iotop, in GUI shows either 7.9 kb/s or 4.8 kb/s every time I try to spin down manually.

 

EDIT 2:

Started randomly working but not all drives can be spun down. 3 left that can't spin down... only thing that changed is I installed Dynamix SCSI Devices at some point in the last few hours (tested  spin down immediately after installing and configuring it, didn't work at the time) . And the server has been up for a few hours without me rebooting for testing.

Edited by Strider27
Link to comment
  • 2 weeks later...
On 8/12/2022 at 4:38 AM, Strider27 said:

@SimonF Yes, I tried several, "Active Streams", "File Activity" and "Open Files". The first two showed nothing, "Open Files" showed a large list including docker etc. which live on the cache drive anyway, disabled Docker and VM manager. Was only getting "find" popping up every 10 secs or so, disabled "Dynamix Cache Directories", "find" stopped popping up, nothing else in the list, still same issue.

 

@doron Removed both plugins as well as Dynamix System Stats and rebooted, same issue.

 

Every time a drive tries to spin down, there is a tiny read from that drive that wakes it up, it is like something is monitoring the drives and spins them up if they try to spin down.

The SATA drive is now fully provisioned and is in the same array, seems to spin down no problem (no files on it yet though)

 

Selected New Config and removed the array, drives would not spin down when in unassigned devices list either.

 

EDIT:

installed iotop + python 2.7  (needed for iotop)

Stopped docker, when spinning down drives, no IO at all in iotop, in GUI shows either 7.9 kb/s or 4.8 kb/s every time I try to spin down manually.

 

EDIT 2:

Started randomly working but not all drives can be spun down. 3 left that can't spin down... only thing that changed is I installed Dynamix SCSI Devices at some point in the last few hours (tested  spin down immediately after installing and configuring it, didn't work at the time) . And the server has been up for a few hours without me rebooting for testing.

I have the same issue from what I noticed its when the drive are commanded to shutdown then  I get this in the log that seems to wake up the drive:

 

emhttpd: read SMART /dev/sdm

 

Not sure why it triggers to read the SMART on the drive after its spundown.

Link to comment
52 minutes ago, wallacearizona said:

I have the same issue from what I noticed its when the drive are commanded to shutdown then  I get this in the log that seems to wake up the drive:

 

emhttpd: read SMART /dev/sdm

 

Not sure why it triggers to read the SMART on the drive after its spundown.

that is in the logs why unraid detects the drive being spun up. do you have file activy plugin to see any activity?

Link to comment
21 hours ago, wallacearizona said:

I have the same issue from what I noticed its when the drive are commanded to shutdown then  I get this in the log that seems to wake up the drive:

 

emhttpd: read SMART /dev/sdm

 

Not sure why it triggers to read the SMART on the drive after its spundown.

Unraid only issues that command if it thinks the drive is NOT spundown.

Link to comment

I have been having this issue but with my SATA drives.

 

I have 4 SATA and one SAS all off the same HBA card.

 

This 'app' actually keeps my SAS spun down it is only my SATA's that are getting spun back up with the same SMART trigger.

 

Could it be a HBA issue with Unraid?

 

I am no expert in any of this by the way. I entirely rely on the forums and great vids on youtube to set up my Unraid. 

Aug 29 08:16:23 TheEntertainer emhttpd: spinning down /dev/sde
Aug 29 08:19:19 TheEntertainer emhttpd: read SMART /dev/sde
Aug 29 08:30:25 TheEntertainer emhttpd: spinning down /dev/sde
Aug 29 08:34:16 TheEntertainer emhttpd: read SMART /dev/sde
Aug 29 08:57:36 TheEntertainer emhttpd: spinning down /dev/sde
Aug 29 09:06:51 TheEntertainer emhttpd: read SMART /dev/sde
Aug 29 09:21:43 TheEntertainer emhttpd: spinning down /dev/sde
Aug 29 09:28:51 TheEntertainer emhttpd: read SMART /dev/sde

 

Link to comment
6 hours ago, Dustiebin said:

I have been having this issue but with my SATA drives.

 

I have 4 SATA and one SAS all off the same HBA card.

 

This 'app' actually keeps my SAS spun down it is only my SATA's that are getting spun back up with the same SMART trigger.

 

Could it be a HBA issue with Unraid?

 

I am no expert in any of this by the way. I entirely rely on the forums and great vids on youtube to set up my Unraid. 

Aug 29 08:16:23 TheEntertainer emhttpd: spinning down /dev/sde
Aug 29 08:19:19 TheEntertainer emhttpd: read SMART /dev/sde
Aug 29 08:30:25 TheEntertainer emhttpd: spinning down /dev/sde
Aug 29 08:34:16 TheEntertainer emhttpd: read SMART /dev/sde
Aug 29 08:57:36 TheEntertainer emhttpd: spinning down /dev/sde
Aug 29 09:06:51 TheEntertainer emhttpd: read SMART /dev/sde
Aug 29 09:21:43 TheEntertainer emhttpd: spinning down /dev/sde
Aug 29 09:28:51 TheEntertainer emhttpd: read SMART /dev/sde

 

Do you have the file activity plugin installed, as it may be bale to show what you have sde which is being accessed. 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.