SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2011-04-13 12:16:46

alef
#! CrunchBanger
Registered: 2009-02-05
Posts: 193

faster boot by Physical Block Reallocation with e4rat

Hi,

I wanted to share this optimization which looks interesting:

howto: http://lifehacker.com/#!5790311/e4rat-c … e-commands

tool website: http://e4rat.sourceforge.net/

enjoy it

P.S. : I have not tired it myself yet, but certainly will do as soon as I am in front of my netbook...


Eee-PC 1000H    |  Statler r20110207 Openbox
Vaio VGN-FE21H  |  Statler r20110207 Openbox
Thinkpad X1Carbon | Waldorf r20121015
-- I live well without owning a printer.

Offline

Help fund CrunchBang, donate to the project!

#2 2011-04-13 13:26:43

bobrossw
#! Die Hard
Registered: 2011-02-08
Posts: 521

Re: faster boot by Physical Block Reallocation with e4rat

thanks for the tip, will try it out soon!

Offline

#3 2011-04-14 05:51:52

jackbang
#! CrunchBanger
Registered: 2009-05-28
Posts: 244

Re: faster boot by Physical Block Reallocation with e4rat

Looks good, but doesn't "preload" do this already?

Offline

#4 2011-04-14 20:33:10

bobrossw
#! Die Hard
Registered: 2011-02-08
Posts: 521

Re: faster boot by Physical Block Reallocation with e4rat

So I went ahead and got it set up, and boot does feel a bit quicker, especially after I get into openbox, all my initial apps open pretty quick, including chrome.  No this does not do the same thing as preload (at least based on its description) and does do some of the same things as 'readahead-fedora'.

It does one extra thing which is cool, it logs what programs are launched during boot and then defrags your disk (only on ext4) to make all of those files very close together, phyiscally.  That lets your disk spin less, making the read/write times of boot faster.  This extends two minutes (by default) after grub.  So it can include things like the first two or three programs you usually run.

After that you can set it up as a preloader (like readahead) and it'll make the boot process even faster.  I did this and at first didn't notice much improvement...then I realized I had readahead installed, so I was preloading twice.  I got rid of this and now I notice a big difference.

Offline

#5 2011-04-17 03:13:42

tranche
#! CrunchBanger
Registered: 2011-02-04
Posts: 111
Website

Re: faster boot by Physical Block Reallocation with e4rat

Tried this on a minimal Debian install.  Boot time went from ~38 to ~27 seconds.

System was an Asus 1015 PEM with 2GB.

Environment for both boots included insserv, BIOS boot-booster, 1-second Grub delay, laptop-mode-tools, sshd, wicd, cpufrequtils. After autologin X, and openbox were started with xinit. Tint2, wicd-client,  volumeicon, and a Sakura terminal were started automatically in autostart.sh.   

Disk format pre-e4rat was ext2 noatime.  E4rat requires ext4, so I reformatted as ext4 noatime data=writeback.

Times given are from power-on to cpu idle with the Sakura terminal accepting characters.  I then started  Chromium immediately after booting so that its disks blocks would be reallocated along with the actual boot files.   Without e4rat Chromium's first-time startup was about 3 seconds.  After e4rat it started in less than 1/2 second. 

Installation and configuration were easy, following the directions in the README.  I used a precompiled deb package (v0.2.1) from http://e4rat.sourceforge.net

Reading e4rat's detailed boot log was a sobering experience (> 2500 files read during boot).  Hundreds of these were timezone files that don't need to be read at all, so there are opportunities for improvement. 

It's a useful piece of code.

Offline

#6 2011-04-19 18:35:45

Ranko Kohime
Member
From: Cincinnati, Ohio
Registered: 2010-05-17
Posts: 18

Re: faster boot by Physical Block Reallocation with e4rat

tranche wrote:

Reading e4rat's detailed boot log was a sobering experience (> 2500 files read during boot).  Hundreds of these were timezone files that don't need to be read at all, so there are opportunities for improvement.

Is it safe to assume that e4rat can be run in manual mode for this specific purpose?  (running SSD here, so no reason to defrag)

Offline

#7 2011-04-19 19:34:10

tranche
#! CrunchBanger
Registered: 2011-02-04
Posts: 111
Website

Re: faster boot by Physical Block Reallocation with e4rat

@alef - Yes, you could use it this way, and it's quite informative. 

Just install the whole package but use only the boot logger, which is the first of the three components that you would use in a regular hard disk install.  You set it up by adding an "init=" to the boot line in grub.cfg.  All it will do at that point is log the files opened during boot to a disk file.   Once you've gotten everything you can get out of it, you can remove the init. 

Incidentally it was Chromium that was opening those hundreds time zone files. smile

Offline

#8 2011-04-20 16:24:59

jmbarnes
#! Junkie
Registered: 2009-05-04
Posts: 250

Re: faster boot by Physical Block Reallocation with e4rat

Just applied e4rat (using info on https://wiki.archlinux.org/index.php/E4rat ) and must say it feels very fast. The slowest thing in the boot process is me entering my password to decrypt /home. Once past that it flies right into my desktop (automatically login.) Certainly worth it if you reboot very often.


IRC: PizzaAndWine     Script bits: Incremental Backup | Sleep Timer

Offline

#9 2011-04-21 15:28:37

chaanakya
#! Die Hard
Registered: 2010-12-30
Posts: 940

Re: faster boot by Physical Block Reallocation with e4rat

Just wondering...I followed the advice in the lifehacker article to the t, and it works, but I lost my splash...I'm trying to figure out why...my GRUB_CMDLINE_LINUX_DEFAULT is "init=/sbin/e4rat-preload quiet splash"

Thanks in advance!

- Chaanakya


Check out Musik - an easy-to-use text-to-music converter!
Join SpiderOak using this link and get an extra 1 GB free: https://spideroak.com/download/referral … 660e787ff1

Offline

#10 2011-04-21 20:08:05

wobbe98
Member
Registered: 2011-04-17
Posts: 27

Re: faster boot by Physical Block Reallocation with e4rat

I've also done  the e4rat  thing and it shaved off 10 second of my boot time. That's 20% in my case.
I timed it three times before and after to make sure the measurement was correct.
But it also screwed up my boot splash. (plymouth)

Offline

#11 2011-04-21 20:13:30

chaanakya
#! Die Hard
Registered: 2010-12-30
Posts: 940

Re: faster boot by Physical Block Reallocation with e4rat

Apparently plymouth has a problem with any init= parameter?? :'(


Check out Musik - an easy-to-use text-to-music converter!
Join SpiderOak using this link and get an extra 1 GB free: https://spideroak.com/download/referral … 660e787ff1

Offline

#12 2011-04-21 20:55:10

tranche
#! CrunchBanger
Registered: 2011-02-04
Posts: 111
Website

Re: faster boot by Physical Block Reallocation with e4rat

Was the  splash parameter propagated into /boot/grub/grub.cfg?

I'm sure you did this already, but did you run update-grub again?

Offline

#13 2011-04-21 23:39:25

chaanakya
#! Die Hard
Registered: 2010-12-30
Posts: 940

Re: faster boot by Physical Block Reallocation with e4rat

Yes it was, and yeah, I did...

Last edited by chaanakya (2011-04-21 23:39:49)


Check out Musik - an easy-to-use text-to-music converter!
Join SpiderOak using this link and get an extra 1 GB free: https://spideroak.com/download/referral … 660e787ff1

Offline

#14 2011-04-29 13:03:44

grooveharder
New Member
Registered: 2011-04-29
Posts: 1

Re: faster boot by Physical Block Reallocation with e4rat

Great tip! Amazingly fast boot.

Add "plymouth:force-splash" (no quotes) to the kernel command line to keep plymouth running (found at http://wiki.mandriva.com/en/Development … timisation)

Now it boots fast and still looks pretty wink

Last edited by grooveharder (2011-04-29 13:04:33)

Offline

#15 2011-05-01 13:18:55

chaanakya
#! Die Hard
Registered: 2010-12-30
Posts: 940

Re: faster boot by Physical Block Reallocation with e4rat

Thank you so much grooveharder!!! big_smile


Check out Musik - an easy-to-use text-to-music converter!
Join SpiderOak using this link and get an extra 1 GB free: https://spideroak.com/download/referral … 660e787ff1

Offline

#16 2011-05-01 22:26:29

macondo123
#! CrunchBanger
From: Panama
Registered: 2011-04-26
Posts: 115

Re: faster boot by Physical Block Reallocation with e4rat

Hi, should i uninstall 'preload'?


Desktop: Atom 1.6 || 1 MB RAM || 160 GB HD
Minimal Squeeze || icewm/fluxbox/ratpoison
KISS = Keep It Simple, Stupid

Offline

#17 2011-05-01 22:43:21

macondo123
#! CrunchBanger
From: Panama
Registered: 2011-04-26
Posts: 115

Re: faster boot by Physical Block Reallocation with e4rat

Never mind, i understood now smile


Desktop: Atom 1.6 || 1 MB RAM || 160 GB HD
Minimal Squeeze || icewm/fluxbox/ratpoison
KISS = Keep It Simple, Stupid

Offline

#18 2011-05-02 01:07:19

hardran3
#! Junkie
From: forest town, lake land
Registered: 2011-02-26
Posts: 359

Re: faster boot by Physical Block Reallocation with e4rat

A great tip, thank you! Cut off 1/3 of my boot time.

Offline

#19 2011-08-23 19:25:22

lewispm
#! Member
From: Collierville, TN
Registered: 2009-07-29
Posts: 87

Re: faster boot by Physical Block Reallocation with e4rat

I'm having a problem with this guide.

Step one: Collect - worked fine. 
Step two: Reallocate - adding single to the end of my kernel line still loads openbox as usual, not a non-x environment, which I assumed they meant.

The next command:

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

throws a bunch of errors when I execute it inside Terminator.   Basically, its "Operation not supported" after each line of the startup.log file.

During the bootup with single in my kernel line I have the option to debug as root.  I have tried saying 'yes' to this and running the command (sans 'sudo') but it doesn't work.  It just displays an 'e' on the next line and then my computer overheats because the root environment doesn't load the cpufreq I need to cool this heatbox down.

Any idea what I'm doing wrong?


Statler-Openbox on an Acer Extensa 4420.  Its good to be back.

Offline

#20 2011-08-23 20:02:05

hhh
Caught in the Vortex
From: Port Salerno
Registered: 2010-08-04
Posts: 1,485

Re: faster boot by Physical Block Reallocation with e4rat

@lewispm, what worked for me was not using the Lifehacker instructions, but the ones included in the source's ReadMe, which are echoed here...
https://wiki.archlinux.org/index.php/E4 … it_to_work

Also, I ran sudo update-grub each time I edited grub.

-edit- re: the Arch Wiki article, I didn't edit /boot/grub/grub.cfg  as it's not recommended, I edited /etc/default/grub and ran update-grub.

Last edited by hhh (2011-08-23 20:05:57)

Offline

#21 2011-08-23 20:12:20

lewispm
#! Member
From: Collierville, TN
Registered: 2009-07-29
Posts: 87

Re: faster boot by Physical Block Reallocation with e4rat

hhh wrote:

Also, I ran sudo update-grub each time I edited grub.

-edit- re: the Arch Wiki article, I didn't edit /boot/grub/grub.cfg  as it's not recommended, I edited /etc/default/grub and ran update-grub.

So then I should be looking for it to boot to just a command line, right?


Statler-Openbox on an Acer Extensa 4420.  Its good to be back.

Offline

#22 2011-08-24 01:08:09

hhh
Caught in the Vortex
From: Port Salerno
Registered: 2010-08-04
Posts: 1,485

Re: faster boot by Physical Block Reallocation with e4rat

No, normal boot after it's all set up.

Offline

#23 2011-08-24 01:49:15

lewispm
#! Member
From: Collierville, TN
Registered: 2009-07-29
Posts: 87

Re: faster boot by Physical Block Reallocation with e4rat

The archlinux link helped me get to runlevel 1, thanks.

But I'm still getting all the same errors when I run the e4rat-realloc command.  I get a bunch of 'operation not permitted' and at the end it says that most of the files are un-writeable.


Statler-Openbox on an Acer Extensa 4420.  Its good to be back.

Offline

#24 2011-08-24 08:43:05

xaos52
The Good Doctor
From: Planet of the @s
Registered: 2011-06-24
Posts: 4,290

Re: faster boot by Physical Block Reallocation with e4rat

No need to reboot to get to runlevel 1:

1. Ctrl+Alt+F1 to go to virtual console 1
2. enter your user name and password
3. sudo init 1
4. Enter your user password if prompted
5. If your root account is locked, which is the default in crunchbang, you should get the # prompt
6. then you can run e4rat-realloc /var/lib/e4rat/startup.log
7 to return to runlevel 2, just type 'init 2'

If you still have problems: cat /var/lib/e4rat/startup.log
This should give you a list of filenames. If it doesnt, sth went wrong in the collect phase, try that again

You know e4rat only works for ext4 partitios, do you?

hth

Online

Help fund CrunchBang, donate to the project!

#25 2011-08-27 21:08:11

lewispm
#! Member
From: Collierville, TN
Registered: 2009-07-29
Posts: 87

Re: faster boot by Physical Block Reallocation with e4rat

xaos52 wrote:

If you still have problems: cat /var/lib/e4rat/startup.log
This should give you a list of filenames. If it doesnt, sth went wrong in the collect phase, try that again

I do get a list of filenames.

xaos52 wrote:

You know e4rat only works for ext4 partitios, do you?

hth

yes, both / and /home are ext4


Statler-Openbox on an Acer Extensa 4420.  Its good to be back.

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo