
3x faster linux boot with e4rat - jewel
http://e4rat.sourceforge.net/
======
driverdan
It's an interesting project. I wish we had it 5+ years ago when it mattered.

The only place I'd use a spinning disk as my primary drive is on a server and
that's something you rarely boot. If you're not using an SSD skip a month of
Starbucks and buy one. Disk IO is far and away the biggest bottleneck for most
users. An SSD will increase your productivity profoundly.

~~~
Danieru
I did buy one, then it broke.

Once you factor in the re-installs the latency of spinning rust looks a bit
better.

~~~
driverdan
All drives can fail. Not including servers I've managed I estimate I've had
more than 10 hard drives fail, all of which were well below the manufacturer's
stated MTBF.

My first SSD (low to mid range) failed within the first 3-6 months but the
replacement has been going for almost 2 years now.

~~~
mauriciob
The replacement is always better... somehow.

~~~
j_s
Is this similar to how lost things are usually in the last place you look for
them? It does make sense that people would continue replacing something until
it worked!

------
yason
Ten years ago, BeOS booted in ten seconds without any special tricks. That was
on late 90's and early 00's hardware. Certainly it didn't access hundreds of
megabytes of libraries and files in order to boot as a modern Linux does, but
it was also specifically designed that way even by the contemporary standards.

And don't get me started about the 16-bit era... Machines were slower then but
using them was generally faster.

~~~
rbanffy
30 years ago, my Apple II booted into a REPL in less than one second. 3 if you
needed disk support.

And that was on a 1 MHz 8-bit processor.

There were people who could toggle a bootstrap loader into an Altair in less
time than a modern x86 PC takes to boot.

------
dwc
Laptop: open lid and resume. Server: RAID startup dwarfs OS startup.

Does super fast booting matter much these days? It's just about ceased to
matter to me completely.

~~~
kijin
I try to avoid using sleep/resume when I'm away from home, because it
partially defeats the purpose having full-disk encryption on my laptop. A
thief who steals it when it's powered off has no access to my files. On the
other hand, a thief who steals it when it's asleep might be able to get around
the login once it wakes up.

So yes, it sucks to wait 30-40 seconds for a reboot.

~~~
idleloops
While I like a fast boot, you've go to get these things a little into
perspective, a minute to the desktop isn't that bad.

~~~
DanBC
It's not bad, but spread over X million workers on desktops 5 days a week
means a lot of wasted time, and maybe energy.

~~~
hmottestad
If 5 million people save 1 minute every day for 200 days a year. Then you have
saved 1 minute every day per person, not 5 000 000 * 1 * 200 minutes in total
per year.

That kind of math just doesn't work.

------
ThePinion
Just did this on an old Inspiron 1545 with Ubuntu 12.04 on it and I'm already
noticing major improvement in both boot time and the apps I open frequently
(also with the help of preloader and zram)

I followed this guide: [http://www.howtogeek.com/69753/how-to-cut-your-linux-
pcs-boo...](http://www.howtogeek.com/69753/how-to-cut-your-linux-pcs-boot-
time-in-half-with-e4rat/)

Although note, at the part where it says push CTRL+ALT+F1 to get to a new
terminal login, that didn't work for me. I had to go to the default one
(CTRL+ALT+F7) and type "logout" and then go to CTRL+ALT+F6.

I have a web page I keep track of common things I do to my Ubuntu installs
(shameless plug: <http://ubuntu.mindseeder.com>) and I'm definitely going to
add this so I don't forget!

~~~
obtu
I wonder how much improvement that brings over standard ureadahead (see yason
in this thread for how they differ). For zram, no need for a ppa, a zram-
config package has been added in precise.

------
hello_asdf
The easiest way I've found to increase boot speed and application load even
under heavy system load is to use the pf kernel patchset. With a properly
configured kernel using BFS, BFQ, and LZMA compression, my system is amazingly
fast. Even when compiling and both cores at my laptop are at 100% my system is
fully usable. If you have a Macbook Pro my kernel configs are here:
<https://github.com/meinhimmel/kernel-configs>

------
sciurus
Note that if you're using Ubuntu you're using ureadhaead, which does something
similar to minimize seeks during boot.

<https://wiki.archlinux.org/index.php/Ureadahead>

~~~
rcthompson
Then why are there deb files for Ubuntu? I don't think they're doing exactly
the same thing, since e4rat is using specific features of the Ext4 filesystem.

Edit: Actually, the directions say to remove Ureadahead when installing e4rat,
so maybe they are quite similar.

~~~
yason
AFAIK, ureadahead just keeps track of which files/blocks are touched during
bootup/startx and pre-reads them into a cache at the very beginning of the
boot sequence so you will effectively boot from cache.

This still requires seeking to several semi-random areas of the disk while
prereading which e4rat is fixing by physically moving the needed blocks
adjacent to eachother.

~~~
obtu
Since ureadahead looks at blocks and not files, it has a potential speed
advantage if the boot process is opening some large files but not reading them
in full.

Edit: except the ureadahead packfile only points to the blocks and files, it
does not provide a way to inline them. So e4rat is almost certainly faster.
It's a shame it is ext4 specific.

Apparently Scott James Remnant, the ureadahead developer, considered feeding
the collected info to a defragmenter:
<http://ubuntuforums.org/showthread.php?t=1434502> ; this would be nice, as it
means a single package is responsible for the feature, and filesystems perform
to the best of their ability whether or not they have ext4-like fine-grained
control of defragmentation.

~~~
rcthompson
So it sounds like the filesystem-reorganizing features of e4eat (but not the
profiling features) would be complementary to ureadahead.

------
diggan
Good tutorial about how to use e4rat: [http://www.howtogeek.com/69753/how-to-
cut-your-linux-pcs-boo...](http://www.howtogeek.com/69753/how-to-cut-your-
linux-pcs-boot-time-in-half-with-e4rat/)

------
moeffju
So when will we see this in our smartphones? I don't understand and, frankly,
find it ridiculous that I have to wait about a minute or up to 90 seconds for
my smartphone to boot, a device that is completely flash-memory based and that
has no variability in hardware. I still remember the article about that
industrial Linux PC that booted in less than one second, including
initializing video4linux and two cameras etc., simply by optimizing kernel
parameters, boot order, and driver timeouts. That must have been 2005 or so.
Now it's 2012 and my phone takes longer to boot than my laptop (late 2010 MBP
w/ SSD).

------
hamoid
Would it make a difference with SSD drives?

~~~
jeltz
Sequential reads are faster than random even on SSD drivers, so it could help
but I am not sure how much.

~~~
Iv
Oh ? Why is that ? SSD still need to address every memory block, don't they ?
Or do they have a faster DMA-like mode where you can send the instruction
"give me the next 96KB starting at address X ?

~~~
lucian1900
SSDs exhibit the same sort of cache locality RAM does. When a region is
accessed, a larger chunk is fetched and cached just in case it's needed later.

~~~
nuje
Yes, and the OS readahead also helps.

You can see the random vs sequential difference in any ssd review, eg
[http://thessdreview.com/our-reviews/ocz-vertex-3-240gb-
max-i...](http://thessdreview.com/our-reviews/ocz-vertex-3-240gb-max-iops-
review-as-ssd-tests/) shows 18 MB/s in random reads vs 500 MB/s sequential
reads.

------
dneb7
I saw a demo of this at Intel Labs on a Windows machine about 15 years ago and
it was very impressive. I don't think they optimized startup, but application
launch was incredibly fast with their disk layout optimization.

Isn't this essentially what DiskKeeper does on Windows?

~~~
maaku
I don't know about DiskKeeper, but I believe it's part of the "Lenovo Enhanced
Experience" on ThinkPads. Amazingly, my factory install with crapware booted
from pressing BIOS to Windows desktop in just over 7 seconds. I haven't been
able to get my clean install below 10 seconds, I think because I'm missing the
filesystem tweaking.

------
derefr
Is this similar to OSX's Hot File Adaptive Clustering, then?

~~~
obtu
The OSX feature apparently notices files which are slowly appended to
(downloads) and defragments them. It does not reallocate a set of files (such
as the ones touched at boot) to be adjacent on disk, which is what e4rat does.

------
johnhartigun
Does the debian package work in Ubuntu?

~~~
diggan
Yes, you might need to remove ureadahead though.

