[SOLVED] USB disk won't sleep under Slackware-14.0
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
After upgrading to Slackware-14.0, my external USB disk no longer goes to sleep when idle. This is a disk with no mounted volumes 99% of the time, so it used to sleep nearly all the time.
Under Slackware-13.37, after about 15 minutes the disk would spin down and go to sleep, until I tried to mount a volume on it. This sleep function has nothing to do with PC power management - it isn't controlled by any daemon on the PC - it is built-in to the Seagate drive.
With Slackware-14.0, it will never sleep as long as I am logged in. (I'm using the Xfce desktop.) As a test, I booted up and did not log in. After 15 minutes the disk went to sleep. Then I logged in, and the disk immediately woke and spun up. Again: nothing is mounted.
Has anyone seen this, or know what is causing it? I first suspected udisks2 is the cause, but that runs even when nobody is logged in, doesn't it? Is something new in Slackware-14 sending periodic polls to the disk, keeping it awake? Any thoughts on how to trouble-shoot this?
I had a similar problem. After idling for 5 minutes my USB-disk would spin down, only to spin up again a minute later without me touching anything - or not spinning up at all, even when trying to mount it. This is what I did then...
1) Disconnected the disk from the on-board Etron USB3 port and plugged it into a NEC PCIe-card which I had from 13.37 days when the Etron chip didn't work at all. Didn't investigate this any further.
2) Uninstalled udisks2.
Udisks2 is a funky piece of software. I seems to constantly poll each HDD, e.g. for SMART information (I didn't ask for that?!) and I couldn't figure out a way to disable it or at least stop it from touching certain HDDs (a udev-rule with ENV{UDISKS_IGNORE}="1" didn't work).
At the end of the night I decided it wasn't worth it and just uninstalled udisks2. Thanks to no depedencies this is possible without dragging XFCE along. Everything has been working fine since. The USB-disk spins down after 5 minutes of inactivity (I keep it mounted ro) and reliably comes back to life when mounting rw or accessing it.
Sorry if this post doesn't provide any real insight. If somebody can explain the way udisks2 works (or doesn't), I'd be interested.
Thanks for the idea. I thought about udisks2 being behind this, but doesn't udisks2 run from boot-time, not only while logged in? So I couldn't see why the disk would go to sleep when not logged in, but wake up and stay awake while I was logged in, if the cause was udisks2. But it is still on my list of possible causes, along with gvfs.
Well, that's interesting. Every 10 minutes UDisks2 is updating its SMART information about each system disk. (That's from "udisksctl monitor".) This doesn't tell me UDisks2 is polling the disk, or explain about the difference between logged in and not, but... it does fit. If the disk would sleep after 15 minutes, but it polls at 10 minutes, it would never sleep. "More research is needed."
(How ironic if SMART - which is meant to predict failure, and make disks more reliable - is being used to shorten the disk life by keeping it from sleeping when idle.)
It was exactly as Cesare said (thanks!). Udisk2 is polling the drive every 10 minutes for a SMART update, and this is keeping the drive awake. I found some comments about this on the freedesktop bugzilla:
Quote:
But even with SMART enabled, udisks reading SMART data should not wake up the disk - in fact, we check if the disk is asleep and avoid reading SMART data if this is so.... if this in turn causes the disk to never go to sleep, I think it may be a problem with the disk sleep timer in question (changing the disk sleep timeout to < 10 min or forcing it to go to sleep could fix it).
So that's what is happening. With an internal sleep timer of 15 minutes, the 10 minute probes keep it awake. If the sleep timer was shorter than 10 minutes, the disk would sleep, and presumably udisks would stop probing it.
I don't know how to change the sleep time in the disk - if it is possible at all - but I did find out how to disable SMART reporting. (I first tried smartctl -s off, which turns it off, but udisks apparently turns it back on.) Here is a udev rule I added to /etc/udev/rules.d/95-local.rules.
Note this uses my drive Vendor and Product codes; others will differ. Also this sets UDISK_IGNORE to keep the drive from displaying on the Xfce desktop, which is a separate problem fixed by this rule.
With the above rule, the external disk now goes to sleep as it should.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.