LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-28-2012, 09:23 AM   #1
ljb643
Member
 
Registered: Nov 2003
Posts: 526

Rep: Reputation: Disabled
USB disk won't sleep under Slackware-14.0


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?
 
Old 10-29-2012, 05:13 AM   #2
Cesare
Member
 
Registered: Jun 2010
Posts: 65

Rep: Reputation: 113Reputation: 113
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.
 
Old 10-29-2012, 08:20 AM   #3
ljb643
Member
 
Registered: Nov 2003
Posts: 526

Original Poster
Rep: Reputation: Disabled
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.
 
Old 10-29-2012, 10:25 AM   #4
ljb643
Member
 
Registered: Nov 2003
Posts: 526

Original Poster
Rep: Reputation: Disabled
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.)
 
Old 10-31-2012, 03:02 PM   #5
ljb643
Member
 
Registered: Nov 2003
Posts: 526

Original Poster
Rep: Reputation: Disabled
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.

Code:
ATTRS{idVendor}=="0bc2", ATTRS{idProduct}=="3300", ENV{UDISKS_IGNORE}="1", ENV{ID_ATA_FEATURE_SET_SMART_ENABLED}="0"
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.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to install Slackware but laptop won't read disk emeisner Slackware - Installation 6 08-15-2012 07:27 AM
[SOLVED] DVD drive won't read the Slackware installation disk Janek566 Slackware - Installation 16 06-17-2011 01:32 PM
How can one get USB external disk drive to "sleep"? harryhaller Linux - Hardware 4 09-06-2008 12:55 AM
Usb disk corrupt, won't mount guitara Linux - Hardware 4 05-11-2006 02:39 AM
Why won't Slackware 7.1 lowmem.i boot, every other disk / version will? SBing Slackware 4 08-01-2004 11:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration