hdparm sets power management value to 128 in AC mode

Bug #513706 reported by Nicolò Chieffo
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
hdparm (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Binary package hint: hdparm

Currently in lucid, when you boot the laptop you have a value of 128 (instead of 254) in hdparm -B, even if the laptop is plugged in the AC cable.

I tried to manually set apm value in /etc/hdparm.conf but it does not work

ProblemType: Bug
Architecture: amd64
Date: Thu Jan 28 11:09:46 2010
DistroRelease: Ubuntu 10.04
Package: hdparm 9.15-1ubuntu7
ProcVersionSignature: Ubuntu 2.6.32-11.15-generic
SourcePackage: hdparm
Uname: Linux 2.6.32-11-generic x86_64

Revision history for this message
Nicolò Chieffo (yelo3) wrote :
Revision history for this message
Kevin Funk (kfunk) wrote :

Same for me. Here it the -B parameter is even set to 1. This happens after some recent updates (since one week I guess).
Very annoying as -B 1 spins down the disk after a short period. I have to reset the parameter to a higher value each startup to avoid disk damage.
Modifying /etc/hdparm.conf doesn't work aswell.

Revision history for this message
thomas-student (thomas-student) wrote :

THE BUG IS:

The file /usr/lib/pm-utils/power.d/95hdparm-apm owned by package "hdparm" version 9.15-1ubuntu9 in lucid checks for presence of laptop-mode-tools at the wrong location on the disk, then proceeds to manage the APM setting for the hard drive itself when laptop-mode-tools should be handling it.

Specifically, the files /usr/sbin/laptop_mode and /var/run/laptop-mode-tools/enabled have AFAICT been deprecated/moved. This:

    if [ -e /usr/sbin/laptop_mode ] ; then
            LMT_CONTROL_HD_POWERMGMT=$(. /etc/laptop-mode/laptop-mode.conf && ec
            if [ "$LMT_CONTROL_HD_POWERMGMT" != 0 ] \
               && [ -e /var/run/laptop-mode-tools/enabled ]
            then
                    # Laptop mode controls hdparm -B settings, we don't.
                    return
            fi
    fi

(which comes from the described file) includes the uses of these paths that urgently need correcting.

Changed in hdparm (Ubuntu):
status: New → Confirmed
Revision history for this message
thomas-student (thomas-student) wrote :

Actually, that only fixed AC plugs/unplugs. There is STILL a problem with suspend/resume on AC.

Revision history for this message
thomas-student (thomas-student) wrote :

If you purge package laptop-mode-tools and then edit /etc/hdparm.conf to add:

apm = 254
apm_battery = 254

after this line (line 41):

#apm = 255

Then all is well. It doesn't like laptop-mode-tools at all, though.

Changed in hdparm (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
thomas-student (thomas-student) wrote :

Responding to an email from someone, purging laptop-mode-tools if it's already uninstalled would be 'sudo dpkg --purge laptop-mode-tools'.

I have no idea why laptop-mode-tools's config files are still causing SOMETHING on the system to call hdparm -B128 / 254 when laptop-mode-tools is uninstalled. It would not be hard to write a wrapper for hdparm and get a stack trace of whoever's calling, but I don't have time for that.

Revision history for this message
thomas-student (thomas-student) wrote :

OK, so somehow I had a different, newer version of laptop-mode-tools than lucid. I probably got it accidentally from a PPA. My original ("THE BUG IS") bug report is sort-of bunk as far as lucid goes, though this may appear in the future if (when) hdparm is updated.

The normal "fix" (see above) of purging laptop-mode-tools and adding regular old /etc/hdparm.conf lines for apm=254 and apm_battery=254 worked once I downgraded to the lucid's laptop-mode-tools. For most people having frequent laptop-drive-kerchunks and high load cycle numbers from SMART, this will probably be all that you need to do.

I apologize for the noise.

As for why others are still having this problem, I would suspect that it's either a bug/difference in laptop-mode-tools or (if laptop-mode-tools is removed but not purged) that some other package is utilizing the setting from laptop-mode-tools.conf improperly. I think that some universe gnome-applet or udev script might be doing this, but since I'm not having the problem myself, I can't really help there.

I'm going to leave this set Incomplete so that the other person who is having the problem can still use this bug report to seek a solution.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for hdparm (Ubuntu) because there has been no activity for 60 days.]

Changed in hdparm (Ubuntu):
status: Incomplete → Expired
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.