Ubuntu 10.04 ureadahead解决办法

Ubuntu 9.10升级到10.04 lucid,启动界面可能会有一行提示 init: ureadahead main process (329) terminated with status 4
解决办法如下:
将/etc/init/ureadahead.conf 文件移除(建议直接重名为.disable,或者其他)
命令行
mv /etc/init/ureadahead.conf /etc/init/ureadahead.conf.disable
重启后就会发现问题解决了

为此专门找到了Ubuntu开发者写的一篇文章,其中提到了这个问题,有全面的解释。

可能由于某些网络原因,我特意转贴过来,大家粗略看看吧

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.

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/27071.html