Ubuntu's Laptop Killing Bug Fixed 271
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!"
No need to enable "proposed" updates (Score:5, Informative)
The fix is already included in the accepted updates:
acpi-support (0.114-0intrepid1) intrepid-proposed; urgency=low
* {ac,battery,resume,start}.d/90-hdparm.sh: don't just check whether
laptop-mode is configured to control the drives, also check whether
laptop-mode itself is *enabled*. Finally closes LP: #59695.
-- Steve Langasek Mon, 05 Jan 2009 10:50:10 +0000
Just run apt-get update && apt-get install acpi-support.
Re:Only Ubuntu? (Score:5, Informative)
Re:As per "Flamebait Story" (Score:3, Informative)
Really makes you wish hardware manufacturers would step it up.
Re:More Linux Zealotry (Score:4, Informative)
More incompatibility than just this (Score:2, Informative)
Just in the last two days I've tried to install three versions of Ubuntu on a Toshiba Satellite laptop, and every attempt failed with a blank screen of death in the middle of the process. I tried 7.1, 8.04, and the latest nightly build (first two Desktop versions, the latter Alternate of course). This is an old laptop from 2001, a model 1805-S203, so there's no cutting-edge hardware that should be causing a problem, yet the installs failed spectacularly.
By contrast, BOTH Windows 2000 and MEPIS Linux version 7 were able to install.
I have to tell you, this has shaken my confidence in open source operating systems quite a bit.
Re:No need to enable "proposed" updates (Score:5, Informative)
sudo apt-get update && sudo apt-get install acpi-support
That's better
Re:More incompatibility than just this (Score:2, Informative)
laptop != hard drive (Score:4, Informative)
Oh wait, it's kdawson.
It shortens the life of your HD, not the laptop itself, you chimp.
Re:Only for who think the world has to be perfect (Score:5, Informative)
The funny thing is that the actul bug is an urban myth. People claim that once your hard drive reaches 300k parks it will fail. Note that at the start they were claiming the number to be 100k and now are claiming 600k due to the simple fact that a huge number of people showed up with the number being well over million on perfectly functioning drives.
The drives parked heads when not in use, sometimes, several times a minute, some of them clicked when they did so. It is a feature that reduces power use and protects the hard drive from sudden movement and impacts. It is NOT a bug.
All the claims that it will make you hard drive fail in a year are false and are made by people that have no a slightest clue of hard drive design.
Re:As per "Flamebait Story" (Score:4, Informative)
You would find this out due to returns. There really are only a handful of laptop manufacturers who sell to the OEM brands you know (Dell, HP, etc). If a model has a component failing at a higher rate than normal, the OEM/ODM will begin investigating what is going wrong.
In the case of Windows, we are also able to correlate crash information to drivers and hardware, and determine problems this way.
I work for Microsoft as a technical account manager (TAM) - and work with OEM/OEM/IHV communities on issues like this. There are *many* patches to Windows which include workarounds for hardware issues - something that is both good and bad. Good because an end user is less likely to get screwed; bad because vendors who tend to make crap hardware stay in business.
This was not very good, Ubuntu (Score:5, Informative)
I followed the instructions on Ubuntu's forums (what a pain to locate the actual instructions) (I transcribed what I did and will post them).
The actual problem was that manufactures have messed with their drives and altered the head parking timeout into a "detect if windows went to sleep" method. Basically Windows writes to the disk *all the time* until it sleeps, so the best way to minimize disk use is to park the head almost instantly after any inactivity, as that will park it asap when it sleeps. Furthermore at least 2 manufactures used the timeout control as <= 195 == "on" and >195 == "off".
Ubuntu/Linux wrote a lot less often, but plenty anyway, like every 15 seconds (doing stupid stuff like writing log files). So the head unparked every 15 seconds.
The fact that Windows "worked" led a lot of people to think Windows was doing secret messing with the drives to turn on extra modes that were not in the documentation, and that Ubuntu could not be fixed until this secret was found. However I think somebody could have figured out that it was not doing anything, there were programs (ported from Ubuntu, apparently!) for reading the disk settings under Windows.
It was also known immediatly that setting the disk timeout to 255 stopped this. Who cares if this was not the "secret Windows setting", it was certainly better than how Ubuntu was working at that time. This was known the same day the bug was first talked about! Ubuntu should have immediatly patched it, but somehow the fact that this was not "ideal" caused them to delay for 14 months! That is really bad, guys! I "fixed" mine as best I could with a program I had to run every time I opened the lid (because some stupid startup thing kept turning the timeout back on, and the only way to run my program last was to manually run it!) I eventually decided to go through the hair of actually fixing it and killing off that other thing that tried to do it.
There seemed to be a bunch of conflicting programs, all of them trying to set the disk timeout to 128 or 2. You had to get *all* of them (see next posting for what I did). This is what made it Ubuntu-specific. I sure hope this patch straightens it out so exactly ONE service, and exactly ONE file in /etc, controls the disk timeout!
Yea you can blame Windows all you want, but this was really, really, bad!
And I sure hope the update (which I just did) did not get screwed up by trying to merge with all the changes I did. Have not really checked yet. What a PITA. If they had put out a patch immediatly then they would not have to patch systems that have a hundred different solutions on them.
Re:More incompatibility than just this (Score:3, Informative)
I'll rephrase. Would you expect that XP or Vista be installable on your laptop? AKA the newest versions.
You actually reaffirmed my statement on laptop support! But you continue to rebuff the my statement? Curious.
Ubuntu is != Linux. Ubuntu is simply a distro. And no they have not been around that long. Release 4.10 was the first release of it. That's stands for Oct 2004. Also they don't actually support people for free. The community does. As you said given sufficient demand that laptop in question would probably have been supported. Clearly demand for your variant is not sufficient.
You see by your very own logic. It should also mean that recent versions of Windows should also install without fault. I don't think they would. Vista won't that's for sure :)
-----------
Please note I did some research for you. Your particular laptop has some serious bios issues. With patches released as late as 2005.
A notable issue which sounds like it might be related to your problem is:
Version 1.70 08-01-2001
In order to support 1GHz CPU this BIOS incorporates changes to address temperature control.
Corrected a problem that, when the computer goes into S4/S5 state (S4+Hibernation, S5=Power Off) the CMOS data would get corrupted.
Corrected a problem that caused the computer to take an extended amount of time to shut down after going into Hibernation
Re:This was not very good, Ubuntu (Score:5, Informative)
The laptop_mode command does the right thing, so most of this is to get it called everywhere it needs to be, and to remove calls that mess with the hdparm settings and thus defeat laptop_mode. There are claims that "laptop mode" causes problems, but this does *not* enable it. The program "laptop_mode" does other stuff besides the problem part. That is controlled by a line in
1. Edit
2. Edit
3. Edit
Comment out or delete the 4 for...done loops containing $HDPARM commands. (this stops power-on from messing with the disks)
And change the arguments to $LAPTOP_MODE from start/stop to "auto" in both cases.
(this makes it run the laptop_mode command correctly rather than forcing the mode on and off)
4. Create
5. Create
#!/bin/bash
case $1 in
hibernate)
suspend)
thaw)
resume)
*)
echo Something is not right.
esac
Chmod +x this file (this makes suspend/resume run the laptop tools)
HOW TO TEST:
This command will tell you how your disk is set:
sudo hdparm -I
The correct results to stop disk thrashing are 254 or 255. When laptop_mode is *really* on then the correct value is 1. If you see 128 then things are not working, this is the setting the disk resets to on suspend/sleep/power off.
This command will tell you how bad you have trashed your disk (you may need to install "smartctl"):
sudo smartctl -a
The last number is how many times your disk has parked. Over 10,000 is not good. Mine is 101187 before I finally got this fixed.
Re:Only for who think the world has to be perfect (Score:4, Informative)
Hard drives have "recommended" power-saving values specified in their firmware that say after x minutes of idle time, power me down! Ubuntu used these values.
It turns out these default values were way too low (1-5 minutes), so drives would power off and on very frequently, which shortened their lives.