3

When my laptop (running Ubuntu 12.04) is on battery, the disk powers off after a few seconds of inactivity — about 20s. I use lightdm to log in, and have some Gnome components running (I have gnome-panel and a number of dependencies), but I use neither Gnome nor Unity as a desktop environment (I start the Sawfish window manager manually).

20 seconds is ridiculously fast: in practice the disk keeps powering down and back up immediately, which is slow (bad user experience), potentially damaging the drive (though I've never been able to find concrete data abouth this), and actually consumes more energy when the spun-down time is very short (a 2008 analysis found that for a particular disk, standby mode saved energy if it lasted for more than 9s; mine often last less).

Therefore I want to increase this timeout. How can I do this? I don't know what software is causing the spindown.

Looking at the running processes, I only see upowerd which might be related to power management. Killing it makes no difference.

The timeout probably comes from the disk itself: hdparm -I /dev/sda reports “Advanced power management level: 1” (which doesn't match the 20 seconds, as it should mean 5 seconds according to the hdparm documentation…). I have seen that same machine with the value 254 at other times.

What is causing the value to change while on battery power? I can't see any call to hdparm in /etc/acpi/*.

1
  • Just to clear a point here: The potential of damaging the drive in almost all cases is false. This is more related to the temperature and not the spindown (Temp does cause many problems). Even more, current hard drives have the technology to do a spindown without creating any problems at all to the drive or the life of the drive. If the hard drive does have a problem (Mechanical in most cases) it is due to a fault in that hard drive. I also checked the link and found no answer that concluded that it had a potential to damage the hard drive (Except of course in an already faulty drive). Apr 13, 2013 at 0:31

1 Answer 1

2
/etc% grep -lw 20 **/*(.)
…
laptop-mode/laptop-mode.conf
…
$ grep -w 20 laptop-mode/laptop-mode.conf 
# Default is 2 hours on AC (NOLM_HD_IDLE_TIMEOUT_SECONDS=7200) and 20 seconds
LM_AC_HD_IDLE_TIMEOUT_SECONDS=20
LM_BATT_HD_IDLE_TIMEOUT_SECONDS=20

and for that matter

/etc% grep hdparm **/*(.)
…
laptop-mode/laptop-mode.conf:# hdparm
laptop-mode/laptop-mode.conf:# really SATA drives that only _look_ like SCSI drives, and will use hdparm
laptop-mode/laptop-mode.conf:# Idle timeout values. (hdparm -S)
laptop-mode/laptop-mode.conf:# Power management for HD (hdparm -B values)
laptop-mode/laptop-mode.conf:# Write cache settings for HD (hdparm -W values)

This setting comes from laptop-mode-tools. Here are the default settings in /etc/laptop-mode/laptop-mode.conf:

# Idle timeout values. (hdparm -S)
# Default is 2 hours on AC (NOLM_HD_IDLE_TIMEOUT_SECONDS=7200) and 20 seconds
# for battery and for AC with laptop mode on.
#
LM_AC_HD_IDLE_TIMEOUT_SECONDS=20
LM_BATT_HD_IDLE_TIMEOUT_SECONDS=20
NOLM_HD_IDLE_TIMEOUT_SECONDS=7200

I'm changing those 20s values to something sensible.

1
  • I may have spoken too soon: increasing LM_AC_HD_IDLE_TIMEOUT_SECONDS and LM_BATT_HD_IDLE_TIMEOUT_SECONDS doesn't seem to have any effect. I may be confusing hdparm -S and hdparm -B. Let me experiment with BATT_HD_POWERMGMT=10. Apr 13, 2013 at 0:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .