Ubuntu Demon\’s blog

October 27, 2007

Laptop Hardrive Killer Bug is worse than I thought

Filed under: english — ubuntudemon @ 9:40 am

This problem seems even worse than I thought. I’m looking at the Load_Cycle_Count of my new harddrive. I see 17 spin-down/spin-up cycles within 12 minutes.

The output of various :
$ date
$ sudo smartctl -a /dev/sda | grep Load_Cycle_Count

Sat Oct 27 11:17:28 CEST 2007
193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always – 501

Sat Oct 27 11:24:46 CEST 2007
193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always – 513

Sat Oct 27 11:28:59 CEST 2007
193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always – 518

I turned of my laptop, booted it from ac before generating this output.

More information about this bug :

To proof I’m not running in laptop mode here’s the output of $sudo laptop_mode status

Mounts:
   /dev/mapper/T--2500-root on / type ext3 (rw,noatime,errors=remount-ro)
   proc on /proc type proc (rw,noexec,nosuid,nodev)
   /sys on /sys type sysfs (rw,noexec,nosuid,nodev)
   varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
   varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
   udev on /dev type tmpfs (rw,mode=0755)
   devshm on /dev/shm type tmpfs (rw)
   devpts on /dev/pts type devpts (rw,gid=5,mode=620)
   lrm on /lib/modules/2.6.22-14-generic/volatile type tmpfs (rw)
   /dev/sda1 on /boot type ext3 (rw,noatime)
   securityfs on /sys/kernel/security type securityfs (rw)

Drive power status:

   /dev/sda:
    drive state is:  active/idle

(NOTE: drive settings affected by Laptop Mode cannot be retrieved.)

Readahead states:
   /dev/mapper/T--2500-root: 128 kB
   /dev/sda1: 128 kB

Laptop Mode is NOT allowed to run: /var/run/laptop-mode-enabled does not exist.

/proc/sys/vm/laptop_mode:
   0

/proc/sys/vm/dirty_ratio:
   10

/proc/sys/vm/dirty_background_ratio:
   5

/proc/sys/vm/dirty_expire_centisecs:
   3000

/proc/sys/vm/dirty_writeback_centisecs:
   500

/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq:
   996000

/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq:
   1992000

/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq:
   996000

/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_cur_freq:
   996000

/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_max_freq:
   1992000

/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_min_freq:
   996000

/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor:
   ondemand

/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor:
   ondemand

/proc/acpi/button/lid/LID/state:
   state:      closed

/proc/acpi/ac_adapter/AC0/state:
   state:                   on-line

/proc/acpi/battery/BAT0/state:
   present:                 yes
   capacity state:          ok
   charging state:          charging
   present rate:            unknown
   remaining capacity:      2391 mAh
   present voltage:         11736 mV

19 Comments »

  1. I’m a big fan of Ubuntu. I don’t want to see Ubuntu hurt because it’s not Ubuntu who is setting these aggressive power management defaults.

    Some background of the problem :

    If your harddrive spins down and spins up again your Load_Cycle_Count increases by one. If your harddrive head parks and unparks again your Load_Cycle_Count increases by one.

    You don’t want your Load_Cycle_Count to increase too fast.

    Harddrive manufacturers seem to claim most harddrives can handle at least 600.000 Load_Cycles but this is probably an average under ideal circumstances. My harddrive started to die slowly when at a Load_Cycle_Count of 200.000.

    Ubuntu is NOT causing aggressive power management.

    The following things might instead cause aggressive power management settings :

    * your (laptop) harddrive firmware might have aggressive power management defaults (operating system independent)
    * your (laptop) BIOS might set your harddrive to use aggressive power management (operating system independent)
    * you might have enabled laptop-mode in /etc/default/acpi-support (disabled by default) which will set your harddrive to use aggressive power management

    These aggressive power management settings are set by your BIOS or harddrive firmware. Windows and/or Mac OS X might be overriding these settings which might make Ubuntu look bad if Ubuntu doesn’t override these settings.

    Read here what Matthew Garret an experienced and well known Ubuntu Developer has said about this problem :
    http://www.advogato.org/person/mjg59/diary/82.html

    for more information see :
    https://bugs.launchpad.net/ubuntu/+source/acpi-support/+bug/59695

    Ubuntu is NOT causing aggressive power management


    If you think you might be suffering from this problem here’s an ugly fix :
    the ugly fix

    Comment by ubuntudemon — October 27, 2007 @ 9:51 am

  2. To discover whether you suffer from this problem :

    First install smartmontools to be able to query your harddrive :
    $ sudo aptitude install smartmontools

    To find your Load_Cycle_Count do this (the last number is the number we are interested in) :
    $ sudo smartctl -a /dev/sda | grep Load_Cycle_Count

    If this number is growing rapidly (more than 90 per day) then you suffer from this problem.

    Comment by ubuntudemon — October 27, 2007 @ 9:58 am

  3. How do you know that more than 90 per day is too high? On my Thinkpad T60, I’m at 28753 for 7 months, that’s roughly 137/day. Since I’m using this laptop almost every day for more or less 10 hours per day, this does not seem incorrect to me…

    Comment by Athropos — October 27, 2007 @ 2:14 pm

  4. Note that in some laptops the right setting instruction is sudo hdparm -B 254 /dev/sda

    (instead of 255)

    Comment by Polmac — October 27, 2007 @ 3:49 pm

  5. to Polmac :
    Thanks. Indeed some people need 254 instead of 255 according to the bug report.

    Comment by ubuntudemon — October 28, 2007 @ 11:44 am

  6. I used my new harddrive since tuesday evening. My Load_Cycle_Count is already at 861. I’m using the fix myself now.

    Comment by ubuntudemon — October 28, 2007 @ 11:52 am

  7. Well, maybe 90 will alarm people for no reason. As I said, I have an average of ~ 137/day, and I don’t think this is a ” rapidly growing number”.

    Here is the datasheet of my hard drive:

    Click to access 5K160_FINAL_DS.pdf

    It says that it can support up to 600 000 cycles. With 137/day, that’s a lifetime of around 12 years which is IMHO a correct lifetime. So I think that 90/day is not so high…

    Comment by Athropos — October 28, 2007 @ 1:49 pm

  8. to Athropos :

    The reason I’m saying to look for an average of more than 90 per day is because it will guarantee that your Load_Cycle_Count is less than 100.000 in three years : 90 * 365 * 3 = 98.550. As you can see I chose this number of 90 quite arbitrarily but it should almost guarantee that your harddrive won’t die during the first three years due to a high Load_Cycle_Count. It’s possible that a value below 180 per day is still okay (180 * 365 * 3 = 197.100).

    Harddrive manufacturers seem to claim most harddrives can handle at least 600.000 Load_Cycles but this is probably an average under ideal circumstances. My harddrive started to slowly die when at a Load_Cycle_Count of 200.000 after 10 months of use (Feisty and a little bit of Gutsy).

    I updated my blog post.

    Comment by ubuntudemon — October 29, 2007 @ 3:39 pm

  9. Wow… Just ran the command $date && sudo smartctl -a /dev/sda | grep Load_Cycle_Count

    Two results:
    Mon Oct 29 13:28:32 EDT 2007
    193 Load_Cycle_Count 0x0032 037 037 000 Old_age Always – 6378848898512

    Mon Oct 29 13:30:44 EDT 2007
    193 Load_Cycle_Count 0x0032 037 037 000 Old_age Always – 6378882452946

    Note, this is after running
    $ sudo hdparm -B 255 /dev/sda
    and
    $ sudo hdparm -S 0 /dev/sda

    The numbers I got before were not with the date command, so they are only estimates.
    6378496576955 ~ 11:30am
    6378714680776 ~ 1:00pm

    is that possible????

    Comment by David — October 29, 2007 @ 5:39 pm

  10. to David :

    In your case smartctl probably isn’t able to interpret the value but we can still look at your WORST and THRESHOLD.

    You should watch how fast your WORST (currently 37) is approaching your TRESHOLD (0) then you can roughly calculate how much lifetime your harddrive has left.

    37 seems a bit low. You should backup all your data and run the diagnostic tool of your harddrive manufacturer.

    Comment by ubuntudemon — October 29, 2007 @ 7:22 pm

  11. I’m a big fan of Ubuntu. I don’t want to see Ubuntu hurt because it’s not Ubuntu who is setting these aggressive power management defaults.

    Some background of the problem :

    If your harddrive spins down and spins up again your Load_Cycle_Count increases by one. If your harddrive head parks and unparks again your Load_Cycle_Count increases by one.

    You don’t want your Load_Cycle_Count to increase too fast.

    Harddrive manufacturers seem to claim most harddrives can handle at least 600.000 Load_Cycles but this is probably an average under ideal circumstances. My harddrive started to die slowly when at a Load_Cycle_Count of 200.000.

    Ubuntu is NOT causing aggressive power management.

    The following things might instead cause aggressive power management settings :

    * your (laptop) harddrive firmware might have aggressive power management defaults (operating system independent)
    * your (laptop) BIOS might set your harddrive to use aggressive power management (operating system independent)
    * you might have enabled laptop-mode in /etc/default/acpi-support (disabled by default) which will set your harddrive to use aggressive power management

    These aggressive power management settings are set by your BIOS or harddrive firmware. Windows and/or Mac OS X might be overriding these settings which might make Ubuntu look bad if Ubuntu doesn’t override these settings.

    Read here what Matthew Garret an experienced and well known Ubuntu Developer has said about this problem :
    http://www.advogato.org/person/mjg59/diary/82.html

    for more information see :
    https://bugs.launchpad.net/ubuntu/+source/acpi-support/+bug/59695

    Ubuntu is NOT causing aggressive power management


    If you think you might be suffering from this problem here’s an ugly fix :
    the ugly fix

    Comment by ubuntudemon — October 30, 2007 @ 7:49 pm

  12. to David :

    I updated my answer to you here :

    Laptop Hardrive Killer Bug is worse than I thought

    Comment by ubuntudemon — October 31, 2007 @ 2:24 pm

  13. The smartctl values aren’t always easy to interpret. If the Load_Cycle_Counter value behaves as a counter and is below impossible to reach values it’s probably the right number.

    You can also look at “WORST” and “TRESHOLD” (|more instead of |grep to easily see which value is “WORST” and which value is “TRESHOLD”) :
    $ sudo smartctl -a /dev/sda | more

    If WORST is lowering (too fast) than you might be suffering from this problem. You can roughly calculate how long it will take for WORST to reach TRESHOLD if you keep watching those values daily/weekly. The closer WORST (starts at 100 or 200 from what I have seen) is to THRESHOLD the likelier it is for your drive to die from a high Load_Cycle_Count.

    From https://bugs.launchpad.net/ubuntu/+source/acpi-support/+bug/17216/comments/40 :
    [quote=Brian Visel]

    Something to bear in mind as well:

    smartmon does not always report SMART values as you might think. Different values are stored in different ways by different manufacturers.

    Namely, if you do the smartctl check, wait for the click, and do it again immediately after, you may find that the amount has increased by more than one. In this case, it’s a pretty safe bet that the number you’re seeing isn’t accurate.

    Also, it’s a pretty safe bet (though not guaranteed) that you can get the real value by dividing by the amount it increments by. So, if the value you see first is 477,296, and then it clicks once, and the value is 477,312 (difference of 16), it’s a pretty safe bet that the number you’re really dealing with is more along the lines of 29,831 to 29,832, in which case you have no worries.

    [/quote]

    If you think you might be suffering from this problem you might want to apply the ugly fix :

    Laptop Hardrive Killer Bug

    If you think your harddrive might start dying soon you should make backups of all your data and run the diagnostic tool of your harddrive manufacturer.

    Comment by ubuntudemon — October 31, 2007 @ 2:49 pm

  14. I have combined all active threads about the “laptop harddrive Load_Cycle_Count issue” on the ubuntuforums.

    People who have support questions can ask them here :
    http://ubuntuforums.org/showthread.php?t=591503

    Comment by ubuntudemon — November 1, 2007 @ 1:16 pm


RSS feed for comments on this post. TrackBack URI

Leave a comment

Create a free website or blog at WordPress.com.