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."
It seems to be killing Slashdot's hard drives also!
Kdawson FUD...I'm really confused....
Virginia is for lovers. EVE is for griefers.
Slashdot definitely killed the launchpad server.
Insert self-referential sig here.
But Rob Malda said the year of Linux is passed. No joking, go look at his interview.
Might have been coincidence, but I did have it happen.
I'll just buy another 4 hard drives with the money I saved not buying Vista!
FOXTROT UNIFORM CHARLIE KILO
Yeah, sure. Whatever it is, it can't be compared to the damage done to Ubuntu's launchpad after it was slashdotted.
:(
Once they control the fire and get the backup server online, maybe I'll be able to RTFA.
"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."
This is apologist language. I should know, because I am one. "Whatever your opinion about allowing people to own private property, you'll agree that..."
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. :(
That's why I use windows. So I don't have to wonder who the culprit is ;)
^_^
This is the sig that says NI (again)
If perhaps it could be "any OS" then why headline this as "Ubuntu" killing laptops? I can't find much in TFA that makes a compelling case that it isn't APCI. I'd read more but that page hurts my eyes.
OpenSuse 10.2 does to, without some tweaking. I'd wager other distros have the same or similar issue. I love *nix, but it it not ready for primetime yet, with bugs like that. I shudder to think of the call from my old man, where I have to explain that he has to rebuild (like he could of in the first place) his PC with pci=nomsi and acpi=forceirqpoll in the boot options so his high dollar toy isn't ruined.
Enlightenment is a pipe dream. So where's the pipe?
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_. Doesn't sound like it is NOT being dealt with, it just isn't listed everywhere as critical and in the news all over the intarweb tubes.
Support NYCountryLawyer RIAA vs People
So long as you have the correct video drivers, you should be able to do all of that. For Ubuntu 7.04, it was just a matter of downloading the NVidia drivers, installing them, and then you are able to run multiple displays. For Ubuntu 7.10, the most recent NVidia driver is already installed, so everythings good to go out of the box. However, Ubuntu 7.10, my laptop runs extremely hot, so I'm sticking with 7.04.
Windows 3.1x calc: 3.11 - 3.10 = 0.00
Same here. I had my Hitachi Hard drive that came with the laptop die. Not was if it was the OS though.
Didn't work for 7.04 on my system even after I installed the nvidia driver. Haven't tried 7.10.
SJW: Someone who has run out of real oppression, and has to fake it.
I wonder what is the effect of this bug on officially endorsed and supported Dell notebooks with Ubuntu on them? Wouldn't something like this be caught up by Dell's QA? Or is it exclusive to 7.10?
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.
With Ubuntu as the culprit there is some sort of "respect" that kills the potential of the thread. Come on guys, it is not Linux, it is just Ubuntu. What are the SuSE/RH/etc fans waiting for?
Violence is the last refuge of the incompetent. Polar Scope Align for iOS
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!
It's important to note that this only occurs if ENABLE_LAPTOP_MODE is enabled. By default it is NOT set. From /etc/default/acpi-support:
# Switch to laptop-mode on battery power - off by default as it causes odd
# hangs on some machines
ENABLE_LAPTOP_MODE=false
If you're somewhat intelligent you'll have backups anyway and when the disk dies it's just natures way of telling you that you need a bigger disk.
Here's the fix http://ubuntuforums.org/showthread.php?t=596602
I can't get the bugger to install on my new Vaio SZ
It just kinda sits there and hangs during install. Which is a shame as I love the debian OS in general.
I installed Ubuntu about 2 weeks ago, and somehow the installation screwed up my hard drive completely...*snip* At the time, I figured it was GRUB that had done it, but according to this news, it was Ubuntu.
Even assuming this bug effected you 2 weeks ago and taking it to its maximum impact this bug still probably wouldn't have killed your drive in such a short time. My immediate suspicion is a faulty drive.
How exactly is the drive hosed?
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?
All the bitching around my work about how hard drives used to last longer. With my limited cross section, I have 2 computers at home, both ca 1998, still running original hard drives, in fact I've obsoleted 6 workstations so far at home, none of them had hard drive failures, I had one PSU, one GPU, and one NIC failure. At work (mainly a IBM shop) I've had to replace about 20% of drives within 4 years (I admin 50 workstations). I realize there is a lot of variables, smaller read heads, faster spin rates etc, but it does seem that my old dinosaur home computers last longer than the newer PC's we have at work. I'd be curious if "power saving" is putting our data at risk.
Well, that Ubuntu bug report is over 1 year old, and according to ThinkWiki, and as confirmed by several people on the thinkpads.com forums, updating the harddrive firmware may well fix the problem.
If you really have an nvidia card, you should try 7.10. They make installing the drivers a breeze. Once you have the nvidia driver installed, install nvidia-config and use it to setup your funky display options. It is a great tool put out by nVidia. I have a side-by-side dual monitor setup at home set up with 7.04 (moving to 7.10 soon) and it works like a charm. Kudos to nVidia!
1, 2, 3, 4, 5... That's the combination on my luggage!
Since my upgrade to Gutsy was less than smooth. I've got to reinstall the lot anyway and since Mandriva was a favourite of mine a few years back I might give them another go. I hear that they've cleaned up the mess they had back then.
So, how is it Mandriva guys. Do you also try to kill my HD or are you a safe (data)haven?
You are not entitled to your opinion. You are entitled to your informed opinion. -- Harlan Ellison
Warranty means jack shit as you still need to deal with the annoyance of a dead hard drive. MY time is worth something and this is not how I want to spend it.
This includes:
-Downtime until you get a replacement
-Time to set up replacement back to the state of the old machine
-Annoyance of having to file warranty claim, package laptop and send it out (or drive to whatever local shop can do replacements)
-Bugs when replacement differs from old machine in negative ways (which you will of course be told is officially an "upgrade" or "current equivalent" so you can't complain even though to you its a major downgrade).
-Need to do constant hard drive images (and the space needed to store them). I think this requires a reboot which is annoying.
-Need to do constant backups to fill in holes if you can't image often enough.
PP gives a plausible sounding solution.
To be, or not to be: isn't that quite logical, Slashdot Beta?
Bravo. Now we just need someone to blame this on Bush, and everything is covered.
installed Ubuntu about 2 weeks ago, and somehow the installation screwed up my hard drive completely... according to this news, it was Ubuntu.
No. (I haven't read TFA because it's still slashdotted, but...) Apparently the article says it cycles the power too quickly, which leads to premature failure. Not screwing the drive up immediately, but wearing it out too soon.
If the drive screwed up immediately upon installing Ubuntu in a dual boot with a copy of Windows that had been used some already, I'd put money on it being partition problems. Ubuntu installs nicely on a clean fresh system, but if Windows is there already and the existing drive data is too odd (fragmented, swap file fragmented and/or seriously separated from the rest of the data, multiple partitions, whatever) the repartitioning may not go well. The repartitioning software (I forget what it is) is not smart enough to stop and tell you "hey, you gotta clean this drive up before I make changes" (or to deal with doing the cleanup itself).
The aggressive power saving settings here are perhaps a little too aggressive, but did anyone really think you could do that totally without cost? This isn't magic, you know. It's a trade-off. If you tell your computer (usually in a laptop) to spin down the hard drives to save power, you're going to cause greater wear-and-tear on the things because each time they spin down, they have to spin back up before you can use them again. If you want to save energy without the wear, turn the bloody thing off when you're not using it.
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.
"My country, right or wrong; if right, to be kept right; and if wrong, to be set right." --Senator Carl Schurz (1872)
They have, more or less.
The gui tools seem to work for a lot of people; for me I use the command line as it offers more power.
The new xrandr support does the trick and then some. For example:
xrandr --output VGA --mode 1680x1050 --right-of LVDS --output LVDS --mode 1400x1050
This sets me up with dual monitors just fine on my laptop, and it works on-the-fly. (e.g. I can plug in a projector anytime I like; it doesn't have to be present in xorg.conf or plugged in when X starts).
Enjoy!
Looking at the comments right now, most of them that are critical of Linux are being moderated up quickly. The days of proclaiming slashdot pro-linux bias are gone, slashdot nowadays is a collection of smug mac zealots and bitter windows die-hards attacking anyone who dares say they enjoy using Linux.
Get an account and enjoy all the benefits which that entails.
"You don't need a weatherman to know which way the wind blows." - Bob Dylan
Hey everyone, that troll Twitter is back! I was wondering when he'd turn up again.
Your comment is incorrect. A stock install of kubuntu on my laptop AND desktop, on AC and DC, resulted in roughly 12 Load_Cycle_Count updates PER MINUTE. The clanking was driving me nuts, a hdparm B 250 put an end to that, but the way ubuntu handles this bug is plain silly. If Shuttleworth is trying to establish the Ubuntu brand blaming the BIOS is not helping him with that (this problem does not manifest itself with XP on the same hardware).
PS:
Anyone else had a flashback to the old CGA monitor and zipdrive days?
I seriously wonder how many other OS's are effected by a similar problem... any aggressive ACPI settings under any OS should kill hard rives...
... 2 years after the fact... and would be hard coded into the kernel some how... in some freakish way...
I wouldn't consider it a "Bug" per see, so much as a configuration problem.
Under M$ this would never be patched... maybe in sp2a
At least for the intelligent they've been able to fix it since it was discovered OVER a year ago.
Ive seen windows kill hard drives too and over more trivial issues.... and normal use.
Don't believe the FUD! lol...
Don't forget, some drives/BIOS are not affected it looks like either... just specific ones that are more susceptible to the funky settings.
Laptop hardware should be DESIGNED for such aggressive power management, sounds like they used a drive not suited to being on/off to cut power...
A server stays on 100% of the time, even when its load avg is low specifically to save the hardware.
I edited my xorg configuration file, and I'm just a girl! It's so easy that only a complete moron would have a problem with it.
Tags if you replace all instances of Ubuntu with Vista:
haha, defectivebydesign, MS, vistafailure, vista
+1 Agree -1 Disagree
With Vista it's Microsoft's fault. With Ubuntu (or any open source project) technically, it's our fault. So if you're confused about the missing flames maybe you need to rethink what Open means.
Quack, quack.
You know, it's funny. A while back there was an outcry about manufacturers who decided that installing linux nullified your warrenty. This incident makes me wonder if maybe they have a point? After all... they have likely tested the hardware for long term windows reliability. They probably haven't tested their hardware for long term Linux reliability (through all the various linux types and settings.)
That said, they could probably still support their warrenty on things they know won't be affected by operating systems, like the hinge of the laptops screen.
Boojum the brown bunny
http://mjg59.livejournal.com/77672.html
Matthew garret, who runs the laptop testing team. Read this, instead of just spreading FUD.
Another level-headed, rational reaction from twitter.
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.
I've been running Ubuntu (since Edgy) on my laptop for about a year now with heavy use and my laptop works as well as it did on the day I got it. I known for awhile that having the "laptop mode" option enabled in /etc/default/acpi-support can be bad for your drive, but it is disabled by default.
"It is a denial of justice not to stretch out a helping hand to the fallen; that is the common right of humanity."
When they fix it so I don't have to do complicated manual edits the xorg config file to get more than a lousy 1024×768 screen resolution and support for a projector or dual displays ...
... just like you would in your wordprocessing document. And if you're lucky, you might even be able to use your mouse and not hurt your fingers typing a few characters. ;-)
And those "edits" are more complicated than the edits you typically make in your "letter to mom" wordprocessing document?
Geez.
Look, if you don't understand the format of xorg.conf, that's fine. Admit you don't know how things work. Admittedly, there's lots to know, but it can be simple or complicated, depending on the setup. On the other hand, lots of people will be happy to chip in and give you a fully working configuration you can copy and paste
But offering this inflammatory indictment that everything is fucked up because something doesn't work for you strikes me as somewhere between immature and simply childish. And suggesting that support for a feature doesn't exist because you haven't discovered it, can't find it, can't be bothered to try, or refuse to bother learning for yourself is telling everyone you're someone who should be ignored.
Ubuntu, like any distro, is a work in progress up against the vagaries of hardware vendors. Lots of people in lots of disparate areas are offering their hard work. They deserve respect, irrespective of whether things work out of the box for a random Slashdot user. Multimonitor support? High resolutions? They work for me. What's *your* problem?
Next time, instead of brandishing your complaints, maybe take a more constructive approach. Say it didn't work for you. Admit you didn't try very much. Ask for help. You might be surprised at the response.
I'll be your friend. :)
(IBM ServeRAID tester)
(I test mostly with Linux)
(Sometimes windows)
Skiffy is Spiffy, but Ort is tort.
Your hard drive also suffers wear and tear when you use the damn thing. Those who are going to panic over another "the sky is falling" post please move to the left.
That doesn't solve the issue of not being able to access those documents you needed 5 hours ago because your hard drive crashed.
Yes, I know that you should have a redudancy system and save important documents multiple places. But the typical user doesn't know this.
Now let's all forget about this hard drive failure problem with a big bowl of strawberry ice cream!
Hard disk mp3 players like iPods are very aggressive with power savings.
Don't they also treat their hard disks badly? I know that the disks made
for use in mp3 players are NOT quite the same as those in laptops (1.8" or 1"
instead of 2.5") and perhaps these drives are built with frequent spin up/down
in mind.
Distrowatch http://www.distrowatch.com/ says it too, which means others agree.
that's a weird looking puppy dog.
strange, Hitachi Harddrive sounds like an ubuntu approved device with it's alliteration and all.
After hearing all of how Vista is terrible, and how users should get Ubuntu, we now have this.
Since Ubuntu is the greatest thing since sliced bread, it does seem rather remarkable that here Ubuntu is physically damaging hardware. One wonders what the response would be, if there were a similar bug in any Windows version.
I wonder if all of the developers of Ubuntu - everyone in the GPL, would be liable?
This is my sig.
"Need to do constant hard drive images (and the space needed to store them). I think this requires a reboot which is annoying."
For future reference, no rebooting is required.
- Assuming an external drive (/dev/sdc1) mounted on /media/external_drive -
dd if=/dev/sda1 of=/media/external_drive/backup-2007-10-30.img
You can even pipe it through gzip or bzip2 to make it smaller, and if you want to make it REALLY small, first create a bunch of huge files, and fill them with zeros, then delete the files.
Or you can mount the image later via the loopback device, fill the dead space with zeros, and compress.
Kevin Smith on Prince
I have Slackware 11 on my laptop and I just checked the Load_Cycle_Count with:
/dev/hda
smartctl -d ata -a
Currently the count is up to 1195740! So either I have the most durable drive ever created or this thing is going to explode soon. Does anybody have any suggestions on this? I don't know much about acpi.
Wasn't it HP that refused to fix somebody's laptop hinge because they were running Linux?
Ah, here it is -- sticky keys, not broken hinge, but still. You might want to give that cute gal in Canada a call back.
Slightly disreputable, albeit gregarious
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 ----
A replacement drive is much less than 200 bucks, and the warranty doesn't buy you you lost data back. Spend the 200 bucks on backing up instead.
Ah, the beauty of Linux. Say what you will about Windows or Apple, but I buy a video card for my monitor, and it just works. Install a driver, reboot, and Bob's your uncle. With Linux, it always seems to involve posting a message in some obscure web forum, and then waiting a couple of days for someone with a name like Svorjborgytorg Bjongumjong or Pradesh Jooeypop to reply back with something like, "Sorry to be not working your Linux files for driving! Trying this instead! Be editing the conf files of X to include lines of the sort Option fglgx. Happyness first!"
Wow, you just like to do everything the hard way. Just use a roaming profile like the rest of us laptop users. Your laptops dies you just use another laptop while you get a replacement. In the meantime you have all your files and if SMS is employed you also have all your applications within minutes of switching. More time might be necessary if for instance SMS has to install Office or some other large app but still, it's not near as inconvenient as you make it out to be.
Also, with HP specifically and I'm sure others as well you get the replacement the next day in advance of the bad hard drive and you'll have a tech some with it to install it for you. Then IT lays down the base image and you login, SMS takes care of all your applications and you're back on your full time laptop with minutes of downtime or possibly even less depending on your requirements.
Wow. Just... wow.
On both 7.04 and 7.10 the Ubuntu stuff failed miserably to set up my GF8 card, and I had to rely on Envy (which worked like a champ first time).
This hard drive issue is a concern as I was literally a day or two from throwing Gutsy on mine. Think I'll wait and see how this all pans out.
Ahh... too bad I support VHEMT, otherwise I would now commit to naming my firstborn son to Svorjborgytorg!
-- Anders Andersson
c++;
Gilles Schintgen wrote on 2007-05-11:
Please increase the importance of this issue....
This is not news, this is reality.
Or if you've got an nVidia card and the official restricted driver manager doesn't cut it for you, google "envy nvidia", download, and you'll be up and running in no time. It's not like nVidia haven't had their issues in the past. There's the refresh rate bug from days of yore, there's the aspect ratio correction now that doesn't work properly on most cards etc... So your claim that it just "works" has a few caveats my friend.
Wow.
I've noticed this behavior on my laptop, in fact I wrote a little script to stop the hard drive from doing the unloadings. I actually use Gentoo, but I wrote an ebuild for the acpi-support package to take advantage of Ubuntu's nice power management features. I didn't think Ubuntu's scripts would be the ones putting the drive into that mode!
Another thing is that if you plug the laptop in while it's asleep, then wake it, the power.sh script does not even fire, so you still get the head load cycles all the time even after plugging in.
This is really bad for all the laptops out there. Ubuntu needs to stop this behavior in acpi-support and ship an update now.
[an error occurred while processing this directive]
I see a similar issue with my new WD10EACS (1 TB Western Digital "Green Power") desktop drive:
/dev/sda /dev/sda:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
9 Power_On_Hours 0x0032 100 100 000 Old_age Always - 582
193 Load_Cycle_Count 0x0032 180 180 000 Old_age Always - 62848
I don't know the drive's rating for Load_Cycle_Count, but the scaled SMART attribute has gone down from 181 yesterday to 180 today so it does seem to be burning through its allocated cycles quite rapidly.
Interestingly, this drive does not appear to support the "hdparm -B 255" command:
mythtv:~# hdparm -B 255
setting Advanced Power Management level to disabled
HDIO_DRIVE_CMD failed: Input/output error
"hdparm -I" lists "Power Management feature set" and "Automatic Acoustic Management feature set", but not "Advanced Power Management feature set".
The system is running Debian Etch with a 2.6.23 kernel, and I'm using hdparm version 7.7. I am not using any "laptop mode" settings (at least, none that I can see).
ACPI is a perfectly fine standard. The problem is the motherboard manufacturers who implement shoddy bios. Almost all bioses out there fail to comply with the standard and have other bugs like this one. They don't get fixed because they just make a windows driver to work around the problem, leaving linux to bump into the bugs left in the bios.
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.
To those saying "Did you think energy-saving would come with out cost?":
Well if the cost is energy then it's pointless right? Think about:
1. Mining and refining materials used in drive.
2. Manufacturing drive.
3. Trucks shipping the drive from factory to customer.
After all that the drive comes home to you only to have a much shorter lifetime because you want to save energy. Now you just have to buy a new drive because that's the cost of saving energy, and transport the old one to proper recycling facilities.
+1 Agree -1 Disagree
Given the alternative that Vista is the equivalent of being severely rogered up the rectum by Bill Gates huge, black, barbed member, I for one will be hopping over onto Linus' lap, thanks all the same.
Gentoo Linux - another day, another USE flag.
Ubuntu is NOT causing aggressive power management.
/etc/default/acpi-support (disabled by default) which will set your harddrive to use aggressive power management
The following things might instead cause aggressive power management settings :
* your (laptop) harddrive firmware might have aggressive power management defaults (operating system independent)
* your (laptop) BIOS might set your harddrive to use aggressive power management (operating system independent)
* you might have enabled laptop-mode in
These aggressive power management settings are set by your BIOS or harddrive firmware. Windows and/or Mac OS X might be overriding these settings which might make Ubuntu look bad if Ubuntu doesn't override these settings.
Read here what Matthew Garret an experienced and well known Ubuntu Developer has said about this problem :
http://www.advogato.org/person/mjg59/diary/82.html
for more information see :
http://ubuntudemon.wordpress.com/2007/10/30/ubuntu-is-not-causing-aggressive-power-management/
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.....
Frank Zappa's guitar want to KILL YOUR MAMA!!!
does this mean the only way around it is to not use an OS, hence not use the computer. admittedly the hard drive would last longer if you don't use it.
Blazing Spiders
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.....
Funny that you mention a hinge breaking not being covered by warranty. My room mate leaves his machine on a desk, and in a bag when moving it anywhere. One day he opened it, the hinge jammed, and the plastic outer casing is now broken around the left hinge. HP refuses to fix it claiming it's abuse that caused it.
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.
Sometimes boldness is in fashion. Sometimes only the brave will be bold.
I run Ubuntu 7.10 on my HP, and have a fresh install of XP pro sp2. The HDD access light is blinking constanly under windows, while sitting idle at the desktop. I can hear the HDD being accessed all the time too, plugged in or not. Under Ubuntu the HDD access light never lights up while sitting idle until the screensaver kicks in, then it's for a quick flicker. Plugged in or not. Ubuntu gives me better battery life, almost double of what windows does (approx 45m to an hour with windows, almost two hours with ubuntu) with power settings all set to leave everything running, backlight full on, ect. So I personally think, Windows is gonna pack this drive in before Ubuntu does.
acpi has always been buggy for me. it loves to turn off my pc fans and not turn them back on then the system would go into emgery shutdown due to overheat luckly at least that works right. so i add these to grub. acpi=off apm=off noapic. that totaly turns off linux power managment noapic may or may not be needed i had to otherwise my usb mouse wouldent work.
This is a well-known performance-killer (imagine a newspool), so disks should be mount'd with the `noatime` and `nodiratime` options if at all possible. This can be done automagically by replacing 'defaults' with 'noatime,nodiratime' in
"how many of us can replace a video card that is soldered onto the motherboard."
Very few. You obviously haven't dug into a modern notebook. The video card is actually usually on a socket and fully replaceable.
I didn't get a warranty for my machine -- $200 isn't worth it on a $400 machine.
Ubuntu 7.10 included X.org 7.4, which has much better support for dual monitors and projectors. 7.10 also includes a new "Screens and Graphics" application for configuring X.org, including setting your graphics card driver and monitor information. This makes editing xorg.conf mostly unnecessary, the only time I have had to edit mine recently was because some update removed the "AddARGBVisuals" options required by my nVidia card to run Compiz. After entering in the make and model of my monitor, I was given all the resolution and refresh rate options supported, I had to manually enter them in 7.04. You should definitely try 7.10 if you are interested in using Ubuntu
Note: I don't think the LiveCD loads the nVidia driver's kernel module, so you may not be able to play with all of this in a liveCD session.
http://www.mhall119.com
proposed new autotag for all kdawson stuff.
Engineering is the art of compromise.
What about Hitachi desktop HDs? I hope they don't do this idiocy.
Anyone know?
"There are laws that enslave men, and laws that set them free. " - Sean Connery as King Arthur
That is quite a good idea, an optimized build. Hope the main Ubuntu devs and maintainers consider it. Perhaps work with dell on that as well.
This bug is still the worst I've seen: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=155873
I'm against picketing but I don't know how to show it.
- 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:
Compared to my latest experience with windows drivers, Linux is far cry better... I tried to install and older but still useful ATI card in my wife's computer, and it works well for some games, but turns out it can't do 800x600 resolution in some bit depth, which is what the Age of Empires set needs to boot up. There's no driver that will work for it, and it is now unsupported. If only I could edit a config file to add that mode! At least with X I have an option.
Something worth bearing in mind here is that the raw output of smartctl is not necessarily helpful. By way of an example, this is what I get on my Thinkpad X40:
193 Load_Cycle_Count 0x0032 071 071 000 Old_age Always - 2956632174724
A rough calculation suggests that, being 14 months old, that claims to be parking/unparking the disk over 80,000 times a second, which is very clearly physically impossible. The value is clearly not always a simple counter.
Chris "Ng" Jones
cmsj@tenshu.net
www.tenshu.net
I purchased a Dell Inspiron 6400 (UK) model in Sept. and was alerted to this reading through the forums. Following the advice sorted it OK. No big deal, but what it also means is that disk heads are not 'parked' so often, so a laptop on the 'move' could do more damage to a drive than what the setting does anyway (i.e. the drive goes to sleep a lot, thus giving semi-protection against a *bump* or two).
I was also surprised that laptop drives are not mounted 'noatime/nodiratime' either, as that saves a bit of wear.
But, anyway, I think this report is a bit over the top - have there been ANY reports of hard drives failing because of the Load_Cycle_Count exceeding specification?
The way I read that story was "Something in your computer may be causing problems for your hard drive". Maybe it's just me, but I don't think this constitutes news.
-1 disagree is not a modifier for a reason. -1 troll, flaimbait, redundant, overrated are NOT acceptable substitutes.
I'm not sure where else to post this, but I thought I'd share my experience as it seems potentially useful to others:
/dev/sda | grep Power_On_Hours /dev/sda | grep Load_Cycle_Count
/dev/sda | grep Power_On_Hours /dev/sda | grep Load_Cycle_Count
/dev/sda /dev/sda:
I purchased a Compaq Presario C571NR with a Hitachi UDMA/100 5400 RPM 80 GB (model HTS541680J9SA00, firmware SB20C7BP) in July of this year.
I immediately wiped the pre-installed Vista and installed a custom Linux From Scratch w/ 2.6.22.1. So, I've been running this fairly stripped down flavor of Linux for almost 4 months now, mostly with the laptop plugged in. Prior to reading this post I did not even have hdparm installed (let alone smartmon). I had not expected these results:
$ date
Tue Oct 30 14:50:34 EDT 2007
$ smartctl -d ata -a
9 Power_On_Hours 0x0012 096 096 000 Old_age Always - 2160
$ smartctl -d ata -a
193 Load_Cycle_Count 0x0012 086 086 000 Old_age Always - 142886
$ date
Tue Oct 30 15:50:55 EDT 2007
$ smartctl -d ata -a
9 Power_On_Hours 0x0012 096 096 000 Old_age Always - 2161
$ smartctl -d ata -a
193 Load_Cycle_Count 0x0012 086 086 000 Old_age Always - 143016
If there is any truth to the idea that 600000 cycles is a typical drive lifespan (which does seem to be the case) I am quite upset to have spent almost 25% of this drive's life in less than 4 months.
Oh, and as has been stated before:
$ hdparm -B 255
setting Advanced Power Management level to disabled
and I've been at 143016 cycles ever since.
http://www.mhall119.com
Which is exactly why I plan on DBANing the disk before I send it in. :)
"I don't know why there isn't anything on the disk....maybe it got a virus!"
NewslilySocial News. No lolcats allowed.
It's simple, Flash the hard disk firmware and disable power management. I did this for my ThinkPad T42 disk and no more clicking.
It's the power management, the clicking is for the heads to idle while not in use.
Everyone wants a Tux in their life.
I wonder how many people didnt RTFA and what is more sad, it seems mods didnt either. Ubuntu is using the manufacturer values, the recommended ones, it should provide a workaround? yes. Does windows provide a workaround? no, windows dont even care about manufacturer values.
...It's never the OS.
1 blame user
2 blame third-party device/driver
3 goto 1
It's Bush's fault.
I Like Pie...
Here I was thinking it was some weird game for nerds.
In my power saving settings on the macbook pro it says that it will turn of the harddrive as much as possible, and that is the only option, do it or don't do it.
I've been thinking about how bad it may be earlier and now I wonder even more. Does anyone know how agressive OS X is? Shall I let it be on or off?
Or rather, you can fix it with a little workaround.
I'd just like to say - THANKYOU SLASHDOT! for bringing this to my attention.
My laptop is only a couple of weeks old and the counter had already crept up to 7300. I have no idea if that's high or not, but after reading this in the office today I came home and switched the laptop on without putting the stereo on for a change. Not only was the counter going up, but I could hear the disk whine and click as it was spinning up and down. After applying hdparm -B 254, all is well again.
I would have been most pissed off if the drive had gone, especially seeing as the only warranty I have is on the other side of the atlantic!
Within 2-3 weeks i had a drive failure - drive still has near on 3 years of warranty left...
Now, not to blame vista in particular, but i don't think this problem is likely limited to ubuntu...
I run: Windows, OS X, Linux, FreeBSD. Just because you have a hammer, doesn't mean everything is a nail.
So, now when your laptop's maker claims you voided the hardware warranty by installing Linux on it, they might be right???
Oh Noes!!!!
Why would you post a link to something that is debunked in the very first reply?
That's right - because nobody who loves Linux could ever think you're wrong!
"It does not do to leave a live dragon out of your calculations, if you live near him." - Tolkien
Where is the room for doubt?
About 4 posts down:
The only wiggle room is that ACPI is a M$ dissaster where anything is possible because nothing is defined properly.
There are so many HW health problems that a badly configured system can trigger and are Ubuntu folks worried because their HDD disk spin down too quickly? Specially when this behavior is easy to modify??
One day we have another Ubuntu related post:
"There's a debate going on over at bugs.launchpad.net on whether it's the Ubuntu, BIOS, screen manufacturer, or pick-any-player's fault, but Ubuntu (and perhaps any OS) may be dramatically shortening the life of your laptop's backlight due to lack of power-saving feature / acpi bug / OS configuration / USER STUPIDITY. 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."
Cmon! I've found better posts on third category forums.
Thanks subby for this article. I've got a Hitachi HTS721060G9AT00 in a Mac Mini running Gentoo, and has been for about a year (they make nice little servers), and sure enough this is what I found:
193 Load_Cycle_Count 0x0012 013 013 000 Old_age Always - 873510
873510??!?!?! I run the command a couple times in the span of a few seconds and it seems to be incrementing every second. The drive is only rated for 600000 load/unload cycles!
hdparm -D 255 did the trick.
Sorry for continuing to drift off topic a bit, but I had to mention this as I spent a couple of hours fighting with that display configuration tool only this morning. It feels like it was thrown together in a hurry. Dual head support is completely broken - a simple case of two monitors each attached to the DVI and the VGA ports on a Radeon 9600, it couldn't handle at all, the X server segfaulted on startup. I eventually discovered that this was due to the new RandR 1.2 system in the latest Xorg taking over multiple display related operations from Xinerama, and if Xinerama is enabled it crashes...
:P
All handled perfectly in Feisty by the way. If you haven't upgraded yet and you're running multiple monitors, be prepared for problems
OMG, trolltalk had something useful to say!?!?
windows dont kill your hard drive
ok... it kill all the pc.
wow this captchca sucks
Don't believe that google survey about heat, its for desktops. I went through 3 hard disks on my dell laptop before I started using a laptop cooler (usb tray with fan(s) cooling the bottom of the laptop). Quit eating HD's after that.
They ARE out to get you simply because They are in it for themselves and they don't care about you.
Very interesting.
Peter predicted that you would "deliberately forget" creation 2000 years ago...
FUD
"Time is nothing; timing is everything."
>Given the alternative that Vista is the equivalent of being severely rogered up the rectum by Bill Gates huge, black, barbed member
You know, we don't really want to know that you got fucked in the ass by Bill Gates, nor the particulars thereof.
Thanks in advance for never mentioning it again.
I signed up for an account just to get rid of that, and guess what, I still have it!
I've poured over every setting in the options page.
Halp?
Cheerleading, regeneration, and Linux use! You're certainly a woman of many talents.
Assume I was drunk when I posted this.
Vista is killing hard drives... I don't mean to sound like a troll here, but watching the HDD activity of a Vista notebook (It had 2GB of ram, so should be plenty!), compared to WinXP and Ubuntu, I can tell you which OS pulses the HDD more. I would argue that it is just as bad as Frequent load cycles (which are set by drive manufacturers not the OS, just like most things, MS just ignore and do there own thing anyway) and solely at the Whim of the OS Manufacturer
Say what you will, but my general advice to people is to increase their RAM so that there HDD life is extended, but with Vista it doesn't matter how much ram you've got, hard drive activity is constant.
# cat
Damn, my RAM is full of cats. MEOW!!
Why does someone so in love with M$ read Slashdot?
This laptop is six months old. I'm inclined to worry...
Schwab
Editor, A1-AAA AmeriCaptions
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.
It sounds to me like the HDD mfg'ers are to blame and that there's alot of them to blame. However, I will be shocked if they fix it. Ubuntu is definitely NOT to be singled out for blame if it's common to all/most linux. However, if a hero saves the day, i bet it will be Ubuntu! ...and Queen will be performing the theme song...
Ubuntu...aaa-aa!...He'll save everyone of us!
I used Linux on my ThinkPad T41 for about seven months, switching between distros pretty often. Ubuntu was my most-used distro though. I sold the laptop not too long ago (running Ubuntu) and a few days later a got an angry email from the buyer that his hard disk was broken. I sent back a message confidently stating that, in not so many words, he was full of crap, but also that I'd performed numerous bad block checks, etc. and never had any data loss of other problems with the disk.
Now I wonder if I sold it just in time...!
If you got Vista with the laptop, MS only got about $40 out of the deal. Hardly enough to buy a hard drive, let alone four.
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.
Well, I try to install an OS (XP or Ubuntu), the startup fails after the initial installation (soft lockup on Ubuntu, STOP BSOD on XP). I've tried everything I can think of, and no matter what, the installs just won't stick. I finally caved and bought a new drive (I was installing Ubuntu to get at the x64 version of PCSX2 0.93). I've resigned myself to just using XP x64 edition due to fear of the same thing happening again. If you have a suggestion to restore my hard drive, I'd love to hear it, as I wouldn't mind not letting an 160GB drive go to waste.
Thanks, I didn't know that. So, always install Ubuntu before Windows, or just avoid dual-boots altogether?
oh, *slap*, they're the same person. nevermind.
It's the first setting under Comments. Change Slashdot Interactive Discussion System to Slashdot Classic Discussion System.
"You don't need a weatherman to know which way the wind blows." - Bob Dylan
Even on laptops, I turn of ALL APCI junk, ( They are turned off in the bios of the Sony Vio, I am typing this on. )
The APCI needs to be completely rethough from the concept on. I have never seen a good implementation of it, and its the thing most often fixed in BIOS updates. Starting from that level, no operating system can overcome the crippleware that APCI is, except by bypassing BIOS. Mac OS 8.6 thru 9.2.2 handled the interface amd program control the best, but the OS was so power-saving unfriendly that it made little diffrence in the long run. ( i.e. shortly after a spindown or unload cycle, it would powerup...after about 4 or 5 of these, it would stop powering the drive up, and you could run fast and long without HD spinnign up, the screen semi-dim, and the CPU flying away. )
Its sad that so few users experence the actualy design and implementation of good power saving.
Mabye when the cost of electric power is 10x what it is today, the issue will be revisited as something vagely inportant...
I've popped in a ubuntu live cd in my 1.5 year old Macbook to verify this number, since I couldn't find any (free) tools out there to do this in Mac Os. The harddisk is a SAMSUNG HM120JI, and is exactly 2 months old (Aug 31). Smartmontools reported the load cycle count to be just over 16000. However, running the tool several times on ubuntu revealed that the number incremented at least once every minute. The harddisk was unused, as no filesystems were mounted at the time and there are no swap partitions.
16k in 2 months is about 11 per hour. Or a lot more if I can assume that a head retract only happens when on battery time, and every time the MB is put to sleep or shutdown.
Having a tool on Mac Os would really help in determining the gravity of the situation in this OS. Anyone that knows of such a tool?
Nah. It's just some kind of soap. One wonders why these large, opaque boxes would even be considered as an alternative to windows.
It's the thing that I always feared with Ubuntu : somewhat, this distro never gave me the impression that it was done by inhuman skilled people (I won't go as far as say that they just stole debian code, but...). I know that I'm gonna be burned to have said this, but they have tendances to commit serious errors (see the h4x0r1ng of 5 of their main servers... and they pretend to be a serious competitor in the servers market?).
:P), I feel that I have suffered a great blow in my argumentation. And who could blame them?
I wouldn't care about this if their were not collateral damages about this : for ages, people have said me about that it could damage physically their hardware. I have answered at each times "only in MS propaganda". But now, I must admit to these people that, actually, the most used linux flavor did. After that, no matter how I argue that it's not because an application is the most used that it is the best (cf windows
I had already removed the acpi-support package some time ago. I hate it when my computer develops a life of it's own and does things without being asked. Therefore I tried to removed all dispensable packages. I even considered replacing Ubuntu's init system with a plain startup script and gnome-session with a .xinitrc. And yes, I have done that a long time ago with RedHat.
Tom
See http://ubuntudemon.wordpress.com/2007/10/26/laptop-hardrive-killer-bug/ for useful comments on this.
The high load/unload cycle counts can come from the operating system, BIOS, or hard drive firmware. By default, Ubuntu does not enable 'laptop mode', so it does not do anything to affect load/unload cycle counts.
Although it's not clear that this will kill drives quickly (could be several years, and in my experience hard drives only last that long anyway - a Windows laptop hard disk died on me after 2.5 years on Friday), I do think this is a bug in Ubuntu laptop mode that needs fixing (and probably similar bugs exist in other Linux distros, and perhaps Windows and MacOS X too).
The problem is not the spin down time, but the fact that the drive is being spun up too frequently. You should use the features of laptop-mode to change the page-cache write back time... use lm_profiler to find which processes are causing the spin-ups, and disable, or reconfigure them to cause less frequent writes. This will catch all reads and writes to the disk from processes, but not from the kernel (swap)... so disable swap, and your laptop should go for hours without a disk access when idle...
Of course nothing can stop disk accesses if you are actually loading or saving data...
Another thing to consider is setting your laptop to suspend to RAM when idle, I know some people have problems with this, but it works perfectly for me.
I'm a big fan of Ubuntu. I don't want to see Ubuntu hurt because it's not Ubuntu who is setting these aggressive power management defaults.
/etc/default/acpi-support (disabled by default) which will set your harddrive to use aggressive power management
Some background of the problem :
If your harddrive spins down and spins up again your Load_Cycle_Count increases by one. If your harddrive head parks and unparks again your Load_Cycle_Count increases by one.
You don't want your Load_Cycle_Count to increase too fast.
Harddrive manufacturers seem to claim most harddrives can handle at least 600.000 Load_Cycles but this is probably an average under ideal circumstances. My harddrive started to die slowly when at a Load_Cycle_Count of 200.000.
Ubuntu is NOT causing aggressive power management.
The following things might instead cause aggressive power management settings :
* your (laptop) harddrive firmware might have aggressive power management defaults (operating system independent)
* your (laptop) BIOS might set your harddrive to use aggressive power management (operating system independent)
* you might have enabled laptop-mode in
These aggressive power management settings are set by your BIOS or harddrive firmware. Windows and/or Mac OS X might be overriding these settings which might make Ubuntu look bad if Ubuntu doesn't override these settings.
Read here what Matthew Garret an experienced and well known Ubuntu Developer has said about this problem :
http://www.advogato.org/person/mjg59/diary/82.html
for more information see :
https://bugs.launchpad.net/ubuntu/+source/acpi-support/+bug/59695
http://ubuntudemon.wordpress.com/2007/10/30/ubuntu-is-not-causing-aggressive-power-management
there may be something odd going on in the partition table or boot area of the drive or similar.
try writing over the entire drive with zeros using dd.
note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
I installed the windows port of smartctl and can confirm that the load cycle count increases by more than one per minute on my Acer laptop running Windows Vista. Same behaviour as in Ubuntu (I dual boot). So this is definitely set by the BIOS, not the OS. That said, is this aggressive park setting actually a good feature, since laptops are mobile and you don't want the hardrive head bouncing around on the disk if you move the laptop, accidentally or otherwise?
I did RTFM and I still have questions...
Does this happen in desktop machines or only laptops?
Does this happen only when using a power saving setting or with any power setting?
Does this happen with other distributions? (Fedora 7?)
Yes, it is definitely true. In fact Vista was moved the PC world into that kind of power saving issues - optimizations, process watchers etc. So, my advice is - use less power saving options both OS and motherboard if any.
And spend more time on holiday, find hotels on http://www.dot-hotel.com/
There are programs which make funny noises and play music on commodores floppy drive by bashing the read head into the end position. SO this bug just awakens some nostalgic feelings....
Or you can use GNU ddrescue, which is similar to 'dd' in concept but efficiently handles disks with large numbers of bad blocks through binary search of the good and bad areas: http://directory.fsf.org/project/ddrescue/ Once you've backed up any critical files, just run ddrescue to recover and backup as much as you can onto a good hard disk.
This tool is invaluable when you have a dying hard disk - easy to use and very fast, compared to the similarly named dd_rescue (note underscore) and dd_rhelp. It's available as a package in Ubuntu, Fedora and other distros (sometimes package is called gddrescue), and it's part of the excellent SystemRescueCD, a compact recovery and rescue CD that includes many useful tools and includes support of virtually every Linux, Windows and Mac filesystem.
I had this problem on my laptop but I refused to believe that the only solution to it was to turn off the power saving (which is what the "hdparm -B255" does). That's a crappy fix that deals with the symptom not the cause and I wish more people would just ask "what does it do?" before blindly following recommendations like this on forums!
;o)
A little research revealed that the ext3 filesystem updates it's journal every 5 seconds, coincidentally about as frequently as my hard drive was restarting. Adding a "commit=300" parameter to the mount line in fstab now means my hard drive only restarts once every five minutes to sync the file system and I still get the benefits of lower power usage in between.
On a desktop where the power could go off you would not want this, but if you have a laptop that is running on batteries, there is not going to be any loss of power so the only reason this longer sync period would be a problem would be if the system actually crashed, and everyone knows linux doesn't crash
So it's really an ext3 (therefore Linux kernel) thing rather than an Ubuntu problem, however it would be nice if Ubuntu automatically changed this sync setting when switching between battery and ac power.
Users who are not experiencing this problem are probably using a non-journalled filesystem like ext2.
I looked up the spec for my HD - a Hitachi Travelstar 80GN - and experimented. I'm using Fedora BTW.
First, the APM levels (set with 'hdparm -B') are grouped in logical blocks: setting it to 128 or more (i.e., 80h) prevents the disk ever going to standby mode (at least automatically); similarly, setting it to 192 (C0h) or higher prevents the mode ever dropping to low power idle - no matter how long the period of inactivity. The heads are unloaded in low power idle and lower modes.
So, for my drive at least, the assertion that, with a value of 254, the drive "will still unload heads, but far less often" is not true. I would be suspicious of any other blanket statements about this setting.
From experiments, it seems the raw value of load cycle for my disk does indeed count transitions between low power idle and active idle, i.e., head load/unload cycles. However, the disk is still spinning in low power idle and power consumption is 0.65W, not very much less than the 0.85W of active idle, whereas recovery time deteriorates from 20ms to 300ms.
Based on that, 'hdparm -B192' seems a reasonable setting - higher might improve performance (at the cost of power) but it can't possibly reduce the load cycles any further.
Load_Cycle_Count on my drive is almost at its threshold, no other stat is anywhere near "old age" or "pre-fail". As a raw number, it's over a million.
Further, it definitely looks like a hard drive problem, not a Linux or even a BIOS one: my Hitachi's APM level is a reasonable 128 at power up but anything lower than 192 causes it to do quite frequent load/unloads - that is, if it's allowed to drop to low power idle at all then it will do so frequently and repeatedly without a prudent delay, sometimes several times a minute.
The drive mode transition times are supposed to adapt to the access pattern ("adaptive power save control"); I suspect the algorithm is flawed perhaps because they haven't tested against a sufficient number of usage profiles. Nothing in the manual gives me any reason to believe the drive's sub-192 behaviour is remotely healthy.
I'm going with 'hdparm -B192 -S60 /dev/hda'