[Ubuntu] High frequency of load/unload cycles after suspend to RAM

[Ubuntu] High frequency of load/unload cycles after suspend to RAM

There is a known problem in Ubuntu connected with high frequency of load/unload cycles on hard disk.
Here are useful links:
https://wiki.ubuntu.com/DanielHahler/Bug59695
http://ubuntuforums.org/showpost.php?p=3675960&postcount=26
http://ubuntuforums.org/showpost.php?p=5031046&postcount=3

I used approach from Ubuntu forums and Load_Cycle_Count stopped increasing. Unfortunately, everytime when I woke up my Asus F3F from suspend to RAM (even it was on AC power), Load_Cycle_Count started dramatically increasing.
Here is a solution:

#!/bin/bash
if on_ac_power; then
  hdparm -B 255 /dev/sda
else
  hdparm -B 128 /dev/sda
fi

I saved this code as /usr/lib/pm-utils/sleep.d/99-fixhdd.sh and made it executalbe:

chmod +x /usr/lib/pm-utils/sleep.d/99-fixhdd.sh

Since this fix, everything is OK.

One thought on “[Ubuntu] High frequency of load/unload cycles after suspend to RAM

Leave a Reply

Your email address will not be published.