How-To Geek

How To Cut Your Linux PC’s Boot Time in Half With E4rat


Linux is pretty quick to boot on modern computers, but why not pare it down some more? If you’re hurting from a lack of SSD or just want to boot faster, E4rat will easily shave down your boot time.

Note: this article was written for Ubuntu 11.04 so it’s very possible that it doesn’t work anymore.

E4rat and Your Linux PC

E4rat is a utility that’s designed to cut your Linux boot time drastically. Essentially you show it what you do when you start your computer normally, and it analyzes the files you access and use. Then, it’ll move them to the beginning of your hard disk so that it takes less time to find them during boot.

E4rat is designed to work with Ext4 partitions only. If you’re using another file system, this isn’t for you. There are reports of it working with LVM but your mileage may vary, so be careful if you have sensitive data.

Furthermore, if you have an SSD, you should stay away from this. Because E4rat moves files for a better seek time, SSD uses won’t see any benefit as their “seek” time is unaffected by this. By moving files and performing extended writes, you may even end up damaging your already-blazing-fast drive.

Installing E4rat on Ubuntu

E4rat is available as a .deb package for Ubuntu users. If you’re running another Linux distro you’ll have to compile E4rat from source, but things should work fine and you can still largely follow this guide. The only real exception is for people who use Debian – take a look at this note before you continue. For our step-by-step guide, we’ll assume you’re running Ubuntu Natty (11.04).

Head over to E4rat’s Sourceforge page here.

Google Chrome_001

Click on the latest version, then download the file that’s appropriate for your architecture.

Google Chrome_002

I’m running a 64-bit installation of Ubuntu Natty, so I chose the “amd64” version.

Now, if you try to install it right now, you’ll get an error because Ubuntu’s default “ureadahead” package conflicts with E4rat.

Ubuntu Software Center_008

Ureadahead is similar in concept, but doesn’t work as well as E4rat, so let’s get rid of it. Open up a terminal and enter the following command.

sudo dpkg –purge ureadahead ubuntu-minimal


Enter your password and let it do its thing. Next, let’s make sure the proper dependencies for E4rat are present.

sudo apt-get install libblkid1 e2fslibs


You should have them already installed by default, but if not, this command will install/upgrade to the latest version.

Now when you double-click the .deb file you downloaded, you won’t see that error and you can just click the Install button.

Ubuntu Software Center_012

I happened to get an error at this point, but you can just click on ignore if you get it. Once everything’s done, restart your computer, but stay at the Grub menu.

Gathering Data

With E4rat installed, we need to make sure it gathers its data properly. To do this, we can edit the parameters for our next boot. Make sure you’re in the Grub menu.

Photo Aug 05, 3 42 58 AM

Highlight the option you normally use to boot into Linux and hit the “e” key. Look for the line that starts with:

linux /boot/vmlinuz…

Photo Aug 05, 3 45 14 AM

It’s the second-to-last line in the above pic (click on the image to see a larger version). This line is what tells the Linux kernel to load. At the end of this line, add the following:


Photo Aug 05, 3 45 21 AM

Then, just hit Ctrl+X to continue booting. This tells E4rat’s collect program to start running after boot. Let your computer do its thing, and log in. For the next two minutes you should do what you normally do when once you log in. For me, that entails loading up both Chrome and Firefox, opening terminal and running Screen/Byobu, and getting Nautilus and Shutter opened so I can check my files and take screenshots.


As you can see, those first two minutes are pretty crucial. I clicked on everything within that two minute window that E4rat uses, but not everything loaded until several minutes later. That’s okay, though, so long as you start the application loading, you’ll be fine.

Let’s check to make sure the proper log file was created. Open up terminal.

ls /var/lib/e4rat/


You should see a file a displayed that’s named “startup.log”. If this file isn’t created, you’ll need to restart the process.

Moving the Startup Files

Once you verify that the log file is there, restart your computer and stop at the Grub screen. Choose your booting option and hit “e” once again.

This time, we’re going to add some thing different to the end of that same line:


Photo Aug 05, 3 55 58 AM

Hit Ctrl+X to boot, but this time, we’re heading into the command-line straight-away. My machine took a little while, and then gave me a screen with several option. If this happens to you, just choose the option for “Resume normal boot.”

Photo Aug 05, 3 59 21 AM

Then, if you don’t get to a command-prompt, hit Ctrl+Alt+F1. You should now see a login prompt.

Photo Aug 05, 3 59 59 AM

Enter your username and password, and then enter the following command:

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

Photo Aug 05, 4 01 19 AM

Enter your password, and E4rat will start moving files on your hard drive.

Photo Aug 05, 4 01 29 AM

This may take quite a while depending on how cluttered your disk is. Just watch the hard drive light blink and wait patiently for things to finish.

Photo Aug 05, 4 01 49 AM

The official website recommends that you run the command a couple more times until nothing else can be moved. My computer gave me that message right away, so your mileage may vary.

Photo Aug 05, 4 03 46 AM

Now, let’s restart our machine with

sudo shutdown -r now

and log in normally to complete the last phase.

Configuring Grub to Run E4rat On Every Boot

Open up a terminal and enter:

gksu gedit /etc/default/grub

Ubuntu’s Text Editor should pop open. Look for the line that starts with “GRUB_CMDLINE_LINUX_DEFAULT=”


We’re going to add a line inside of the those quotes and before whatever options are there.


Your file should look similar to this:


Hit the save button and close Gedit. Now, return to the terminal and run one last command:

sudo update-grub


