This time I will describe how to set up e4rat in order to speed your Ubuntu’s boot time. Let’s begin with some motivation: my netbook used to boot-up in ~40 seconds. Using e4rat, it takes ~10-15 seconds. Impressive, isn’t it? Let’s see how does this trick work, and I’ll teach you how to enable it on your machine.
Prerequisites
Note: e4rat will work only on HDD drives. If you installed your system on a SSD drive, it won’t make any chance. (I will explain this later on, but you may be already uninterested in this article). In case of SSD drives, ureadahead, which is installed with Ubuntu by default, already does it’s best to improve the boot time. Physical HDD drives however, can benefit a lot from e4rat.
Note 2: You need to have your system installed on a ext4 partition in order to use e4rat (which is default in most cases). Furthermore, a kernel not older than 2.6.31 is required. No worries – Ubuntu ships with a suitable kernel since 10.04! Also, e4rat is confirmed to work great with all Ubuntu releases since 11.04 Natty Narwhal.
How does it work?
First, let’s think why does your machine take so much time to boot up. Investigating the boot process, one can learn that if you use a physical HDD drive, most time during startup is spent waiting for your drive to access data (if you wish to investigate it on your own, bootchart is the utility that will help you). This makes a lot of sense, it needs to accelerate the plates, spin them as needed, move other mechanical parts to read information… Because there is lots of physical movement related, the time needed to read a file gets longer. And there can be thousands of files that are required on boot! Things are even worse: if the files are located throughout the whole disk space, much much more seeking for files has to be done (This also explains why the drive can be very noisy on startup!). Luckily, there is no (or almost none) file fragmentation on ext4 filesystems, so at least once the file is found, reading it requires not that much mechanisms movement. But “moving to files” is enough to make your boot take a long time.
First observation that has to be done, is that every time you bootup your system almost the same files are required. This is kind of intuitive, starting Ubuntu on the same machine should require similar stuff every time. What if we could found out what these files are, and somehow move them on the drive close to each other, so that accessing them requires less there-and-back drive movement? Yeah… so this is basically what e4rat does for you.
First, we’ll let e4rat inspect your boot-up, so that it can learn which files are needed to start your system. Then, we’ll use it’s file reallocation tool to move these files in a pattern as optimal as possible. Finally, we’ll let it start before your Ubuntu boots – it will load all the required files at once to RAM …read more
Source: FULL ARTICLE at Planet Ubuntu