E4rat

This article explains how to speed up boot with e4rat. e4rat is a tool to speed boot up by first monitoring files used for the boot process, then arraigning the files in an optimized way on the disc. This gives substantial improvements for booting from hard drives (it is of little use for SSDs). e4rat works only with NATIVE ext4 file systems, so partitions used for boot (probably root partition) must be a pure ext4 partition.

Installation
Emerge e4rat:

Kernel Configuration
To use e4rat you must enable auditing support in your kernel. If you use genkernel auditing support may already be enable, if not, enable:

Compile and install your newly configured kernel.

Usage
e4rat has three main components :
 * - Monitor files, this is run in place of init, from grub, to determine what files should be included in the optimization.
 * - Reallocate files, run once files have been determined.
 * - Preload files, loaded from grub on subsequent boots.

e4rat-collect
Append the following to your kernel line in your grub or grub2 configuration file. Instead of modifying the grub configuration file, you could add the command from the grub command line itself. init=/sbin/e4rat-collect When you reboot e4rat-collect will monitor files opened during the first 120 seconds, so boot up and log in as your main user. You could open a file manager or web browser if you wanted. Wait for the two minutes to finish. When is complete you should have the log file. Remove the modification to grub configuration if you changed it.

e4rat-realloc
Quit any X sessions and log into a root terminal. Change to runlevel 1 :

Now run e4rat-realloc :

Wait until completion, it could take a while. Sometimes it is useful to run it several times.

e4rat-preload
Now permanently modify your grub configuration by adding : init=/sbin/e4rat-preload

You should just need to reboot to see the difference.