Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Change Default Spin Down Delay from shell script

Featured Replies

Does anyone know if it’s possible to change the Default Spin Down Delay from shell script.  I would like to use User Scripts so I can have different values at night and during the day.

Solved by strike

  • Author
41 minutes ago, strike said:

That should be possible, you can maybe use this script or modify it to your needs: https://forums.unraid.net/topic/106508-advanced-disk-spindown/

 

Thanks.  I was hoping for a much simpler solution, a way to change the value of Settings | Disk Settings | Default Spindown Delay

  • Community Expert

The script has an option to do that: 
 

# set to "1" to enable spindown timer through "smartctl -s standby,241 /dev/sdb". "241" means 30 minutes
advanced_spindown=0

 

Or you can have two scripts running just that command if you don't want the rest of the script, one at day and one at night. Just adjust the timer to what you want and add the disks. Now, why "241" means 30 min I don't know. Haven't look that one up. 

  • Community Expert

On second thought, it would be best if you run the script I linked in my first post as it says in the description that the status isn't always right. Reporting standby while it's spinning etc. The script accounts for that.

  • Community Expert

Btw if you're not that familiar with running script this scripts has 3 settings you can turn on/off:

 

# ######### Settings ##################

# set to "1" to enable spinning down disk if power mode is IDLE_A
idle_b_spindown=1

# set to "1" to enable spinning down disk if power mode is IDLE_B
idle_c_spindown=1

# set to "1" to enable spindown timer through "smartctl -s standby,241 /dev/sdb". "241" means 30 minutes
advanced_spindown=0


So you want to set the fist two to 0 and the last one to 1 and just adjust the timer (241, which means 30 min) So you need to find the correct value for the timeer. Then you set up two scripts in userscripts. One to run at night and one during the day, with the timer you want. This scripts does exactly want you want.

Edited by strike

  • Author

@strike, your missing the difference between what the script does, and what unraid does.  The script forces a spin down, possibly on a timer delay.  Unraid waits an amount of time after the last observed activity on the disk.  What I'd like to implement is a spin down delay of Never during the day, and 15 minutes after the last observed disk activity at night.

  • Community Expert
  • Solution
6 minutes ago, aim60 said:

Unraid waits an amount of time after the last observed activity on the disk.

I don't see what I'm missing. The script does that too.. This is from the hdparm manual:

-S Put the drive into idle (low-power) mode, and also set the standby (spindown) timeout for the drive. This timeout value is used by the drive to determine how long to wait (with no disk activity) before turning off the spindle motor to save power. Under such circumstances, the drive may take as long as 30 seconds to respond to a subsequent disk access, though most drives are much quicker. The encoding of the timeout value is somewhat peculiar. A value of zero means "timeouts are disabled": the device will not automatically enter standby mode. Values from 1 to 240 specify multiples of 5 seconds, yielding timeouts from 5 seconds to 20 minutes. Values from 241 to 251 specify from 1 to 11 units of 30 minutes, yielding timeouts from 30 minutes to 5.5 hours. A value of 252 signifies a timeout of 21 minutes. A value of 253 sets a vendor-defined timeout period between 8 and 12 hours, and the value 254 is reserved. 255 is interpreted as 21 minutes plus 15 seconds. Note that some older drives may have very different interpretations of these values.

SO then you set the first script with a value 0 and in the unraid disk settings you set never spin down. and run it at 7am. Disks will not spin down until you run the second second script (at 1am? or something) with the correct value that (whatever value 15 min is, do the math yourself). 

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...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.