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