E4rat

From ArchWiki
Revision as of 09:07, 5 April 2011 by Toad (Talk | contribs) (Created page with "Category:Boot process How to drastically reduce boot and log-into-X time for ext4 file systems using [http://e4rat.sourceforge.net/ the e4rat range of tools]. <!-- {{i18n|e4...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

How to drastically reduce boot and log-into-X time for ext4 file systems using the e4rat range of tools.


Overview

e4rat stands for e4 'reduced access time' and is a project by Andreas Rid and Gundolf Kiefer. The e4rat range of tools are comprised of e4rat-collect, e4rat-realloc and e4rat-preload.

Process

If you look at a classical boot chart you will notice that neither disk nor CPU are utilized fully during the boot process. e4rat changes this to make full use of both disk and CPU during boot process and thus reduce boot time drastically. It consists of three stages:

  • e4rat-collect - collect files required for booting into X (on my KDE system 2806)
  • e4rat-realloc - reallocate files
  • e4rat-preload - preload them

Installation

Anybody willing to write a PKGBUILD is most welcome. In the meantime get the latest tarball from here.

Dependencies

Install the following:

  1. base-devel - in core
  2. boost - in extra
  3. audit - in AUR

Install

Download to your favourite directory and unpack. Enter that directory and run

cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=release

followed by

sudo make install

You should now have the following files:

  • /usr/sbin/e4rat-collect
  • /usr/sbin/e4rat-preload
  • /usr/sbin/e4rat-realloc

Getting it to work

Now for the nitty-gritty:

e4rat-collect

To have e4rat collect a list of files you will need to append the following to your kernel stanza in your /boot/grub/menu.lst (grub legacy) or /boot/grub/grub.cfg (grub2) file:

init=/usr/sbin/e4rat-collect

This will only have to be done once so you may prefer to append this command on the grub command line itself.

Upon booting e4rat-collect will watch your system for a default of 120 seconds. So if boot, log into X, open your favourite browser and email client all within 2 minutes, all those activities are logged. To change the default of 120 seconds edit /etc/e4rat.conf

Upon successful boot and after having waited 120 seconds you should see the following file: /var/lib/e4rat/startup.log

Do not forget to remove the e4rat-collect command from your menu.lst or grub.cfg file (not necessary if you inserted it on the grub command line).

e4rat-realloc

For the reallocation process change to init 1

sudo init 1

Log in as root and run:

e4rat-realloc  /var/lib/e4rat/startup.log

This can take a while depending on how many files you have your startup.log file.

e4rat-preload

Append the following permanently to your kernel stanza in your /boot/grub/menu.lst (grub legacy) or /boot/grub/grub.cfg (grub2) file:

init=/usr/sbin/e4rat-preload

Out of interest

Why don't you install bootchart and have it run before and after e4rat installation and gawk at the difference.