hdparm -Y does not work (as it did in 8.10)

Bug #374287 reported by AmenophisIII
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
hdparm (Ubuntu)
Fix Released
Undecided
Unassigned
linux (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: hdparm

hdparm -Y <dev> should spin down a harddrive.
it may wake up instantly again if there is some access to it like:
* access to a mounted fs on the hdd
* other ata commands issued like smart readout (by smartd) or temperature readings (hddtemp)

hdparm -S <timeout parameter> <dev> sets a idle timeout, if reached the hdd puts itself to sleep.

i use hdparm -Y at the end of my backup script to shut down the backup drive (internal sata). to keep it spun down, i had to configure smartd and hddtemp accordingly (the backup file system is unmounted of course). this worked in intrepid without problems.

after upgrading this does no longer work. hdparm -Y tries to spin the disk down, but it spins up again immediately.

imho there is nothing blocking the drive, but there is an incompatibility between the hdparm in jaunty and the kernel... or whatever. this interpretation is derived from the fact, that the hd is put into sleep mode and stays there as it should, if the hdparm -S idle timeout is reached.

an excerpt of dmesg may be of interest:
[76839.859237] ata3.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x6
[76839.859241] ata3.00: waking up from sleep
[76839.859245] ata3: hard resetting link
[76840.176065] ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[76840.177022] ata3.00: configured for UDMA/133
[76840.177029] ata3: EH complete
[76840.177078] sd 2:0:0:0: [sdb] 488397168 512-byte hardware sectors: (250 GB/232 GiB)
[76840.177094] sd 2:0:0:0: [sdb] Write Protect is off
[76840.177097] sd 2:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[76840.177119] sd 2:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA

linux-image-2.6.28-12-generic 2.6.28-12.43
hdparm 8.9-3ubuntu3

i have not tried to boot another kernel (yet).
an external (esata) drive behaves the same (same controller (ich10)):
[86795.385665] ata6.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x6
[86795.385668] ata6.00: waking up from sleep
[86795.385673] ata6: hard resetting link
...

ProblemType: Bug
Architecture: amd64
Dependencies:
 libgcc1 1:4.3.3-5ubuntu4
 gcc-4.3-base 4.3.3-5ubuntu4
 findutils 4.4.0-2ubuntu4
 libc6 2.9-4ubuntu6
DistroRelease: Ubuntu 9.04
Package: hdparm 8.9-3ubuntu3
SourcePackage: hdparm
Uname: Linux 2.6.28-12-generic x86_64

Revision history for this message
AmenophisIII (amenophisiii) wrote :
description: updated
tags: added: hdd sleep standby
description: updated
Revision history for this message
AmenophisIII (amenophisiii) wrote :

i installed mainline kernel image 2.6.29-02062902 (http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.29.2/linux-image-2.6.29-02062902-generic_2.6.29-02062902_amd64.deb), which fixes the problem!

Revision history for this message
AmenophisIII (amenophisiii) wrote :
Revision history for this message
AmenophisIII (amenophisiii) wrote :

despite showing no interest in this bug by YOU, it was already fixed by the hdparm ppl in version 9.14 from 2009-04-08. ;)
see http://sourceforge.net/project/shownotes.php?release_id=674401&group_id=136732
please upgrade or cherry pick the patch, thank you

Changed in linux (Ubuntu):
status: New → Invalid
Revision history for this message
Ben Hodgens (ben-hodgens) wrote :

This problem might be somehow related to KDE. The only reason I mention this is because I was able to previously (as of yesterday) do a hdparm -Y <dev> and have the device remain in sleep. This morning I installed kubuntu-desktop and upon a subsequent reboot, the disk spins up immediately.

In this instance, hdparm -S 1 <dev> does not result in anything other than the "setting standby to 1 (5 seconds)".

I should note that I'm not actually using KDE while trying to issue said command(s) (I'm running the minimalist wm awesome, and only installed KDE for experimental purposes), and lsof | grep <dev> shows <dev> to have no open files. I am not saying KDE is in any way related to this, necessarily; but I do know that issuing the hdparm -Y command worked on the disk, as of yesterday.

Changed in hdparm (Ubuntu):
status: New → Fix Released
Revision history for this message
AmenophisIII (amenophisiii) wrote :

this was fixed in 9.15-1ubuntu1 (lp:311451) and will be released in karmic, so ill close this.

Revision history for this message
BeSt (steph-belardi) wrote :

I use Jaunty, but I installed kernel and hdparm package from Karmic and I still have the problem.
Actually, I have 2 disks (let's A, the system one, and B the unmounted one). When I do "hdparm -Y" on A, A spins down (but power on just after since it's the system disk): this behaviour is OK. But, when I do "hdparm -Y" on B: the disk doesn't spin down at all. This behaviour is not ok.I also noticed that exactly one every other time I do hdparm, this append to the kern.log:
Oct 3 09:29:28 clairmont kernel: [ 674.563643] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6
Oct 3 09:29:28 clairmont kernel: [ 674.563654] ata1.00: waking up from sleep
Oct 3 09:29:28 clairmont kernel: [ 674.563667] ata1: hard resetting link
Oct 3 09:29:28 clairmont kernel: [ 675.090046] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
Oct 3 09:29:28 clairmont kernel: [ 675.102961] ata1.00: configured for UDMA/133
Oct 3 09:29:28 clairmont kernel: [ 675.103006] ata1: EH complete

It changes anything if I swapped the SATA cables, if I select AHCI or IDE in bios. I think the problem is with the HDD, not with the motherboard.

Infos:
IDE interface: nVidia Corporation MCP79 SATA Controller (it's a ION platform)
disk A: ST9160821AS
disk B: SAMSUNG HD154UI (<-- the one which doesn't work)
kernel= 2.6.31-11-generic #38-Ubuntu SMP Fri Oct 2 11:06:40 UTC 2009 x86_64
hdparm= 9.15-1ubuntu3

Revision history for this message
BeSt (steph-belardi) wrote :

I've just checked with the last development CD (Karmic): the behavior is the same. One of the disk is correctly shut down, the other isn't and warnings are logged.

Revision history for this message
BeSt (steph-belardi) wrote :

For information, when using a "SATA->USB" enclosure, I can spin down the SAMSUNG HD154UI, even with Linux. But it doesn't work when using "SATA->eSATA" enclosure.

Revision history for this message
BeSt (steph-belardi) wrote :

I found it !
I did "hdparm -B 127 -S 1 /dev/sd?" and then "hdparm -B 127 -S 20 /dev/sd?", and now the spindown via "hdparm -Y" is working !! I don't understand why, but it solved my problem.

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.