Interesting article i just found...
Ubuntu bug causes unnecessary wear and tear on a hard drive, however there is a simple fix
A recent bug report for Ubuntu Linux has confirmed that both the Feisty and Gutsy versions of Ubuntu cause some unnecessary wear and tear on a hard drive. The bug report reads:
“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.”
Definitely an interesting sounding find. But what exactly does it mean? That's what I thought when I read it, so I did a little research. Feel free to comment and correct me if I've gotten anything wrong.
Load/Unload refers to a device that controls the position of the sliders on a hard drive. If you think about a hard drive as an old fashioned record player, the platters of the hard drive would be the record, while the sliders on the hard drive would be the needle. The only difference here is that the sliders never actually make contact with the platters. Instead, an air current provided by the platters rotating keeps the slider and the platter apart by a precise distance known as the flying height. Significant damage to the disk could occur if the slider was in contact with the platter during a sudden jarring moment (like dropping your laptop). To provide a bit of safety in mobile applications (and in some cases desktop as well) load/unload technology was introduced. Essentially, there is a small device that moves the slider off the platter. When data needs to be accessed, the sliders position themselves back over the platters and make contact with them only once they’ve reached the proper rotational speed.
To apply what we’ve just learned, the drive reported has a life span of 600,000 load/unload cycles before the precisely machined tolerances in the drive begin to deteriorate. Somewhere along the line, the drives are being asked to spin down very frequently. These are factors controlled by a power management utility within the drive called Advanced Power Management, or apm, and are dictated by Ubuntu after boot-up. The problem is simply that the drives are spinning up and down too often, and the sliders are being forced to roll on and off the ramp where they’re stored when in off use, causing wear and tear on the slider assembly (not to mention the motor spinning the drive).
The solution, as the original poster pointed out, is relatively simple:
“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.”
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.
Explanation of Ubuntu Hard Drive Wear and Tear | Linux-Hero.com