udisks wakes up unmounted drives from standby with smart polls

Bug #638765 reported by AmenophisIII
52
This bug affects 11 people
Affects Status Importance Assigned to Milestone
udisks (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: udisks

i have two harddisks in my laptop, one ssd with os and data and one backup hdd.
my backupscripts mount the backup hd's partition, write data, unmount the partition again and put the hd to sleep with hdparm -Y.
this worked flawlessly in ubuntu 9.10 (although some apps, that queried all block devices (e.g. gparted) woke it up of course).

in lucid udisks queries all hds for smart data regulary, which wakes most hds (tested seagate and wd).
i found out, that it was udisks by using auditd to set up a monitor (auditctl -w /dev/sdb -p rwa), waiting untill the drive spins up and then checking "ausearch -i", which clearly indicates the problem:
type=SYSCALL msg=audit(2010-09-15 10:49:30.000:56) : arch=x86_64 syscall=open success=yes exit=3 a0=12446c0 a1=80900 a2=0 a3=7fff38265410 items=1 ppid=2098 pid=22515 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=4294967295 comm=udisks-helper-a exe=/usr/lib/udisks/udisks-helper-ata-smart-collect

summary: - udisks wakes up idling, unmounted drives with smart polls
+ udisks wakes up unmounted drives from standby with smart polls
Revision history for this message
AmenophisIII (amenophisiii) wrote :

workaround by replacing the offending binary with one, that does nothing:

cd /usr/lib/udisks
mv udisks-helper-ata-smart-collect udisks-helper-ata-smart-collect.orig
echo "#!/bin/sh
exit 0" > udisks-helper-ata-smart-collect
chmod +x udisks-helper-ata-smart-collect

beware: this will of course break udisk's ability to collect any smart data even from non-idling drives. also this workaround will be reversed by updates of udisk and has to be reapplied.

another note on the bug: seems that the no-wakeup switch/argument of udisks-helper-ata-smart-collect does not work - at least in my case(s).

Changed in udisks (Ubuntu):
status: New → Confirmed
Revision history for this message
AmenophisIII (amenophisiii) wrote :

seems the problem is similar (if not the same) as bug 435190, but the fix for that one was committed for lucid... maybe it was lost again?

Revision history for this message
cyzen (cyzen) wrote :

I think same problem here, i want to go suspend and i hangs.
I have a unmounted disk (in bios disabled) disk with errors. there seems to be no timeout to get the values

Revision history for this message
Martin Karpinski (mkarpinski) wrote :

I'm running Lucid. I can confirm that my WD Elements external USB HDD constantly wakes up when udev checks the SMART data.

The exact moment the drive wakes up corresponds perfectly to the time that Disk Utility reports as the minute that the SMART data was updated.

Was this somehow fixed in Maverick yet or not? Strong incentive to upgrade, if it has been.

Revision history for this message
Martin Karpinski (mkarpinski) wrote :

"I can confirm that my WD Elements external USB HDD constantly wakes up when udev checks the SMART data."

Sorry, typo. Replace udev with udisks above.

Revision history for this message
Matthias Pfau (matthias-pfau) wrote :

This has definitely not been fixed in Maverick. I got the problem with a Seagate ST31000520AS and a Samsung HD103SJ.

Revision history for this message
Matthias Pfau (matthias-pfau) wrote :

According to http://bugs.freedesktop.org/show_bug.cgi?id=26508#c0, the following would be a permanent workaround:

Create a file /etc/udev/rules.d/80-udisks.rules with the following contents:

KERNEL=="sd*[!0-9]", ATTR{removable}=="0", ENV{ID_BUS}=="usb", ENV{DEVTYPE}=="disk", ENV{UDISKS_DISABLE_POLLING}="1"
KERNEL=="sd*[!0-9]", ATTR{removable}=="0", ENV{ID_BUS}=="ata", ENV{DEVTYPE}=="disk", ENV{UDISKS_DISABLE_POLLING}="1"
KERNEL=="sd*[!0-9]", ATTR{removable}=="0", ENV{ID_BUS}=="scsi", ENV{DEVTYPE}=="disk", ENV{ID_VENDOR}=="ATA", ENV{UDISKS_DISABLE_POLLING}="1"

This has been approved by me and it really stops the polling. Anyhow, I think that this is a bug of udev or udisks because it makes no sense to poll for SMART data all the time if it isn't evaluated. I also think that it should be configurable to poll for SMART data only on disks which are either active or idle.

Revision history for this message
AmenophisIII (amenophisiii) wrote :

i can confirm that setting ENV{UDISKS_DISABLE_POLLING} to 1 in an appropriate udev rule helps

for my thinkpad t410s useful rules are:

# main hdd (1.8")
KERNELS=="0:0:0:0", ENV{UDISKS_DISABLE_POLLING}="1"

# thinkbay hdd
KERNELS=="1:0:0:0", ENV{UDISKS_DISABLE_POLLING}="1"

# esata hdd
KERNELS=="5:0:0:0", ENV{UDISKS_DISABLE_POLLING}="1"

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.