Howto Fix ureadahead problem after upgrading to Ubuntu 10.04
Posted Under: General
After upgrading to Ubuntu 10.04,some get “init: ureadahead main process (329) terminated with status 4″ error at startup.This can be fixed by directly remove the file:/etc/init/ureadahead.conf.
open terminal from Applications->Accessories menu and type this to do it:
sudo mv /etc/init/ureadahead.conf /etc/init/ureadahead.conf.disable
Something about ureadahead written by Ubuntu developer:
All about ureadahead
Hey folks, we developers don’t get the spare time to hang out on the forums for most of the release cycle, but in the past day I’ve tried to keep up with various boot-related issues and I’ve seen a few posts about ureadahead – and people recommending removing it.
I thought it might be a good idea to try and explain what it does, how it does it, and why “status 4″ is a good thing.
Also I want to stress that I’m not going to tell you that there’s nothing wrong with it, and that you haven’t had a genuine issue, but just that I haven’t heard about it if you have! I’d really appreciate it if anybody who is having problems could help out with some debugging to understand the problem, then I’ll be able to fix it for you and everyone else!
What does ureadahead do?
In order to boot Ubuntu, we need to read somewhere between 100MB and 200MB of data from the disk and into memory. Unfortunately the slowest part of your otherwise awesome machine is its hard disk — that’s why we want this data into memory in the first place.
Hard disks aren’t just slow to read data, they’re slow to find it as well! So we can lose a time of time during boot just waiting for the hard disk to find the data we need, and then read it into memory.
What ureadahead does is figure out what pieces of which files we actually need, and read everything from the disk into memory in one go. By doing it at once we don’t need to spend so much time finding everything, and because it’s already in memory, we don’t waste anywhere near as much time during boot.
It’s just for SSD right, not rotational HDD?
No, quite the opposite. You’re thinking of sreadahead (“Super-readahead”). This was a similar tool written by Intel for their Moblin project, and is very unashamedly optimised for SSDs.
We tried it for a while, but found that its performance was simply terrible on rotational hard drives.
I sat down, drank a large amount of Tea, and wrote ureadahead (“Über-readahead”) to replace it. ureadahead from the get go was unashamedly optimised for rotational hard drives, that’s not to say it’s poor on SSD either, it performas at least as well as sreadhead there.
But ureadahead takes several seconds of my boot!
Yes it does; it’s reading all the data in one go. If you didn’t have it, those several seconds would be simply spread out across everything else, and probably last two or three times longer!
I looked at bootchart, and ureadahead doesn’t get full throughput
Even though ureadahead reads everything in one go, and is heavily optimised to read everything in the actual order it’s on the disk, it still has to skip over the bits it doesn’t need.
This “seek time” is the same performance penalty as finding data in the first place.
The only way to avoid this is defragmenting your disk.
But Linux filesystems don’t need defragmenting!
Whoever told you that is deeply mistaken, this is one of the most common myths of Linux.
What is true is that Linux filesystems avoid, where possible, fragmenting their inode tables. This means that the index of how files are split up (fragmented) across the disk, and where those parts are, tends to be kept together as a whole.
That’s a good thing; fragmentation of inode tables is a big problem for other filesystems (FATs in that filesystem, etc.) so by keeping them together, it wins a lot of performance.
But the data itself is still fragmented, and spread all over your disk in a random order. And unfortunately during boot, it’s the data we need.
One of the future things we want to do is use the ureadahead analysis of what we need during boot to feed into a defragmenter, so everything we need is in one big block on the disk.
When does ureadahead reprofile?
Any time a package is installed or upgraded that contains a file in /etc/init or /etc/init.d; this is a bit brute-force, and means we’re probably reprofiling a bit more than we’d like.
To force a reprofile, simply remove the “pack” files in /var/lib/ureadahead and reboot.
In a future version we intend to move to each boot improving the pack file by identifying things read that were never used, and new things that weren’t read last time.
When does ureadahead stop profiling?
ureadahead slightly assumes you’re using auto-login; so waits about 45s after the display manager starts before it stops reprofiling. If you’re logging in with a password, and want your desktop files included in the pack, type quickly
(This will be addressed in a future version too).
ureadahead slows down my boot!
I want to hear from you! It really shouldn’t; to give you an example of the savings, my trusty laptop boots in about 1m30s without ureadahead – and only 30s with it.
Make sure you have the bootchart package installed. Remove the ureadahead pack files, and move the /etc/init/ureadahead.conf file to something like ureadahead.disabled. Reboot, login, etc. and wait for the bootchart to appear (“watch status bootchart” until stop/waiting).
Now put the ureadahead conf file back, reboot and login again and wait for bootchart to appear.
Finally reboot and login once more, and wait for bootchart to appear.
You’ll now have three bootcharts. One is without ureadahead, one is when ureadahead is profiling, and the final one is with ureadahead behaving normally.
File a bug report on ureadahead (Ubuntu-bug ureadahead) and attach these three files along with the output of “sudo ureadahead –dump” (this is quite a bit, so capture it in a file).
I’ll take a look, and we’ll see if we can fix that bug for you!
ureadahead exits with status 4!
This isn’t actually a bug
Status 4 (usually ureadahead-other exits with this) means that you had a mountpoint in your fstab that didn’t have any files on it needed during boot. Probably that drive with all those MP3s and movie files on it.
It still reads everything needed during boot, the status is just there for me to debug other issues.
The real bug here is that Upstart spams the console with that message,even though the ureadahead-other.conf file has “normal exit 4″ in it!
(In other words, If your boot fails, this message is completely unrelated to that! It’s more likely that there is an issue with the X server starting, or an issue with init scripts not being run — a good clue might be whether you see a login: screen after pressing Alt+F2)
Last edited by keybuk; March 22nd, 2010 at 08:23 AM..
Related posts:
- no background wallpaper problem after upgrading to Ubuntu 11.04 Natty
- “signal out of range” problem after Ubuntu 11.04 Natty Installed
- Howto Change Plymouth themes (initial splash screen) in Ubuntu 10.04
- Fix Left Click not working after upgrading to Ubuntu 10.10 Maverick
- Fix Wifi failed to work issue after upgrading Ubuntu 10.10

Reader Comments
Your website is trying to install malware. NoScript shows scripts trying to run from kdjkfjskdfjlskdjf.com. Might have to clear out cookies as well to see it.
[Reply]
After upgrading to 10.04, my machine seemed to totally lock up, and this message from ureadahead was the last thing displayed on the screen. SSH wouldn’t work, nothing would work — only CTRL-ALT-DEL would reboot.
However, as has been said, the “exit 4″ code is a normal status message from ureadahead. ureadahead is not what’s locking up.
I’d removed the “quiet splash” from the kernel boot parms in /boot/grub/menu.lst, planning to actually *see* all the boot messages (which I much prefer), instead of some splash screen, regardless if it flickers or not (upstart, the new boot system from Fedora and adopted now in Ubuntu 10.04, claims its major purpose is to prevent boot screen flicker; that’s such a non-worthy goal, imo). Anyway…
Turns out there was a problem with my RAID setup and /etc/fstab wasn’t reflecting all the correct drive assignments, so the boot process (which formerly would have printed in text something about broken /etc/fstab and hit ctrl-D or type root pass to get a shell and fix the problem) froze up, attempting to display the problem message on the flashy, *non-flickering* Upstart screen (which wasn’t displaying, because I’d turned it off in the grub kernel parms), so the system sat there, not running SSH or anything else, waiting for keyboard input, displaying the last known output from the last thing to run properly, which had been ureadahead.
Now, see all this problem from changing the way it’s been for decades? Upstart doesn’t really do what I want anymore (it doesn’t show the text output from the bootup processes) and it in fact appears to cause lock ups and confusion that take days to figure out. And then it ripples out across the globe. Judging from the amount of problems reported on this single issue, I know I’m not alone.
I propose Upstart be either totally removed, especially from the Server version of Ubuntu, or else modified so that it can properly support text-only mode (i.e., “quiet splash” removed from kernal boot parms) and properly show errors and accept keyboard input while in this text-only, non-graphic mode.
[Reply]
Bret Jordan Reply:
September 24th, 2010 at 10:40 pm
My frustration with the whole ureadahead and upstart and for that matter the new Grub 2.0 crap is that the developers and marketing departments are talking about how much time we are saving and how much faster things will boot. But what they are forgetting to put in to their magic formula is how much time it takes to troubleshoot a problem when one of these three things does not work just right. So I save 60 seconds on booting a server with ureadahead and I save a few minutes here and there due to alleged easy of use for the 2% use case with upstart and grub 2.0. But I loose hour upon hour of troubleshooting when one of these three things does not work right. So in the server case, I have a server that does not boot right because of ureadahead, upstart, or grub2.0. How many HOURS is this server off line while I try to troubleshoot the problem and fix it? I have more then lost any value in these tools when historically for the 98% use case, I could easily just edit a file here and there and recover a system. In the server offering it needs to be just brain dead simple. Stop trying to think for the admin and anticipate what they may or may not need. Give us a simple text file of the order that things should load (think slackware) and be done with it.
[Reply]
Eric Reply:
November 16th, 2010 at 8:02 am
The trouble with this reasoning is that your time aperture for analyzing is too small. Everyone will go through a little pain now while the kinks in the feature are worked out, but then everyone’s system will boot faster for decades to come.
Based on your reasoning, we would need to abandon forward progress (or at least significantly slow it down) in the name of keeping everyone’s system running perfectly.
Nothing risked, nothing gained.
[Reply]
Bret Jordan Reply:
November 17th, 2010 at 11:39 am
No that is not my reasoning at all. The server platform and the desktop platform are different and should be viewed differently. We should be very cutting edge on the desktop platform. But the server platform needs to be rock solid and simple. Once all of the issues and bugs and flow issues get resolved in the desktop platform, we can move them over to the server platform.
I had a server that would not boot and after several hours of research I found that it was a problem with ureadahead. I worked through many forums and guides trying to “fix” the issue. But after another hour or so, I could not have the server off line anymore, I just removed ureadahead “apt-get purge ureadahead” and the server came right up. So the server was off line for nearly 3 hours what does that do to my four 9s of uptime? Saving 30 seconds on each reboot, where I may reboot 3-4 times a year, does not make up for it.
Another problem, Upstart. There is NO way to figure out what starts in what order. So when you have service that does not start at the right time and then dies because everything that it needs is not ready, this is very frustrating and painful to troubleshoot. I have had several discussions with the author of upstart and he has plans of adding something like this. But it is a long time out. Once again, we are jumping the gun with adding this to the server platform. The server platform needs to just work and be simple brain dead easy to troubleshoot and fix. Lets NOT run down the M$ path of doing things. Lets not artificially make things difficult for the 1-2% use case.
Matt Wall Reply:
March 27th, 2011 at 8:31 pm
“Nothing risked, nothing gained.”
Yea, that’s very good I agree! And Keep It Up, Please!
That’s the success of ubuntu. I don’t doubt that.
But don’t release a buggy release. An ordinary user don’t see it that way. All they see is that Ubuntu is well not worth the trouble. And Ubuntu is for the ordinary users, right!
all I find in /var/lib/ureadahead$ is
debugfs
is this the “pack” file?
[Reply]
I’ve installed Kubuntu 10.04 twice, and both times the system boots up fine the first time, but as soon as I reconfigure it to my taste and reboot, it fails with ureadahead status 5. On both occasions, the kubuntu installer has also installed grub in such a way that I can’t boot into the other distributions on my hard disc. That is no doubt a different bug, but it does render the first one more serious, as I can’t get back in to reinstall lilo !!
On all my systems, I maintain three pairs of partitions for / (8 Gb) and /var (4 Gb) of three distros. At the time of upgrade, these contain the current version of ubuntu before upgrade, the new version to which I am upgrading, and a previous version no longer in use. One of the first things I will do in my new installation is manually alter /etc/fstab to mount the other distributions (in this case, upgrading to lucid, they will mount at /distro/karmic and /distro/jaunty), so I can copy files across. At this stage I will also add the other _big_ partitions, which mount at /home/users and /home/Photos (and a few others). To support editing these files, I hack /etc/apt/sources.list and add a few packages, including kde3-kedit. After this, rebooting reveals the ureadahead problem.
Now an ubuntu version lasts six months, which means, if I am deeply unlucky, I will reboot my system a dozen times, but mostly, it would be less. Saving five minutes on boot time will thus save less than an hour during the life of the distro, whereas a single failure to boot will cost me a lot more than that. For my desktop machines, I want to tick a box that says “bombproof safe” rather than “fast to boot”. For laptops, I may make a different choice (although installing lucid on my laptop seems to have worked OK).
At the end of all this, I still have no idea how to get my system to boot into lucid….
[Reply]
Ethan Reply:
June 21st, 2010 at 8:20 am
I installed 10.04 and ran it without issue for a few weeks, then last night installed the latest stable kernel 2.6.33 and did a sudo update-grub. Everything seemed fine until I rebooted this morning when I got the ureadahead error with “status 5″ – and some other errors. I rebooted again and saw some more errors, but then it booted normally. Any ideas?
[Reply]
After applying routine updates, my system would no longer boot. I’m sort of a newbie, but the command provided above did allow my system to boot. In order to run it I had to drop into single user mode to get the system to boot. If I had been a total newbie, I probably would have moved back to windows.
mv /etc/init/ureadahead.conf /etc/init/ureadahead.conf.disable
While it may not have been root cause, it did that the system out. While troubleshooting this the fstab file comments made reference to a vol_id command which did not exist on my system. I was not able to figure out what uuid’s were what. I found the command blkid helped me identify that there was one bogus swap entry in the fstab file. Now everything boots, but I have to say, it doesn’t seem to boot any faster. I have one ide drive which has my OS on it, and 4 drives in a raid 5 array.
[Reply]
After spending two days fighting with my “server” I totally agree with Bret. I see two options here.
1) developers remove all the Ubuntu specific hacks out of their server platform
2) stop offering this re-branded version of their desktop altogether
On a side note, I see we are now up to 10.10 but still without even a mention of upstart in Ubuntu’s server manual.
[Reply]
Thanks, disabling the ureadahead.conf solved the ureadahead error with exit status 5 msg during boot
[Reply]
Allow me to add my voice to the chorus, with one caveat:
The desktop does not, repeat *NOT*, necessarily have to be “bleeding edge”. For the longest time Ubuntu’s claim to fame was that “it just works”. Sadly this is no longer true.
I run Ubuntu “desktop” as a server O/S, because there are times when the GUI is actually more efficient – like now, I’m trying to make sense out of Upstart and I’m on Firefox reading all kinds of contradictory [crud] that appears to have no relation to my system whatsoever.
My proposal is this:
1. Make the x.0x releases concentrate on stability and ease of use/configuration.
2. Make the x.1x releases the “bleeding edge” experimental releases. Once things are worked out in the .1x releases, they can then be moved to the .0x releases and (possibly) the server releases.
3. If Ubuntu, et. al. are going to throw stuff like Upstart in, they should darn well make sure the documentation is up to snuff. I have been spending WEEKS trying to figure out what does what when and how, so that I can configure my system to my liking – and I feel I am no closer to a solution than when I started.
4. Even if we assume that Grub2 is the answer to a maidens prayer, (and IMHO that maiden is pretty darn desperate at this point!), it could have been made much more user-friendly, rather than resurrecting everything that made LILO hated and despised throughout the known galaxy. Grub’s popularity was based primarily on the trivial ease with which it could be re-configured to meet a specific need. Grub2 tosses all that progress away and (IMHO) returns us to the dark-ages.
I will admit that many of my needs may well be “edge cases”, but it is the recommendation of folks like us that helps drive Ubuntu’s adoption in the “non-geek” arena. Making our lives difficult is (again IMHO) abysmally counterproductive.
What say ye?
Jim
[Reply]
As a desktop user — this is unacceptable. Especially since I am using ubuntu for work.
I don’t understand nor do I always have to patience to read much less understand and perform troubleshooting for this.
I used to spread the word to fellow co-workers to use ubunutu as an alternative to Windows for the obvious reasons that it works minus the cost of licenses and the head-ache of viruses and what not. But getting this kind of problem — really really sucks and making a bad impression for me and Ubuntu and any other Linux distribution.
Have to rant as I am in the middle of ‘fixing’ a fellow coworker with something like this. Pride’s being eaten alive as they keep on letting me face MS Windows. And I still don’t have the knowledge to make this right.
I know the intention is good in getting ubuntu the much needed advances for computing comfort — so make it so………..not this.
Man, what a time to get these kinds of problem — I’m always saying that ubuntu just works — what gives?
[Reply]
See I just ranted — before I read the whole blog. Sorry, ureadahead was the last I could see – so I assume that’s what causing the problem — I still don’t know what it is though!!!!
Sorry for the rant. I believe, ureadahead is not the problem….. Now if only I could update the desktop using a live cd…..
[Reply]
Thanks so much for such a detailed explanation of ureadahead!
If every developer took the time to explain what their component does and how it does it, so that we laymen like me can understand I’m sure there would be far more appreciation going around.
You explanation helps me to understand what my system is doing and that’s a huge step towards being able to fix any problems it has myself.
Thank you
[Reply]
Hi I’ve got into your page looking for the “ureadahead” problem. There is a great description on the site, however after solving mine, it was not related to ureadahead, it was just the last line linux was reporting before just hanging there, so people might believe that their systems are not booting because of this.
In my case it was that my secondary drive (where I store the swap partition) had bad sectors. Hope it helps anyone.
[Reply]
I’ve just built a new PC and tried to install Ubuntu 11.04 on a SSD. I couldn’t get the system to install at all I just get errors that the drive is inaccessable. I can format the partitions in terminal with cfdisk which lets the installation begin and it gets 25% done and then gives me the same error unless I format all the partitions to ext2. This gets me through the install, but then it is super long to boot, like twice as long as my other system that has half the processing power and I get ureadahead errors. I don’t know if the problem is ureadahead or if Ubuntu is just not capable of recognizing my SSD.
[Reply]
What happens when you are running a server remotely?
This means, no screen, no mouse, no keyboard…
Also if it does not boot…. how can you remove ureadahead? Or how can you know what is going on if messages are not displayed? The thing is not booting!!!
[Reply]