Configuring Grub this way (and NOT by editing /boot/grub/grub.cfg) will make sure that this lasts between updates, although you may have to redo this if you upgrade between releases in the future. By then, however, you’ll probably want to redo this entire process so that the right files are in the right places.

The next time you reboot, you’ll notice a sizeable time difference in booting and in opening the apps that your normally head straight to. My netbook’s boot time is now about 10 seconds!

Know of any other tricks to shave precious seconds off of your boot time? Share what you know in the comments!


Yatri Trivedi is a monk-like geek. When he's not overdosing on meditation and geek news of all kinds, he's hacking and tweaking something, often while mumbling in 4 or 5 other languages.

  • Published 08/5/11

Comments (24)

  1. Ivan Lapis

    Bookmarked for future reference! Thanks :)

  2. Stijn Verwaaijen

    Sounds very tricky to me. Is it?

  3. Megagamerx1

    @Stijn Verwaaijen I thought it was pretty easy (as in painless), but I needed to use a second computer to view the instruction during the process…

  4. Ankur

    looks pretty complicated

  5. jphey

    Did it and it shaved about 1 hole minute (was 2:36, got 1:38), I have seen this elsewhere but from that tutorial I figured there was too much that could go wrong, so I didn’t do it. This one seemed (and is) much more foolproof so thank you HTG!!

    By the way, what DE/WM are you using so you can get a 10 second boot time???

  6. rMatey180

    I use sysv-rc-conf and turn off those things that I’m not using, like bluetooth. Really helped my boot time. Its in the repositories. Type that with sudo in command-line, then you get a GUI.

  7. jphey

    thanks! I will look into it ;-)


    wah! GREAT TIP!

    i oso use Linux Natty + Windows 7


    Appear with “ls -a”

  10. Eyad

    I tried it, Only 6 seconds difference… Not worth all the hype

  11. TheJoker

    Every second counts !


    I do the same thing just after installing Ubuntu 11.04. That’s work !

    And what operations should I do if I need to do this again, after a “long time” and a lot of system’s updates ? The benefit seems to be lose after a long time, in my opinion…

  13. YatriTrivedi

    @jphey: Using Gnome2 with Ubuntu Natty on my desktop, I’ve hit 10 seconds. I also tried this on Crunchbang Linux on my netbook, and hit about 12. That’s pretty quick!

    @eyad: It’s more important when you’re out and about and using a netbook. booting fast makes a huge difference sometimes! Obviously, depending on what you do and how you use your computer, your mileage may vary.

    @sanchez: For the most part, running this once every 6 months or so should keep things quick. Ubuntu updates every 6 months or so, so after an upgrade or clean install, rerunning this should work. It’s mainly to speed up apps that you use right after boot, so after significant updates of these apps, it might benefit you to rerun the process. I haven’t had any real problems for the past few months, though, despite updates!

  14. Enric Martinez

    EEEEEEEKKKKK!!!1 I want it, I want it NOW!!
    I am not sure to really need it and I can trim services and stuff myself… but… since when has this stopped a Real Geek(TM) from installing random stuff in a perfectly working machine? Can’t wait to put my hands on it!!

  15. Josh Fowler

    I seem to be getting a problem with the e4rat-collect file.

    it seems to run but no file is made and the folder for e4rat in /var/lib/ is not present.

    any ideas?

  16. bob

    MyDefrag for windows does a similar thing when defragging the whole hard drive and actually speeds up a fresh install of windows 7!

  17. some-kid

    i didn’t notice any boot time difference compared to ureadahead. however, all the apps i ran while e4rat-collect was running opened up much faster than when i logged them into ureadahead.

  18. some-kid

    also josh, make sure u dont have the grub entry double spaced and also another thing make sure u are booting from a generic ubuntu kernel, not a custom-compiled, ran into that one myself.

  19. neutron

    I followed this tutorial and now my bootup time is significally longer although the time to load applications is indeed shorter. Because of this I basically consider this useless for me. Problem is; how can I uninstall this? I removed the grub line but after that my computer couldn’t boot up anymore!

    Help appreciated!

  20. Josh Fowler

    i tried several times and didnt double space it, my install of ubuntu is pretty messed up it says install release in the menu n stuff so that might be a problem but i dont want to reinstall because effort lol ill make and external ubuntu and try this out with that as a model.

  21. Willie

    Its nice, but I am not in that big of a rush. I find Ubuntu load time to already be pretty fast.

  22. Maher Sallam

    Just a note to ubuntu users: If you upgrade your kernel, make sure to re-install e4rat again after your FIRST reboot with the new kernel. That’s because in your next reboot e3rat would be gone and you won’t be able to boot into ubuntu.

    If you forget to do it (like I did), just press ctrl+c when you are on the grub boot screen and remove ‘init=/sbin/e4rat-preload’ and then press ctrl+x and you will be able to boot. When you are logged in, just install e4rat and it will work without having to recollect your files, because the log file doesn’t get deleted.

  23. nathan

    i did this, and it lost my docky config.. not a big issue, but strange, nonetheless

  24. Aveesh


    Thx for the detailed info but it didnt work for me. Step 1 worked and the startup.log file was generated. However, editing grub menu the second time by putting single – only blacked out the computer – i tried it 5 times and waited more than a couple mins – nothing – so I am wondering what to do? I am running ubuntu 11.04 32 bit on sda2 (sda1 is winxp) and on an intel core 2 duo 4 gig ram….

    any ideas? thx for your post though – i can see it has helped others – i guess i got gteedy thinking i’ll reduce my 30 second startup time…

More Articles You Might Like

Enter Your Email Here to Get Access for Free:

Go check your email!