Comment 638 for bug 59695

Revision history for this message
Isaac Dupree (idupree) wrote :

Intrepid x86_64 MacBook2,1. (a page related to this hardware: https://help.ubuntu.com/community/MacBook2-1/Hardy )

bad: Wait 10 minutes (working or not, but system running), and Load_Cycle_Count increases by 5 to 10. That's 30-60 LCC an hour, which is too much.

`hdparm -B 254 /dev/sda` works as long as it lasts, which is until suspend or reboot. It seems to prevent Load_Cycle_Count increasing (except by 1 when suspending to ram or rebooting of course). My particular hard-drive specs seem to say that hdparm value will make it wait 15 minutes before parking the head, so it's possible it would park after 15 minutes of actual disk inactivity, which would be a good thing (I wasn't patient enough to check).

Enabling laptop-mode (in /etc/default/acpi-support -- I know it worked because then, on battery, /proc/sys/vm/laptop_mode would contain 2 rather than 0) didn't solve Load_Cycle_Count increasing, neither when on battery nor when on AC, and even though /etc/laptop-mode/laptop-mode.conf settings are mostly good in their default e.g. CONTROL_HD_POWERMGMT=1, LM_AC_HD_POWERMGMT=254, NOLM_AC_HD_POWERMGMT=254, LM_AC_MAX_LOST_WORK_SECONDS=360... though it's possible that both AC and battery are slipping through the cracks in various ways (maybe battery, uses HD_POWERMGMT=1, and AC, not on LM and doesn't save disk-writes over time). (I also noticed that, while writes can be delayed given enough RAM, reading data from the disk that's not already cached -- e.g. starting up a new application -- cannot be, so we're just relying on that not being needed most of the time a computer's running in laptop-mode.)

I put this into /etc/pm/sleep.d/99-save-hd.sh (with chmod +x) (note bug #244839) :
{{{
#!/bin/sh
hdparm -B 254 /dev/sda
}}}
It runs, once on each suspend and once on each resume, which works for me (Load_Cycle_Count measured not increasing). I'm not sure if that script, or indeed anything, runs on system start, though -- but I personally mostly suspend/resume and rarely shut down, so this works good enough for me.