Eee PC Clicking Sound
I’ve noticed that on battery power the hard disk makes a clicking sound every 20 seconds or so. This symptom has been reported particularly by laptop and netbook users, including those that use Windows (though I gather it’s much less of a problem with Windows users).
A quick summary of the situation. If your Eee PC has a SATA hard disk, chances are you’ve noticed this problem. The simple solution is just to disable Advanced Power Management on the hard disk all together and then get on with your life. There are plenty of other power saving features that work, but it seems that the APM is not well suited to Lucid Lynx (or vice versa).
Ubuntu is telling the hard disk to take it easy and not to chew too much power. But this is really just to lull it into a false sense of security as it doesn’t actually cut the drive any slack. In fact, Lucid has some services which appear to be very demanding on the hard disk. The hard disk keeps trying to take a break but Lucid keeps accessing it. The result is a drive that constantly sleeps and wakes up again (causing the click to be heard, as the disk heads park and then move back into working position again). Luckily this action was actually audible, otherwise I’d have been none the wiser, oblivious to the performance hits until my hard disk finally died from excess wear.
A quick search revealed the following command to instantly stop the clicking:
$ sudo hdparm -B 254 /dev/sda
Where “sda” is your SATA hard disk device of course. That command will buy you some time to figure out what’s really happening. Unless you are feeling adventurous, you’ll probably reach the same conclusion that I have. But lets work through this anyway for the sake of actually understanding a little more about what’s actually going on here.
The following command will tell you lots of stuff about your hard drive that you probably don’t want to have to care about:
$ sudo hdparm -I /dev/sda
You can find just the line we are interested in with this one:
$ sudo hdparm -I /dev/sda | grep "Advanced power management"
Which should yield this, since we ran hdparm with the -B 254 option…
Advanced power management level: 254
This is what we want. But if you reboot and run that command you will see it reverts back to level 128. In fact, if you plug the power back in and then remove it, theoretically it should revert to APM level 128.
To find out what the hard drive has been up to, install the smartmontools package using synaptic or sudo apt-get install smartmontools. Then you can run this command (make sure your terminal window is nice and wide or maximised):
$ sudo smartctl -a /dev/sda
Cool huh? More stuff you don’t want to have to care about. But just have a look at the section titled “Vendor Specific SMART Attributes with Thresholds”. On my Eee PC I had very high “RAW_VALUE” for “Load_Cycle_Count” row.
“Load_Cycle_Count” was 3150 and “Power_On_Hours” was only 56. So I’m assuming this means the drive has averaged one “load cycle” per minute of it’s life. Which is about right, since the clicking only happens on battery power and then it happens about every 20 seconds during this time. So if the clicks coincide with these “load cycle” thingamajigs, this would suggest it’s lived on batteries less than 1/3rd of it’s life, which is about right.
If you don’t like my science, or you have a different interpretation of your own threshold table then you might want to have a look at the SATA known issues wiki page. Meanwhile, on with the show…
With a default Lucid Lynx installation, the APM level 128 setting is triggered by a htparm power management script that lives here… /usr/lib/pm-utils/power.d/95hdparm-apm. If you have another power management package installed such as laptop-mode-tools then your on your own.
The configuration for this and possibly other power management tools lives in /etc/hdparm.conf. To basically disable APM when running on battery power, add the following to the end of the config file…
/dev/sda {
apm = 254
apm_battery = 254
}
This tells hdparm to keep the drive at APM level 254 even when it’s running on battery power. Unfortunately, this seems to be the simplest option when running Lucid Lynx on an Eee PC. Apparently Lucid Lynx just doesn’t want to stop molesting the hard disk. Just disable APM for now. Hopefully future UNE releases will address this rather major issue.
I’m planning to test the battery life of the OEM Windows 7 and then compare it with Lucid Lynx without APM. I expect it to be a bit of a hit, but I get the impression it’s not worth the effort to make Lucid Lynx APM friendly. If you are feeling masochistic though, perhaps you can pick up from where this guy left off.. http://forum.eeeuser.com/viewtopic.php?id=85230
I see this as an unfortunate trade off between power consumption and performance. The performance improvement of Ubuntu still far out weighs this issue. To be fair, I first found out how to fix this problem from Windows users. Someone has ported a lot of the functionality of hdparm to a tool called quietHDD to solve this for the Windows platform. At least our solution is supported and bundled with the operating system. I found it interesting anyway to know a bit more about how power management works in Ubuntu.
References:
man hdparm.conf

Thanks! I have this very problem on my freshly-bought eee PC 1015PE under UNE 10.10, this helps a lot!
Thanks a bunch, that solved it too for my eeepc under linux mint debian edition (xfce)