Slashdot Log In
Ubuntu May Be Killing Your Laptop's Hard Drive
Posted by
kdawson
on Tue Oct 30, 2007 01:19 PM
from the saving-power-at-what-cost dept.
from the saving-power-at-what-cost dept.
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."
Related Stories
[+]
IT: Ubuntu's Laptop Killing Bug Fixed 271 comments
jeevesbond writes "Back in October of 2007 we discussed a bug that would dramatically shorten the life of laptops using Ubuntu. Ubuntu users will be glad to know that a fix has finally been released for Ubuntu versions 9.04, 8.10 and 8.04 (LTS). However, as this fix is not yet in the update repositories, anyone wishing to test it should follow these instructions for enabling the 'proposed' repository. Report your results on the original bug report. Happy testing!"
This discussion has been archived.
No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Full
Abbreviated
Hidden
Loading... please wait.
The Ubuntu (Score:3, Insightful)
Re:The Ubuntu (Score:5, Informative)
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.
Parent
Re:The Ubuntu (Score:5, Informative)
Parent
Re:The Ubuntu (Score:5, Informative)
Parent
Re:The Ubuntu (Score:5, Funny)
Parent
Re:The Ubuntu (Score:5, Informative)
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.
Parent
Re:The Ubuntu (Score:5, Interesting)
Parent
Re:The Ubuntu (Score:5, Insightful)
A conspiracy theorist might suggest that the hardware manufacturers are intentionally adding a feature that causes the drives to fail eventually (but statistically outside of the manufacturer's warranty period), so that people have to buy more hardware. The more likely explanation is that the manufacturer set the defaults, but didn't notice that the values were unsafe because Windows ignores them.
Getting Ubuntu to override the defaults should be viewed as a short-term solution. Ultimately the hardware manufacturers should be setting default values that will not damage the hardware. Ideally they would design safeties into the hardware, which do sanity checks and reject ridiculous values.
Parent
Re:The Ubuntu (Score:5, Funny)
Then you must be a real masochist to keep hanging around here.
Parent
Re:The Ubuntu (Score:5, Insightful)
Parent
Re:The Ubuntu (Score:4, Insightful)
Parent
Re:The Ubuntu (Score:4, Interesting)
It seems like most of the things that are desirable for a server that are merely OK on a desktop are probably really bad for laptops and there's optimizations to be made.
And I'm not just thinking of Linux here. When I use a Windows laptop, I notice the hard disk spinning up on a fairly regular basis, even when I'm doing something fairly lame like web browsing or word processing. And you know that pretty much nobody thinks about it without being prodded....
But with Linux, you could make "Lapbuntu" that would contain a set of apps that were modified to aggressively avoid using the disk unless it's already spun up by patching existing software.
Parent
Re:The Ubuntu (Score:5, Informative)
# -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
Parent
Ubuntu FOUND the problem (Score:5, Interesting)
So, it comes down to: Ubuntu users were able to diagnose the problem, and have the tools to implement a workaround. Nix to either for Windows users -- they just need to remember to replace their drive once a year.
Parent
Re:Ubuntu FOUND the problem (Score:4, Informative)
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.
Parent
Re:The Ubuntu (Score:5, Funny)
Parent
Ubuntu (Score:4, Funny)
Re:Ubuntu (Score:4, Funny)
Parent
Re:Ubuntu (Score:4, Funny)
Parent
no problem, really! (Score:5, Funny)
Re:no problem, really! (Score:5, Informative)
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.
Parent
Re:no problem, really! (Score:4, Insightful)
I'd say it's more of hard drive manufacturer issue. I have 3 notebooks all running Ubuntu, and the one with a Hitachi HD had this problem, but the other two with Fujitsu HD's didn't. Luckily it took about 5 seconds to fix it. If the manufacturer set a realistic cycle this wouldn't be an issue. Ubuntu is just telling the hard drive to do it's thing, and unfortunately the hardware is set to commit suicide it seems.
Parent
Prevent damage?? (Score:5, Funny)
Once they control the fire and get the backup server online, maybe I'll be able to RTFA.
AHA! :D (Score:4, Funny)
^_^
Re:AHA! :D (Score:5, Insightful)
Parent
Re:AHA! :D (Score:5, Funny)
Gasp!
Parent
Ubuntu? (Score:5, Insightful)
Isn't this what is supposed to happen? (Score:5, Insightful)
May i just warn ya all to NOT play the blame-game?
It does sound like it's the fault of the BIOS (and somebody should contact them).
To rescue a hard-drive in distress sounds like something that should have a high-priority (critical?).
Not because it's ubuntu's fault or the bios fault. But because Ubuntu can solve this issue _now_.
Old news??? (Score:5, Informative)
Effects on Dell/Ubuntu OEM? (Score:4, Interesting)
Re:Effects on Dell/Ubuntu OEM? (Score:5, Funny)
Parent
Selected Excerpts (Score:5, Informative)
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
Re:Selected Excerpts (Score:5, Interesting)
Add "-o noatime" to the filesystems in
Parent
Not Entirely Accurate (Score:5, Insightful)
# Switch to laptop-mode on battery power - off by default as it causes odd
# hangs on some machines
ENABLE_LAPTOP_MODE=false
Read some of the Ubuntu forums (Score:5, Informative)
Cheap test.. (Score:5, Informative)
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.
Saving Power Has a Cost (Score:4, Interesting)
What, you're in too much of a hurry to view the latest pr0n? Chill, dude, before you go blind!
If you run a desktop, it's doubtful you'll have a problem with this, as most desktop users turn power saving features off entirely (and yeah, I also drive a big honkin' SUV. Bite me), but be careful on a laptop. If your hard drive supports SMART, you can do a quick check of the numbers (I think the one you want is # 193, IIRC), and see if you're at risk. But not all drives support SMART (I have a laptop drive that doesn't), so as usual, YMMV.
From the horses mouth (Score:5, Informative)
Matthew garret, who runs the laptop testing team. Read this, instead of just spreading FUD.
It is NOT Ubuntu (Score:5, Informative)
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
This is not an Ubuntu problem. Read the references (Score:5, Informative)
=====================
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.
Don't use -B 255, use -B 254 instead (Score:5, Informative)
- 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:
Re:Thanks for slashdotting launchpad, guys. (Score:5, Funny)
Parent
Re:Thanks for slashdotting launchpad, guys. (Score:5, Informative)
Workaround #1. Edit /etc/hdparm.conf, add the following to the end (or modify the existing /dev/sda area, etc. This assumes your primary disk is your only disk and you're using SATA):
Then enter "sudo update-rc.d hdparm defaults" to ensure the changes take effect.
Workaround #2, edit /etc/apm/event.d/20hdparm, find the line "APMD_SPINDOWN=18" and add a zero to it (APMD_SPINDOWN=180). Again enter "sudo update-rc.d hdparm defaults".
The first of the options disables the whole spinning down thing. The second changes it so it spins down less (every 15 minutes rather than every minute and a half.)
At least, that's what the Launchpad contributors claim.
Parent
Re:This thread sucks... (Score:4, Informative)
> 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.
Parent
Missing the point... (Score:4, Insightful)
Parent
fudmuffin (Score:4, Insightful)
Parent
Re:Confused.... (Score:4, Funny)
I can't find the Uncheck Crappy Authors option.
Parent
Re:Ubuntu? Slashdot! (Score:5, Funny)
Parent
Re:My experience (Score:4, Informative)
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/ [dyndns.org] )
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,
Parent
Re:My experience (Score:4, Informative)
Parent