Workaround solution to broken ACPI in laptop HDD’s

Recently there has been quite some talk (ubuntu bug #59695) about the brokenness of laptop harddrives under linux. As a powersaving/shockprotecting feaure these disks load and unload their heads up to several times per minute. This mechanism is rated at a couple of hundred thousand such operations. Read this for details.

You can see how many load/unloads your disk (/dev/sda below) has performed by executing:

sudo smartctl -d ata -a /dev/sda | grep Load_Cycle_Count

For this to work you will need the smartmontools package installed. For ubuntu users, this is done by executing:

sudo apt-get install smartmontools

The last number is what you are looking for. In this example the number is 13121:

$ sudo smartctl -d ata -a /dev/sda | grep Load_Cycle_Count
[sudo] password for asjo:
193 Load_Cycle_Count 0x0032 094 094 000 Old_age Always - 13121

You can monitor how the Load_Cycle_Count value changes by running the above command twice separated by 8 min:

sudo smartctl -d ata -a /dev/sda | grep Load_Cycle_Count ; sleep 480 ; sudo smartctl -d ata -a /dev/sda | grep Load_Cycle_Count

The difference of the last numbers of the two lines should not be too high. If you were using the machine a difference of zero would be sensible.

A solution

I followed this guide, which basically turns off powersave on the disk. This is what I did (replace /dev/sda where appropriate):

sudo su
cd /etc/acpi
rm -Rf hdd-spin-fix.sh
touch hdd-spin-fix.sh
chmod 755 hdd-spin-fix.sh
echo \#\!/bin/sh >> hdd-spin-fix.sh
echo hdparm -B 255 /dev/sda >> hdd-spin-fix.sh
ln -s ../hdd-spin-fix.sh start.d/99-hdd-spin-fix.sh
ln -s ../hdd-spin-fix.sh suspend.d/99-hdd-spin-fix.sh
ln -s ../hdd-spin-fix.sh resume.d/99-hdd-spin-fix.sh

Links

http://www.advogato.org/person/mjg59/diary/82.html

Advertisements

One Response to “Workaround solution to broken ACPI in laptop HDD’s”

  1. Return of the broken ACPI laptop disk problem « Aslak Johansen’s Weblog Says:

    […] of the broken ACPI laptop disk problem As reported earlier some laptop disks have a broken bios. The mentioned fix works for Hardy Heron (Ubuntu 8.04), but […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: