slayne_souls (slayne_souls) wrote in linux,
slayne_souls
slayne_souls
linux

Ubuntus Destruction to hardrives--Bug59695

Oy vey, I had to find out the hardway with my HDD dropping Dead so heres a lesson I wish I knew Sooner.

It [WWW] appears to be the official policy of Ubuntu that by default, Ubuntu should not adjust any power management settings of the harddisk. Unfortunately, this policy has two negative effects: It leaves quite a few people with broken hard drives that would otherwise not be broken, and it quite simply makes people who love Ubuntu feel neglected. This issue has been going on a long time.

There appear to be two issues here: HDD spin down and "Power cycling", whereas the first one has a [WWW] relative short default (60 seconds), but the latter one gets the most complains (it's about Load_Cycle_Count).

The disk Load_Cycle_Count issue appears to be caused by a combination of two problems -- The first is overly-aggressive power management from what might be considered buggy hardware. The second is that Ubuntu appears to be touching the hard drive on a regular basis for one reason or another.
In sections below relating to how to prevent damage to your hard disk, you should replace $HDD everywhere with your device, e.g. "/dev/sda" or "/dev/hda". If you have several harddrives, you need to change it accordingly and duplicate lines in workarounds.


Check

You can check the current value of Load_Cycle_Count of your harddrive(s) using:

*

sudo smartctl -a $HDD | grep Load_Cycle_Count

(You need the smartmontools package for this. I also had to enable SMART monitoring for my drives using sudo smartctl -s on $HDD)

The values for this differ a lot (e.g. it's 0 on my desktop), but it goes up to > 600.000 for others, depending on the lifetime. TODO: add a section with sample values (including the value of Power_On_Hours).


Workaround

Various workarounds have been provided.

Try hdparm -B 255 $HDD or hdparm -B 254 $HDD. (255 is supposed to disable APM, but it does not work for some; so 254 sets it to the less aggressive setting)

There are different methods to keep this setting after reboot/resume. Your mileage may vary. There may be more workarounds in the bug report, but essentially, all are using "hdparm -B" to change the apm handling of the harddrive.

Force hdparm values in acpi hooks

Create a file called 99-fix-park.sh (keep the '99-' and the '.sh', but you can name the file as you like otherwise) with the following two lines:

#!/bin/sh
hdparm -B 254 $HDD

and copy it to the following directories: /etc/acpi/resume.d/ and /etc/acpi/start.d/ ([WWW] https://launchpad.net/ubuntu/+source/acpi-support/+bug/59695/comments/10)
laptop-mode-tools

Don posted another workaround: Install laptop-mode-tools and set CONTROL_HD_POWERMGMT=1 in /etc/laptop-mode/laptop-mode.conf (
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 4 comments