How to optimize Linux boot with E4rat

e4rat (Ext4 - Reducing Access Times) is a set of tools for speed up the boot process, as well as the applications that load at startup, registering the files used in the first 2 minutes of startup, relocating them y preloading them, thus eliminating search times and rotation delays. This leads to a high hard drive transfer rate.


The process consists of three steps: gathering information about startup, reassigning the files, and then loading them at each startup.

Keep in mind that this only works with magnetic disks and they need to be formatted in ext4.

We will start with download the program.

Before installing it, we must delete ureadahead, so that it does not conflict with it:

sudo dpkg --purge ureadahead ubuntu-minimal

We install the dependencies for e4rat:

sudo apt-get install libbblkid1 e2fslibs

Then we install the program.

Now I am going to explain as easily as possible how to make it work. First, we must edit our grub or grub2 as the case may be:

sudo nano /boot/grub/grub.cfg

Inside the file we look for a line similar to this:

linux   /boot/vmlinuz-2.6.38-10-generic root=UUID=92f37630-c3b4-476b-a0ab-f4a0d9f4180f ro

And we add the following at the end of the line:

init = / sbin / e4rat-collect

In my case, it looks like this:

linux /boot/vmlinuz-2.6.38-10-generic root = UUID = 92f37630-c3b4-476b-a0ab-f4a0d9f4180f ro quiet splash vt.handoff = 7 init = / sbin / e4rat-collect

The previous step we can do exactly the same from startup, when the grub screen comes out, we are on the line of our OS and press 'e' to edit it. In the event that you have several systems installed on the disk, it is easier to do so, since we avoid getting involved with the startup of the others.

Once this is done, we close the editor Ctrl + X, and restart.

When it finishes loading the system, we must open the programs that we usually start more often, such as the browser, mail manager, etc ..., we have two minutes to do it. Once this is done we make sure that the log file has been created.

ls / var / lib / e4rat /

The answer must be startup.log, if it does not show you anything you will have to repeat the steps again.

Now we go back to editing the grub, this time we do it from the home screen by pressing e, as I explained above. And we add the single parameter to the end of the line that we mentioned before, being as follows:

linux   /boot/vmlinuz-2.6.38-10-generic root=UUID=92f37630-c3b4-476b-a0ab-f4a0d9f4180f ro single

We close and restart, but this time we do it in safe mode or from the command line. Log in with our username and password and execute:

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

Once this is done, e4rat begins to move the files from your disk, (it may take a while), when it finishes, we restart.

sudo shutdown -r now

So that the program always runs at the beginning and lasts even if we update, we edit our grub:

sudo nano /etc/default/grub

and we look for the line:

GRUB_CMDLINE_LINUX_DEFAULT = "quiet splash"

We add the following line before quiet splash,

init = / sbin / e4rat-preload

Staying this way.

GRUB_CMDLINE_LINUX_DEFAULT = "init = / sbin / e4rat-preload quiet splash"

We save the file, and reload the grub:

sudo update-grub

We already have it. From now on, the usual programs will load more quickly at startup.

For more information, you can visit the project page at sourceforge.

Source: linux-zone


15 comments, leave yours

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Oswaldo said

    Hello good, thanks for answering, I have tried to do it but I have not succeeded, if you have time to update the post with LM it would be very good, thanks Pablo.

  2.   Let's use Linux said

    At the time I had tried it with Ubuntu. I guess there should be big differences with LM.
    Cheers! Paul.

  3.   Oswaldo said

    Hello good for the contribution, my question is if you have tried it with LM 13? Works?.
    Saludos y gracias

  4.   Let's use Linux said

    Exact! It can also be used in other distros. The idea was to introduce the program, explain the installation steps for the newest (generally Ubuntu users and most of the blog readers). Those who use other distros will surely know what to do or where to look for more info.
    Cheers! Paul.

  5.   beat006 said

    I have tried it and the truth is that I lost my gdm, I am using trisquel 5.0 that is based on Ubuntu 11.04, I want to know if there is any file to edit to be able to recover my graphical environment, thanks

  6.   Joshua said

    It can also be used for other distros, for example Archlinux ñ.ñ
    https://wiki.archlinux.org/index.php/E4rat_%28Espa%C3%B1ol%29

    regards

  7.   Adrian Garcia said

    It won't let me install it, this is what I get in the terminal:

    CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1138 (message):
    Unable to find the requested Boost libraries.

    Unable to find the Boost header files. Please set BOOST_ROOT to the root
    directory containing Boost or BOOST_INCLUDEDIR to the directory containing
    Boost's headers.
    Call Stack (most recent call first):
    CMakeLists.txt: 20 (find_package)

    CMake Error at src / cmake / Findext2fs.cmake: 17 (MESSAGE):
    Could not find ext2fs
    Call Stack (most recent call first):
    src / CMakeLists.txt: 57 (FIND_PACKAGE)

    - Configuring incomplete, errors occurred!

    regards

  8.   Adrian Garcia said

    Ok, you can download the deb package, the sources were downloaded directly to me.

  9.   Envi said

    Registry, relocation, and file preloading looks good, but ...

    Does it take so long to start a Linux distribution? Is it a matter of the services that we have running? Do we keep complaining about the same thing?

    It does not take me more than to turn on the cell phone and enter the identification code, and I have a drama with Ext4 since my current rescue distro, Slax, does not manage this file system at the moment, which already takes time. 😉

  10.   Adrian Garcia said

    Does something like this happen to anyone else?

  11.   silvafull said

    You have to edit the grub configuration file as super user of the system ... Obviously this way it won't save the changes. Cheers…

  12.   Ja said

    Only for Ubuntu?

  13.   Adrian Garcia said

    Well, I have problems when editing from boot.
    Pulse e, adding single to the line and pulse ctrl + x
    After this the screen goes black and I have to restart.
    I go back into the editor and see that the change has not been saved.

    regards

    1.    mcbanana said

      Thanks, it worked perfectly on Debian. Too many dependencies (libboots) but everything ok.

  14.   Lorenzo said

    I guess this optimization is useless for SSD drives, right?