PDA

View Full Version : Ubuntu Killing Hard Drives?


C J Pro
10-25-2007, 01:01 AM
I just came across some rather interesting bug reports that show that running Ubuntu can cause hard drives to fail sooner than normal, particularly with Feisty and Gutsy.

I run feisty (beta) on a Dell Inspiron 9400 with a Hitachi HTS541616J9SA00 hard drive. After booting, the drive's power management settings are such that it spins down A LOT. To give you some statistics: the drive is rated for 600,000 load/unload cycles, and after 2.5 months of running Feisty I'm already at more than 56,000 load/unload cycles (and only 150 power cycles), according to the SMART data. At this rate the drive will be dead after 2.5 years, and I don't even use this computer for more than a couple of hours each day. The fix? I have to do: hdparm -B 255 /dev/sda
and the spinning-down stops. I don't know what certain other OSes do with their drives at bootup, but the current behaviour is certainly deadly for the drive. Worse: nobody will notice, since smartmontools aren't installed by default. I noticed frequent clicking sounds earlier, but I didn't think those were spindowns since I hadn't specifically set the drive into any low-power mode. I only noticed this by accident after I got smartmontools working.

https://bugs.launchpad.net/ubuntu/+bug/104535


When switching to battery power, /etc/acpi/power.sh issues the command hdparm -B 1 to all block devices. This leads to extremely frequent load cycles. For example, my new thinkpad has already done well over 7000 load cycles -- in only 100 hours. That's at least one unloading per minute. Googling for "load unload cycles notebook OR laptop" shows that most laptop drives handle up to 600,000 such cycles. As these values clearly show, this issue is of high importance and should be fixed sooner rather than later.
Please see for yourself how often your drive is load cycling:
smartctl -d ata -a /dev/sda
(This command is for an SATA drive; you'll need to install the smartmontools package first.)
See also http://paul.luon.net/journal/hacking/BrokenHDDs.html for a rather dramatic account of the effects the current default values may have.
Just in case the load/unload timeout depends on the specific laptop or disk model, here are my system specifications:
ThinkPad Z60m & Hitachi HTS541080G9SA00 disk (80GB)

https://bugs.launchpad.net/ubuntu/+source/acpi-support/+bug/59695

Garritan
10-25-2007, 02:14 AM
http://www.linux-hero.com/rant/explanation-ubuntu-hard-drive-wear-and-tear

"The solution, as the original poster pointed out, is relatively simple:


“The fix?


hdparm -B 255 /dev/sda
and the spinning-down stops. I don't know what certain other OSes do with their drives at bootup, but the current behaviour is certainly deadly for the drive. Worse: nobody will notice, since smartmontools aren't installed by default. I noticed frequent clicking sounds earlier, but I didn't think those were spindowns since I hadn't specifically set the drive into any low-power mode. I only noticed this by accident after I got smartmontools working.”


What does that command do? Let’s break it down.
hdparm: This is a linux command designed to fetch and set certain attributes of ATA/IDE hard drives.
The -B: Set Advanced Power Management feature, if the drive supports it. A low value means aggressive power management and a high value means better performance. A value of 255 will disable apm on the drive.
and /dev/sda is obviously the disk drive in question.


A relatively simple fix for a somewhat complicated problem. The only issue here is that battery life will be adversely affected, however that’s better than having a hard drive that’s dead two years after you bought it. It will be interesting to see how the Ubuntu team decides to handle this. As of yet, the trouble ticket is unassigned."

jeremy.saenz
10-25-2007, 02:19 AM
Cool past thanks Gary, i will try it tomorrow morning