External usb hard drives not spinning down + random spin ups


bbs
Go to solution Solved by Vr2Io,

Recommended Posts

Hi! I'm new to this, so maybe somebody could point me to the right direction.

I have array with 2 external usb hard drives for storage and 1 ssd for cache. I don't have any parity drives.

Yes, I guess I'm using Unraid wrong. Yes, external usb drives are bad, but it is what it is. Sorry in advance.

 

Setting up spindown delay using web gui does nothing. I just get "spinning down /dev/sdx" message in system log and that's it. Manually pressing spin down array button works fine and I did manage to get spindown delay to work by setting up "hdparm -S 244 -B 127 /dev/sdx" in go file. Status on all drives still shows as "Active" after spin down, I'm guessing that's because of weird power management in usb drives?

 

But there's another issue. Whenever drives are spun down manually or by hdparm they spin back up again after a few minutes. That is what I've been trying to figure for the past few days. Most of the older threads are about dockers and plugins accessing drives in the background or misconfigured cache etc.

I found this thread that is somewhat similar to my case, but I'm too noob to understand everything from there and the "dirty hack" didn't fix anything for me. 

Or this thread for unassigned drive with no answers.

 

I tried fresh installs with different Unraid versions 6.9.1, 6.9.2 and currently 6.10.0-rc4. I tried to use tools like Active Streams, File Activity and Open Files - nothing seems to access the array drives but it still spins up.

If I clear stats on the main page of gui there are 0 reads and writes on all the drives in the array for hours, even after the hdparm spins them down and drives wake up again in circles.

 

I'll attach screenshots of my drive/share setup. Any tips where should look to fix this?

 

chrome_2022-04-14_19-32-06.png

chrome_2022-04-14_19-31-35.png

Link to comment
On 4/15/2022 at 10:43 PM, Vr2Io said:

 

How long does disk SMART polling / update in setting ?

 

Pls do a simple test, start array in maintanance mode, and check does spindown work as expect first.

 

Same thing happens in maintenance mode, drives spin up few minutes after manually spinning them down. It seems that SMART checks are disabled on USB devices automatically, at least logs don't show that there are any.

I can't change anything in SMART settings (checkboxes reset back to this if I try to change anything) and I also can't find where can I set SMART polling?

Edited by bbs
Link to comment
  • Solution
6 hours ago, bbs said:

I can't change anything in SMART settings (checkboxes reset back to this if I try to change anything) and I also can't find where can I set SMART polling?

Those are individual disk SMART setting to override global SMART setting.

In "settings" -> "disk settings", you will found "Tunable (poll_attributes):" and global SMART setting too.

 

image.png.cac7e361bcad0bef29ca3ae5c95f506d.png

 

BTW, it look like disk spin-up was due to USB-SATA bridge beehive not relate file access , those are hardware related ( also for Unraid can't read SMART ).

I have some multi-bay USB enclosure, Unraid can read disk SMART and spindown ( but either enclosure disk spinup, all disk will spinup too ), different USB-SATA bridge will have different result.

Edited by Vr2Io
Link to comment

I never let my drives spin down because I see that as a problem. I have USB (x4) drives for backup (and an old 18tb NAS cabled), and I have unassigned drives and cache drives and, of course, the array drives. I'm not very good at "power" management, but a mechanical HD is, what?... 5 watts?

 

I think "power-cycling" a hard drive is the worse thing you can do to it.

 

I hope this helps in a weird way. :)

 

Mr. Grey.

Link to comment
On 4/19/2022 at 5:01 AM, Vr2Io said:

In "settings" -> "disk settings", you will found "Tunable (poll_attributes):" and global SMART setting too.

 

After setting it to 0 the drives are not spinning up anymore! It was right under my nose... I'm so stupid. Thanks a lot!

Edited by bbs
Link to comment
2 hours ago, bbs said:

 

After setting it to 0 the drives are not spinning up anymore! It was right under my nose... I'm so stupid. Thanks a lot!

It must be the USB-SATA Bridge is not reporting correctly disk state. What output do you get if you run smartctl -n standby /dev/sdX

Link to comment
4 hours ago, SimonF said:

It must be the USB-SATA Bridge is not reporting correctly disk state. What output do you get if you run smartctl -n standby /dev/sdX

 

It spun my drive on the first run and reported that device is in sleep mode (it was).

image.png.ad5dd44e06155c74a13770d7c86010c2.png

 

3rd run after a few minutes:

image.png.345f81460febddd2bc4c4a9df0e1b424.png

Edited by bbs
Link to comment
15 minutes ago, bbs said:

 

It spun my drive on the first run and reported that device is in sleep mode (it was).

image.png.ad5dd44e06155c74a13770d7c86010c2.png

 

3rd run after a few minutes:

image.png.345f81460febddd2bc4c4a9df0e1b424.png

The version of smartctl is old, it is being updated to 7.3 in hopefully in RC5

 

So may be worth testing again once it drops.

 

Unraid uses hdparm -C to get the state and hdparm -y to spindown for ATA devices so if the state is being report incorrectly unraid will think its running.

 

 

Link to comment

With 6.9 I had to tweak unRAID's sdspin to make USB spindown work.

I don't know whether this solution's generic and I haven't tested with 6.10

 

sdspin is a critical script so if you tweak it make a backup and be careful.

Hope it helps.

 

Edit: this one also may be relevant. Good luck.

 

Edited by CS01-HS
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.