Ubuntu May Be Killing Your Laptop's Hard Drive
wwrmn writes "There's a debate going on over at bugs.launchpad.net on whether it's the Ubuntu, BIOS, hard-drive manufacturer, or pick-any-player's fault, but Ubuntu (and perhaps any OS) may be dramatically shortening the life of your laptop's hard drive due to an aggressive power-saving feature / acpi bug / OS configuration. Regardless of where the fault lies or how it's fixed, you might want to take some actions now to try to prevent the damage."
I just got two Thinkpads at auction I wanted to put Ubuntu on. Launchpad is hit so hard I can't even subscribe to the bug to search for potential workarounds or better settings. :(
Something's goofy... I just switch my Inspiron 9400 to battery power. It's only been about 10 minutes, but so far my Load_Cycle is sticking at 1 where it started. I'm not seeing this problem. It might be laptop-specific.
Beer is proof that God loves us, and wants us to be happy.
Windows 3.1x calc: 3.11 - 3.10 = 0.00
From Google's cache:
/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.
/dev/sda /etc/acpi/suspend.d/ /etc/acpi/resume.d/ /etc/acpi/start.d/
/etc/laptop-mode/laptop-mode.conf, setting
When switching to battery power,
The command hdparm -b 255 turn off completely APM.
Here is how I permanently fixed it:
1) make a file named "99-hdd-spin-fix.sh". The important thing is starting with "99".
2) make sure the file contains the following 2 lines (fix it if you have PATA HDD):
#!/bin/sh
hdparm -B 255
3) copy this file to 3 locations:
Voila! After that the HDD never spins down on power (looks like it actually spins down on battery at modest rate).
Sorry if the instruction is too detailed, no offense.
An alternative to the "99-hdd-spin-fix.sh" fix is to install and enable the package laptop-mode-tools,
then customize
Got Trader Joe's? friendwich.com RSS feeds work now!
According to gentoo-wiki.com/MAN_hdparm -B is:
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.
I would say blame the hard drive vendor.
This space is not for rent.
Here's the fix http://ubuntuforums.org/showthread.php?t=596602
Actually, if you R(TRO)TFA, you'll find that Ubuntu is not issuing that command at all. Rather, this is a default set by the drive manufacturer.
I have seen the future, and it is inconvenient.
First off, putting a launchpad link on the frontpage of Slashdot is bad form. Launchpad is for discussing and resolving bugs, and we're not helping by swamping that page. It might be better if people read the wiki that has been set up to summarize the issue.
In answer to your question about how this isn't Ubuntu's fault, apparently the problem is that the manufacturer sets certain default values for "aggressive power management" and enables this aggressive power management by default. Ubuntu's policy is to not change the manufacturer defaults, and simply uses them. Unfortunately these defaults are "too aggressive" and cause the hard drive to park/unpark too frequently.
But Ubuntu is not blameless. First of all, if Ubuntu can push out a patch that resets the manufacturer defaults to sane values (and this will save some people from hard drive failures), then it definitely should. Also, there is some discussion that perhaps an Ubuntu daemon is probing the hard disk too frequently, so that the hard-drive can't sit in the parked state for long enough to actually make it a useful feature.
Regardless of who is to blame, it would appear that the Ubuntu devs should push out a patch that forces systems to ignore the manufacturer values, and use settings that will protect the drive lifetime.
Ive tested on 3 Ubuntu laptops here and found no problem. Here's a little script to test yourselves (can't remember where i found the greppable bit - perhaps a Planet Ubuntu author).
/dev/sda with your own drive. Not sure which? sudo fdisk -l. You'll need smartmontools (sudo apt-get install smartmontools).
/dev/sda | grep Load_Cycle_Count` " | " `date` >> load_count
Run this every hour and compare differences in the load count (the last value in the output written to the file 'load_count' in the current directory).. Replace
echo `sudo smartctl -a
If the difference in this count is more than 90 from one hour to the next you may be in trouble if there is anything to this wear and tear fear.
The new screens and graphics control panel is added to gnome so that you can now do this out of the box.
It shows two screens, and you can dual screen it or switch screens from the control panel. You may have to restart X for changes to take effect, however it is much better than it used to be. I had no problems selecting the right resolution for my computer (1280x1024).
AS for the hard drive throttling, that could be a serious issue, and one I am sure they will try to fix asap, especially with a Long Term Support version coming up next. They want that thing as bug free and stable as it can get, and something like this could hurt their rep. On the other hand, who's to say other OS's/distros aren't doing the same thing?
I have an Dell Inspiron 6400 running Gentoo. I had this problem too. I fixed it by adding
/etc/conf.d/hdparm. This would fix the issue on boot, but after resuming, this would be moot. For that, I added
/etc/init.d/hdparm restart
/etc/acpi/suspend.sh in /etc/acpi/default.sh, though I suppose I could have put that line somwhere in suspend.sh.
# -B 255 doesn't work for me
sda_args="-B 254 -S 60"
to
# redo hdparm settings on resume
after running
The key thing here is to run hdparm on boot *and* on resume
You can set XP to show a bluescreen instead of just rebooting. I'm guessing you had it set to just reboot instead.
Arguing about vi versus Emacs is like arguing whether it's better to make fire by rubbing sticks or banging rocks.
> I mean, if it was Windows that was destroying laptop hard drives, this would have been a
> legendary thread, with viciously bashing comments, insightfully (40%) funny (20%) attacks
> against MS, Vista drama etc.
Of course, because all laptops are DESIGNED for Windows so if it doesn't work abuse and ridicule should be heaped on them if it was hitting multiple hardware vendors with the only common factor the OS vendor.
But this case is tricky. I just read through the thread and most people there are paniced sheep just turning off all power management because they don't EVER want the hdd to unload. They don't understand the three year replacement cycle all PC hardware is designed around, it is BUILT to FAIL. Looks like there IS a problem of some sort though because some people are reporting unload followed almost instantly by a load. But power management remains one of the areas of PCs that vary wildly in totally undocumented ways not only from vendor to vendor and model to model but from minor BIOS revisions. It is a non-trivial problem.
Democrat delenda est
Damn you cursed slashdot! There was a newline in there!
/etc/init.d/hdparm restart
/etc/acpi/default.sh
# redo hdparm settings on resume
in
You may not have to. My Toshiba Satellite M45 has been running Ubuntu since Edgy, 6.10 and has a "Load_Cycle_Count" of 5,416. Maybe the default install does not have this issue? Maybe you have to install some other package to create the problem? It's not "laptop-mode-tools" because I have that installed. Do you have to be on battery power?
It's still 5,416.
A great many people think they are thinking when they are merely rearranging their prejudices. -- William James
http://mjg59.livejournal.com/77672.html
Matthew garret, who runs the laptop testing team. Read this, instead of just spreading FUD.
I have been running noatime for as long as I have been running Ubuntu and still had been seeing insanely high load cycle counts until I applied the hdparm -B fix. There is something else going on.
Mine hasnt died, but i did notce that it will loudly park out of the blue every so often while im using it. ( with kubuntu, so they didnt make any changes )
Time to try the fix, once the site comes back up from oblivion.
---- Booth was a patriot ----
preferences -> homepage -> uncheck crappy authors
I have Zonk unchecked. Forget why.
evil adrian
Exactly. See this article on thinkwiki about the problem. This is obviously HDD or HDD-controller specific, and is therefore a hardware vendor problem, not an Ubuntu problem. The article is FUD.
My blog
My company just issued me a Lenovo T60 laptop *yesterday*. I installed Kubuntu 7.10 *last night*. Prior to that it has had Windows XP on it since it was purchased via a corporate sale from Lenovo. It is about 15 months old and the value in question looks like this:
193 Load_Cycle_Count 0x0032 001 001 000 Old_age Always - 2144751
That is 2,144,751 in case the lack of commas throws you. This is just a tad more than the 600,000 that was mentioned in the original bug report, so I don't know out of who's hat that number was pulled.
For completeness, here is the drive info.
Model Family: Seagate Momentus 7200.1 series
Device Model: ST96023AS
Serial Number: 3MG06BZ3
Firmware Version: 4.06
Learning HOW to think is more important than learning WHAT to think.
It's already been posted, but apparently no one's reading it
/etc/acpi/power.sh. The relevant sections are:
... /dev/$drive 2>/dev/null /dev/$drive 2>/dev/null
/etc/default/acpi-support). This means that, by default, we do not alter the hard drive power settings. In other words, the APM settings that your drive is using in Ubuntu are the ones that your BIOS programmed into it when the computer started. This is supported by the fact that people see this issue after resuming from suspend. We don't touch the hard drive settings at that point, so the only way it can occur is if your BIOS or drive default to this behaviour.
=====================
Linux-hero wrote about how Ubuntu kills your hard drive. The situation is somewhat less clear than you might think from the article, but the basic takeaway message is that Ubuntu doesn't touch your hard drive power management settings by default. In almost all cases, it's more likely to be your BIOS or the firmware on your hard drive.
The script that's executed when you plug or unplug your laptop is
function laptop_mode_enable {
$HDPARM -S $SPINDOWN_TIME
$HDPARM -B 1
}
That is, when the laptop_mode_enable function is called, we set the drive power parameters. Now, by default laptop_mode_enable isn't called:
if [ x$ENABLE_LAPTOP_MODE = xtrue ]; then
(sleep 5 && laptop_mode_enable)&
fi
because ENABLE_LAPTOP_MODE is false in the default install (check
If you enable laptop mode, then we will enable aggressive power management on the drive and that may lead to some reduction in hard drive lifespan. That's a fairly inevitable consequence of laptop mode, since it only makes sense if the laptop enages in aggressive power management. But, as I said, that's not the default behaviour of Ubuntu.
There's certainly an argument that we should work around BIOSes, but in general our assumption has been that your hardware manufacturer has a better idea what your computer is capable of than we do. If a laptop manufacturer configures your drive to save power at the cost of life expectancy, then that's probably something you should ask your laptop manufacturer about.
=====================
Don't fall prey to 'Digg-ish' sensationalism. You all are supposed to know better over here.
Senior NCO in the fight against entropy. I've seen things, man. Things no one should have to see.....
Sorry - forgot the link!
http://mjg59.livejournal.com/77672.html
Senior NCO in the fight against entropy. I've seen things, man. Things no one should have to see.....
Bull. The OS should NOT be mucking around with changing low-level hardware device settings. Ubuntu is doing EXACTLY what they should be doing in honoring the existing hardware configuration, whether set by the manufacturer or directly by the user. This 'bug' is FUD pure and simple from people who understand just enough to be dangerous.
Now if there is, in fact a daemon causing too frequent disk access for power management to work properly, then that bug should be fixed. Pushing a patch to change people's power management settings is exactly the wrong thing to do as it treats the symptom, not the cause. I've had this same behavior on my XP laptop too, but recognized that it was a bug in a program and took steps to fix the program. If Windows had automatically changed my drive's power management settings I'd both likely not noticed the bug in the program AND had worse battery life. Yeah!
- Disk 1:
- Seagate ST96023A (Seagate Momentus 7200.1 series)
- Power_On_Hours 1438
- Load_Cycle_Count 187925
- 130 load/unload per hour (roughly 2 per minute)
- Disk 2:
- Hitachi HTS721010G9SA00
- Power_On_Hours 818
- Load_Cycle_Count 90539
- 110 load/unload per hour (roughly 2 per minute)
- Disk 3:
- TOSHIBA MK6006GAH
- Power_On_Hours 2896
- Load_Cycle_Count 199757
- 68 load/unload per hour (roughly 1 per minute)
Then I've been monitoring the hard drive with this one-liner. Before you ask, it is only one line, as you only press enter onceThis shows on all three laptops that the load counts increases by 1 to 4 every minute.
Now I issued:
This has stopped load cycles on two drives.The third one (the TOSHIBA MK6006GAH) still continues loading and unloading like hdparm did not help at all.
However, setting the power-management level to "lowest power savings mode" with:
did prevent any more load/unload cycles from happening.So in summary:
God I hate incompetent comments.
The comments in the bug report speculate that Windows either completely ignores this feature, or ignores the manufacturer values and uses its own values. (In either case, what's the point in having BIOS set defaults?)
Uhm. The OS doesn't actually issue the command to the disk, you know. The disk has it's own defaults. And does the sanity stuff by itself. The OS however, might _overwrite_ those things, and ask the disk to "hey, behave more nicely, will you? I'm not interested in you burning out. Use these values instead you idiot.".
The more likely explanation is that the manufacturer set the defaults, but didn't notice that the values were unsafe because Windows ignores them.
If windows ignores them, the disk continues to do it - so no, no game for you.
"Rune Kristian Viken" - http://www.nwo.no - arca
Hard drive sleep time != ACPI aggressiveness setting.
You can set that as high as you want, and the drive will still use its internal setting to sleep more frequently if it is configured to. All the windows setting does is set how long Windows will wait before sending an explicit command to the drive to tell it to sleep.
Nice guess though.
You could tune a notebook mode to eliminate most or all of the web browser disk accesses, turn off history, caching, swapping to disk, etc. However, especially with a notebook, you would want aggressive autosaving in case the battery suddenly dies.
You are assuming that the raw numbers (142886 and 143016) are actual counts of head unparks. they may not be. It is very common for laptop drives to spit out uncalibrated numbers (e.g. my laptop claims to unpark the heads 80,000 times a second, which physically isn't possible and would wear out the disk (if the highly dubious 600,000 figure is correct) in under a minute)
far more useful in SMART are the VALUE WORST THRESH and TYPE columns. Since Load_Cycle_Count is an Old_age value, and the THRESH is 0, it means that it starts at 100 and goes down as the drive ages. When it reaches 0 it means the drive manufacturer believes that is roughly equivalent to the useful duty life of the drive.
Currently yours is on 86, so it's actually only down 14%, which gives you nearly 3 more years of likely life from it. That is about typical of modern laptops afaics.
A far more useful test here would be to run the same test on Ubuntu and Windows on the same hardware (there is a smartctl port at http://hdparm-win32.dyndns.org/hdparm/ )
Given that Ubuntu does not change the disk power management settings in your BIOS and/or hard disk firmware, the only variable here is whether or not Windows overrides those settings with more or less conservative values than the existing defaults (and of course it's possible that your OEM pre-installs with other settings than Windows would natively choose on a vanilla install).
For all of the screaming and wailing about Ubuntu killing disks I have not seen a single post anywhere where anyone has posted any kind of hard data that Ubuntu is behaving in any way differently to other operating systems. Ergo this is still very very much unproven - unless anyone can link to something that says otherwise?
Cheers,
Chris "Ng" Jones
cmsj@tenshu.net
www.tenshu.net
A windows user who knows what SMART is could go right ahead and download any one of the dozen free tools available. An Ubuntu user who doesn't know what it is isn't going to be helped out a whole lot by it being there.
HD Tune and Speedfan are among the better utils:
http://www.hdtune.com/
http://www.almico.com/speedfan.php
Nerd rage is the funniest rage.
Please post the outputs of your testing to the bug on launchpad so the relevant developers can assess the results.
Chris "Ng" Jones
cmsj@tenshu.net
www.tenshu.net
This isn't just Ubuntu, I just fired up my 5-year-old laptop with Debian from 2 years ago installed on it (haven't used it in 2 years) and smartctl gives me 184,305 load cycles in 2179 power on hours. The hard drive clicks every 30 seconds or so when idle (I noticed it before but assumed it was something messing around with the disk). hdparm -B 254 /dev/hda stops it from going up any more.
but there is more, power mode status
and of course spindown timer So there is a middle ground, if your drive supports it, hdparm -I will also yeild some interesting information about what features the drive will support. Just turning the power management off seems like a bit of a knee jerk reaction, especially when adjusting the amount of power management applied to the drive should deliver both i.e hdparm -B 196 YMMV.I would have thought that spindown timer would be more relevant to apply, one other thing I've never found hard drives tuned to thier maximum throughput in a linux installation (I mainly use Fedora) so an investigation of the udma modes your drive will support may be a worthwhile investment in time see hdparm -X _some_number_here_ (RTFM - first) considering just about everything goes better when you do tune it right.
My ism, it's full of beliefs.