Bug#684241: hdparm: on battery, the drive spins down too often, even when standby is off

August 07th, 2012 - 09:30 pm ET by Vincent Lefevre | Report spam
Package: hdparm
Version: 9.39-1+b1
Severity: important

Since quite recently, the hard drive of my laptop spins down too often
when on battery: about after 20 seconds - 30 seconds, then it usually
spins up again after a few seconds (sometimes less than 1 second). So,
these spin-downs are completely useless, make the system a bit slower
(when waiting for spin-up), and would probably lower the lifetime of
the drive.

I can see 2 solutions:

1. Detect this automatically. However it seems that the system cannot
do that.

2. Disable spindown via some option. This is what I did, but without
any effect!

I first tried putting "spindown_time = 0" in /etc/hdparm.conf, then
ran "/etc/init.d/hdparm restart" (not sure whether this is useful).
But the drive still spins down.

I've written a script to see the options:

#!/bin/sh
. /lib/hdparm/hdparm-functions
hdparm_options /dev/sda

and it outputs "-B254 -q -S0" when on AC power, and "-B127 -q -S0"
when on battery, as expected (from /lib/hdparm/hdparm-functions).

Then I ran directly:

# hdparm -B127 -S0 /dev/sda

/dev/sda:
setting Advanced Power Management level to 0x7f (127)
setting standby to 0 (off)
APM_level = 127

but the drive still spins down.

Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-3-amd64 (SMP w/2 CPU cores)
Locale: LANG=POSIX, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages hdparm depends on:
ii libc6 2.13-35
ii lsb-base 4.1+Debian7

Versions of packages hdparm recommends:
ii powermgmt-base 1.31

Versions of packages hdparm suggests:
ii apmd 3.2.2-14

/etc/hdparm.conf changed:
quiet
spindown_time = 0




To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
email Follow the discussionReplies 1 replyReplies Make a reply

Replies

#1 Vincent Lefevre
August 07th, 2012 - 09:50 pm ET | Report spam
On 2012-08-08 03:21:44 +0200, Vincent Lefevre wrote:
2. Disable spindown via some option. This is what I did, but without
any effect!

I first tried putting "spindown_time = 0" in /etc/hdparm.conf, then
ran "/etc/init.d/hdparm restart" (not sure whether this is useful).
But the drive still spins down.



Actually, I can see that /lib/hdparm/hdparm-functions contains:

if hdparm_try_apm "$WANTED_DISK"; then
if hdparm_is_on_battery; then
hdparm_set_option -B127
# we allow spindown, but set a spindown time of 3 minutes by
# default so the disk isn't constantly power cycling on a busy
# machine
hdparm_set_option -S36
else
hdparm_set_option -B254
fi
fi

So, even before my change to have -S0, the -S36 wasn't taken into
account. There seems to be something wrong with this option.

It seems that some Ubuntu users have similar problems:

http://askubuntu.com/questions/1375...ndown-time

the workaround being to use the -B option only (with some value
between 128 and 254).

Vincent Lefèvre - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact

Similar topics