It's the same as everyone else's personal site... or is it? More...
I'm a college stud(ent). More...
All proceeds from the sale of The Easiest Best Thing Is Be Kind go to the Save Darfur Coalition. Plus, I'm in it!
For those of you using Ubuntu 7.04 ("Feisty Fawn") or 7.10 ("Gutsy Gibbon") on a laptop, there might be some unexpected behavior that's affecting the life of your hard drive. I don't really understand the technical points of it, but basically, these versions of Ubuntu allow the hard drive to use its own power management settings, which are sometimes too agressive and actually harmful.
The following information is collected from several sources that are linked at the end. It fixed the problem for me, but your mileage may vary.
To see if your computer is affected, download the smartmontools package:
sudo apt-get install smartmontools
Once that's installed, enter
sudo smartctl -A /dev/sda
and check the values given under Load_Cycle_Count and Power_On_Hours. Divide Load_Cycle_Count by Power_On_Hours to see how many load cycles your hard drive has gone through per hour. If it's more than 15 or so, there's a problem. When I first checked, my Load_Cycle_Count was 46,270 and my Power_On_Hours were 837 -- an average of over 55 cycles an hour, or almost one per minute. About two hours later, the drive had gone through 213 more cycles. A typical hard drive is rated for 600,000 of these cycles.
To fix the problem immediately, enter
sudo hdparm -B 254 /dev/sda
where /dev/sda is your hard drive. (It might or might not be different for you.) That setting tells the computer to pursue the power management less aggressively, and it will stick until you reboot. To get it to change permanently, edit the following files (and be sure to save a backup of each in case something goes wrong).
Add these lines to the end of /etc/laptop-mode/laptop-mode.conf (gksudo gedit /etc/laptop-mode/laptop-mode.conf):
CONTROL_HD_IDLE_TIMEOUT=1
LM_AC_HD_IDLE_TIMEOUT_SECONDS=300
LM_BATT_HD_IDLE_TIMEOUT_SECONDS=300
NOLM_HD_IDLE_TIMEOUT_SECONDS=7200
CONTROL_HD_POWERMGMT=1
BATT_HD_POWERMGMT=254
LM_AC_HD_POWERMGMT=255
NOLM_AC_HD_POWERMGMT=255
Add these lines to the end of /etc/default/acpi-support (gksudo gedit /etc/default/acpi-support):
ENABLE_LAPTOP_MODE=true
SPINDOWN_TIME=60
Finally, edit /etc/acpi/power.sh (gksudo gedit /etc/acpi/power.sh) to replace all occurrences of
$HDPARM -B 1 /dev/$drive 2>/dev/null
with
$HDPARM -B 254 /dev/$drive 2>/dev/null
And that's it. In the two hours after I applied those changes, there were only 4 cycles. During the next two hours, there was 1. It seems that my laptop's battery life was reduced slightly by these fixes, which would make sense considering what we did. But that's fine; it's better to have a dead battery than a dead hard drive.
Nitpickers may contact me with corrections.
Created December 5, 2007.