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.

Spin down non-array drive automatically

Featured Replies

Hi guys,

 

I've added an IDE drive to use for SABnzb downloads (which I then move to the correct share on my array later).

 

However this drive never spins down automatically. I assume unRAID only manages drives in it's array, though I can spin it down manually from the unRAID interface.

 

Is there are way to make it spin down automatically when not in use?

 

Thanks,

 

Justin

  • Author

I'm running 4.5.3 btw, but there doesn't seem to be a forum for that version :)

this drive never spins down automatically.

Is there are way to make it spin down automatically when not in use?

You can tell the disk to use its own spindown timer.  Put this in your 'go' script:

hdparm -S241 /dev/hdX

(replace 'hdX' with your disk name)

---

http://linux.die.net/man/8/hdparm

 

Hi guys,

 

I've added an IDE drive to use for SABnzb downloads (which I then move to the correct share on my array later).

 

However this drive never spins down automatically. I assume unRAID only manages drives in it's array, though I can spin it down manually from the unRAID interface.

 

Is there are way to make it spin down automatically when not in use?

 

Thanks,

 

Justin

You can type the following command:

 

hdparm -S242 /dev/hdX

where hdX = the device name of your IDE drive.

the -S option is used to set the spindown of a drive. 242 represents a hour timeout.

 

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

  • Author

I'd actually tried something similar but it didn't work. I've just done:

 

root@Tower:~# hdparm -S10 /dev/hda

 

/dev/hda:

setting standby to 10 (50 seconds)

 

But 2 minutes later unMenu is still reporting the disk as spun up. Is there a chance my disk doesn't support this?

 

Cheers!

I'd actually tried something similar but it didn't work. I've just done:

 

root@Tower:~# hdparm -S10 /dev/hda

 

/dev/hda:

setting standby to 10 (50 seconds)

 

But 2 minutes later unMenu is still reporting the disk as spun up. Is there a chance my disk doesn't support this?

 

Cheers!

Or, something is accessing it.  Could be either.
  • Author

How would I spot if something is accessing it?

Have you tried using lsof (lists open files)?

inotify-tools

 

download from:

http://www.slackware.org.il/slackware/slackware-12.2/slackware/a/inotify-tools-3.13-i486-1.tgz

install with:

installpkg inotify-tools-3.13-i486-1.tgz

 

Description: inotify-tools is a set of command-line programs for Linux providing a simple interface to inotify. These programs can be used to monitor and act upon filesystem events.

For more information see the inotifywait and inotifywatch man pages.

To track activity under /mnt/user, type:

inotifywait -mr /mnt/user

 

To track activity on a specific disk (/mnt/disk1), type:

inotifywait -mr /mnt/disk1

 

inotify-tools home: http://inotify-tools.sourceforge.net/

 

lsof only shows files open at the instant you run it. 

 

Joe L.

  • Author

Got it from unMenu :)

 

root@Tower:~# inotifywait -mr /mnt/wd1

Setting up watches.  Beware: since -r was given, this may take a while!

Watches established.

 

ok so I'll see what happens....

  • Author

Nothing happening. Accessed a dir on the drive and the watcher picked it up so that's working.

 

I'm guessing my drive doesn't have a standby timer? Is there a way to tell?

 

Is there a command to spin it down? I guess there must be as I can do that from unMenu.

 

So perhaps I could write a script to spin it down if nothing is using it?

 

[EDIT] Actually SABnzbd is logging to it - just got a notifcation. However it's only writing a line every 15mins or so, so that wouldn't affect a spindown timer set to 10secs would it? Or can it not spin down if the log file is being held open or something?

  • Author

Actually I'm not sure it spins down at all even if I tell it to in unMenu. I just hit spindown, and the icon changed, but I could immediately cat a file on it and the icon is the same.

 

I'm starting to think the disk just doesn't support spindown....

Nothing happening. Accessed a dir on the drive and the watcher picked it up so that's working.

 

I'm guessing my drive doesn't have a standby timer? Is there a way to tell?

 

Is there a command to spin it down? I guess there must be as I can do that from unMenu.

 

So perhaps I could write a script to spin it down if nothing is using it?

 

[EDIT] Actually SABnzbd is logging to it - just got a notifcation. However it's only writing a line every 15mins or so, so that wouldn't affect a spindown timer set to 10secs would it? Or can it not spin down if the log file is being held open or something?

You did not set a spin-down timer of 10 seconds.   The numbers used in hdparm are NOT seconds.  Re-read my prior post.  You set one for 50 seconds.   Depending on the drive, it may use it, or ignore it.
  • Author

10secs, 50secs what does it matter? It didn't spin down and there was no access for about 5 minutes.

 

So either that drive can't spin down, or it interprets the value differently to what hdparm thinks it set it to, or 50secs isn't a valid setting for that drive. How can I tell which?

 

Is there a way to test if the drive is actually spun down? Because as I said, unraid was showing it as spun down but I could access data and unraid didn't show any difference.

 

 

10secs, 50secs what does it matter? It didn't spin down and there was no access for about 5 minutes.

 

So either that drive can't spin down, or it interprets the value differently to what hdparm thinks it set it to, or 50secs isn't a valid setting for that drive. How can I tell which?

 

Is there a way to test if the drive is actually spun down? Because as I said, unraid was showing it as spun down but I could access data and unraid didn't show any difference.

 

 

hdparm -C /dev/hdX

will give you the drive state.

 

It will say it is standby if it is spun down (sdf is spun down in my array)

root@Tower:/boot/unmenu# hdparm -C /dev/sdf

 

/dev/sdf:

drive state is:  standby

 

It will say active/idle if spinning and not actually accessing a sector.

 

  • Author

Cool ta. So I get this regardless of what I do in the unraid interface:

 

root@Tower:/mnt/wd1/SABnzbd/Logs# hdparm -C /dev/hda

 

/dev/hda:

drive state is:  active/idle

 

So that isn't actually spinning it down. I assume that the spindown button must just be attempting a shell command in the background. What would that command be so I can try it directly? There might be some output that would be helpful.

  • Author

Ahh I found it in the hdparm help - -y....

 

root@Tower:/mnt/wd1/SABnzbd/Logs# hdparm -y /dev/hda

 

/dev/hda:

issuing standby command

root@Tower:/mnt/wd1/SABnzbd/Logs# hdparm -C /dev/hda

 

/dev/hda:

drive state is:  standby

 

So according to that I managed to spin it down manually. Not sure why unraid interface can't do it though - perhaps that only works on array disks?

I don't know either... it should work.  It uses the exact same command for a drive not in the array.

/hdparm -y /dev/hdX

  • Author

hmmm interesting. I put it into standby again. Approx a minute later it's back to active/idel, despite inotiifywait showing nothing that accessed it.....

 

All I did was perform hdparm -C commands and refresh the unMenu myMain and unRaid Main interfaces.

  • Author

This time I put the notify on /dev/hda. I put it into standby, then it became active again. Got the following output from inotify

 

/dev/hda OPEN

/dev/hda CLOSE_WRITE,CLOSE

/dev/hda OPEN

/dev/hda OPEN

/dev/hda CLOSE_NOWRITE,CLOSE

/dev/hda OPEN

/dev/hda CLOSE_NOWRITE,CLOSE

/dev/hda OPEN

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda CLOSE_NOWRITE,CLOSE

/dev/hda CLOSE_NOWRITE,CLOSE

/dev/hda OPEN

/dev/hda CLOSE_WRITE,CLOSE

/dev/hda OPEN

/dev/hda CLOSE_NOWRITE,CLOSE

/dev/hda OPEN

/dev/hda CLOSE_NOWRITE,CLOSE

/dev/hda OPEN

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda ACCESS

/dev/hda CLOSE_NOWRITE,CLOSE

 

So looks like something is checking the physical disk itself and waking it up?

  • Author

whenever unMenu myMain refreshes it wakes up.....

 

not sure if any of this is relevant?

 

May 14 22:16:39 Tower kernel: hda: task_no_data_intr: status=0x51 { DriveReady SeekComplete Error }

May 14 22:16:39 Tower kernel: hda: task_no_data_intr: error=0x04 { DriveStatusError }

May 14 22:16:39 Tower kernel: hda: possibly failed opcode: 0xb0

May 14 22:17:46 Tower kernel: hda: task_no_data_intr: status=0x51 { DriveReady SeekComplete Error }

May 14 22:17:46 Tower kernel: hda: task_no_data_intr: error=0x04 { DriveStatusError }

May 14 22:17:46 Tower kernel: hda: possibly failed opcode: 0xb0

  • Author

Yup looking at various pages of unMenu spins the disk up, but doesn't spin up the array disks.

 

Looking at the stock unraid interface does not, but then that doesn't display non-array disks or that syslog output.

Yup looking at various pages of unMenu spins the disk up, but doesn't spin up the array disks.

 

Looking at the stock unraid interface does not, but then that doesn't display non-array disks or that syslog output.

 

I have the same problem with myMain on my test server.  If i hit the refresh button a disk will spin up (my IDE ones i think) then unRAID spindown spins it back down right away.

 

I honestly don't care that it is happening as I just leave it on a page that never refreshes plus i am using that machine so much that it never stays on for a long period of time.

  • Author

The trouble is that mine doesn't spin down again. It's not an array disk so while unMenu spins it up, unRAID won't spin it down again, and timed spin down doesn't seem to work on this drive :(

Say Joe, can you fix unMenu not to spin up non-array drives when a page is refreshed.  That's shouldn't be happening.

Archived

This topic is now archived and is closed to further replies.

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.