Udisks2 prevents HDDs from going to standby because of polling SMART information

Bug #1373318 reported by TheNinja on 2014-09-24
This bug report is a duplicate of:  Bug #1281588: Disk standby timer is broken. Edit Remove
This bug affects 6 people
Affects Status Importance Assigned to Milestone
udisks2 (Ubuntu)

Bug Description

1) Ubuntu Version:
Description: Ubuntu 14.04.1 LTS
Release: 14.04

2) Package Version
  Installiert: 2.1.3-1
  Installationskandidat: 2.1.3-1
 *** 2.1.3-1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/main i386 Packages
        100 /var/lib/dpkg/status

3) What I expected to happen:
My two Seagate drives go to sleep after 10 minutes of inactivity.

4) What happened instead:
The drives stay on all the time.

The full story:
The problem is that the minimum time for the drives to go to sleep is 10 minutes, but they are kept awake by the udisks2 daemon which polls them every 10 minutes for SMART data, resetting the idle timer by doing so. Also this might not happen to all drives, there should be a workaround.
Would be great if the patch proposed here [1] would also be integrated into udisks2.
A more universal approach might be to make the polling interval configurable with 0=polling disabled.

Disabling SMART for the disks works partially:

a) The following UDEV flags don't have any effect:

b) The following works:
(Note: without killing the daemon, according to "udisksctl monitor" it keeps polling.
By polling, the SMART support is reactivated, which seems to be some unexpected behaviour from libatasmart [2])

sudo killall udisksd
sudo smartctl --smart=off /dev/sdb
# verify
sudo smartctl --all /dev/sdb | grep "SMART support"
I think it is quite a bad workaround to kill the deamon after every reboot to be able to diable SMART. And disabling SMART is not good either, but it would be fine for me as workaround.

[1] https://www.libreoffice.org/bugzilla/show_bug.cgi?id=26508

[2] can be verified with
sudo smartctl --smart=off /dev/sdb
sudo smartctl --all /dev/sdb | grep "SMART support"
sudo skdump --overall /dev/sdb
sudo smartctl --all /dev/sdb | grep "SMART support"

This is mainly about the old udisks1, but may provide some additional information:
This is about gnome-disk-utility, but the underlying problem seems udisks2

TheNinja (uss-ninja) on 2014-09-24
description: updated
description: updated
TheNinja (uss-ninja) on 2014-09-30
description: updated
TheNinja (uss-ninja) wrote :

So, I did some debugging and I can confirm that changing the houskeeping from 10 minutes to at least 11 minutes fixes the problem for me. I attached a patch that changes the housekeeping to 15 minutes.

btw: I cloned from here
I hope that's the right repository.

TheNinja (uss-ninja) wrote :

In addition to the above patch, I made the housekeeping more configurable. It adds the commandline parameter "housekeeping" which can be used to set the amount of minutes of the interval (0=disable housekeeping). Might not be a clean implementation, but at least it's pretty straight forward to get the idea.

To apply the changes in the system add "--housekeeping=15" to the command lines in

TheNinja (uss-ninja) wrote :

Another hint: If you want to compile udisks, use ./configure --prefix=/usr if you want to replace udisksd on your system otherwise the new version will be in /usr/local/lib/udisks2/.

The attachment "Changes the housekeeping to 15 minutes" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in udisks2 (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers