Tuesday, April 08, 2008

My harddrive is killing it self !!

this is a shocking news -for me atleast-, just found out that there are some cases, where people using ubuntu on their laptop had some issues with their harddisk. unfortunately those people include me T_T...

i've learn that my harddisk come with installed firmware that control power_management so called APM(advanced power management) most of modern harddisk does, so what this APM do? dont know exactly but from what i've read it control anything that can be set in harddisk's firmware to reduce power consumption, one of them is how often a head of an harddisk parked(stop hovering on the plate). The more often harddisk's head parked, more power are saved -CMIIW-, an this is the one that cause trouble. Because default power_management setting on my laptop's harddisk is just to aggresive, it keeps parking it head down even when i'm still using it!, i can tell this from looking at my harddisk loadcyclecount, time to time.

$ sudo smartctl -a /dev/sda | grep Load_Cycle_Count

this number increasing too fast! about 1 load cycle per-minute O.o!!
Yes this will save power -eventually also reduce harddisk temperature- but the scary thing is, this number is limited! average modern harddisk's max loadcycle is at least 600.000, so if i calculate my harddisk will only last for about 3-4 years max!!. I just dont like it!, luckly theres a workaround(ofcourse there's always a workaround :p), first check your default apm value(just incase something went wrong)

$ sudo hdparm -I /dev/sda | grep Advanced

then, we can just shut down apm with (they said this wont work in some laptop)

$ sudo hdparm -B 255

or use less aggresive setting (this one work for me)

$ sudo hdparm -B 254

one thing to kept in mind, this setting may increase harddisk's temperature, and this may do more harm than good, so make sure you really want to do this, and do this carefully! keep watching your harddrive status(loadcycle, temperature, etc..) use smartctl for this, until you sure this is ok! otherwise revert back.

if above configuration is working for you we can make this a little easier and automatic. make sure you have laptop-mode-tools installed

$ sudo apt-get install laptop-mode-tools

then edit file /etc/laptop-mode/laptop-mode.conf

# let laptop-mode tool control power management setting

# this is hdparm -B values, use your own configuration with care
BATT_HD_POWERMGMT=128 # value to be used in battery mode
LM_AC_HD_POWERMGMT=254 # value to be used in AC mode with laptop-mode enable
NOLM_AC_HD_POWERMGMT=254 # value to be used in AC mode without laptop-mode

then, update file /etc/default/acpi-support, and change the value in line

# off by default


hmm, thats about it, my opinion is this isnt ubuntu's bug, because ubuntu doesnt change nor override harddisk firmware configuration, it is left as is, (well.. maybe they should)

No comments: