Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cutting down bootup time (to 5 sec)
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3, 4, 5, 6, 7  Next  
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Letharion
Veteran
Veteran


Joined: 13 Jun 2005
Posts: 1344
Location: Sweden

PostPosted: Tue Dec 02, 2008 11:08 am    Post subject: Cutting down bootup time (to 5 sec) Reply with quote

Hi, I got curious about the 5 second boot thingie. (http://lwn.net/Articles/299483/)
I was trying to google up some info on how the old style of a more static /dev but "dev" just gives me "development" stuff.
There's probably a more useful search term, but this was before my linux days, so I'm not familiar enough with it.

(1)
Where can I find more information about this kind of setup?
In what situation is it useful, was the somthing in particular that made this "fast" on the EEE and less so no my
computer that diffs pretty much from the EEE. (Core2, 4GB ram, standard HD instead of flash)

(2)
I also had a look at readahead, and I'm guessing that this is sys-apps/readahead-list, correct?
How could I find out what files are interesting to my particular setup, so that I could optimize for my system?

(3)
Is the bootchard drawing service down? http://www.bootchart.org/ hasn't worked for me for a while, doesn't work now, and
didn't work a few weeks ago when I tried. Any other ways for me to draw up the chart?


Last edited by Letharion on Tue Jan 06, 2009 3:14 pm; edited 2 times in total
Back to top
View user's profile Send private message
El_Presidente_Pufferfish
Veteran
Veteran


Joined: 11 Jul 2002
Posts: 1179
Location: Seattle

PostPosted: Tue Dec 02, 2008 4:11 pm    Post subject: Reply with quote

1) A good SSD really improves boot times
3) emerge bootchart with USE="java" and set
AUTO_RENDER="yes" in /etc/bootchartd.conf
Back to top
View user's profile Send private message
_sil
n00b
n00b


Joined: 31 Dec 2007
Posts: 37
Location: UK

PostPosted: Tue Dec 02, 2008 6:33 pm    Post subject: Reply with quote

Hi,

as for #2, readahead implemetation that was used in the article can be found here (requires kernel patch, included in package). To find out which files are accessed during boot you can can use readahead-collector tool from here (don't know whether it's in portage or not).

EDIT: you should also consider switching to 2.6.28 kernel as it includes new sata initialization code that is way faster than previous implementation. For me it reduced kernel initialization time from 6 to 3s.
Back to top
View user's profile Send private message
Letharion
Veteran
Veteran


Joined: 13 Jun 2005
Posts: 1344
Location: Sweden

PostPosted: Wed Dec 03, 2008 11:34 pm    Post subject: Reply with quote

El_Presidente_Pufferfish wrote:
1) A good SSD really improves boot times
3) emerge bootchart with USE="java" and set
AUTO_RENDER="yes" in /etc/bootchartd.conf

1) If I can get this down to about 10 seconds as suggested on a regular disc, I'm gonna seriously consider a SSD drive just for fun. :)
3) Thanks, that worked perfectly :D

_sil wrote:
Hi,

as for #2, readahead implemetation that was used in the article can be found here (requires kernel patch, included in package). To find out which files are accessed during boot you can can use readahead-collector tool from here (don't know whether it's in portage or not).

EDIT: you should also consider switching to 2.6.28 kernel as it includes new sata initialization code that is way faster than previous implementation. For me it reduced kernel initialization time from 6 to 3s.

Thanks for the links. Unfortunately I still don't quite get it working, are you using it?
I applied the patch with "patch -p1 < 0001-superreadahead-patch.patch" which worked.
I tried "make oldconfig" to see if this had added any options, but it didn't seem like it, so I compiled as normal.
But now what?
I compiled the generate_filelist and sreadahead, and put them in /sbin. I installed the readahead that in portage and changed their addresses to point to sreadahead, but this is just pure guesswork. (And I don't boot any faster)

I also noticed in Arjans presentation that again he recommends a persistent /dev. Any links to how I could set that up?

Maybe I'll try 28 :) But for now I'm gonna try working the other parts.
Back to top
View user's profile Send private message
coolsnowmen
Veteran
Veteran


Joined: 30 Jun 2004
Posts: 1479
Location: No.VA

PostPosted: Thu Dec 04, 2008 5:58 am    Post subject: Reply with quote

Read /etc/conf.d/rc for how to set up a persistent "static" /dev

Use baselayout-2/openrc and see if parallel vs non parallel is faster/slower using boot chart

Turn off coldpluging and list all needed modules in the modules.autoload.d/*6
_________________
emerge: there are no ebuilds to satisfy "moo"
Back to top
View user's profile Send private message
Letharion
Veteran
Veteran


Joined: 13 Jun 2005
Posts: 1344
Location: Sweden

PostPosted: Fri Dec 26, 2008 2:16 am    Post subject: Reply with quote

Ok, I poked around a bit with 6.28, but didn't get any interesting results, and since it's now released and in the tree I'm running it.
Didn't help much I'm afraid. And as far as I can tell, there is no new fast boot in it. :/

Quote:
Use baselayout-2/openrc and see if parallel vs non parallel is faster/slower using boot chart

Quote:
Read /etc/conf.d/rc for how to set up a persistent "static" /dev

Still "to-do" on both of those.

Quote:
Turn off coldpluging and list all needed modules in the modules.autoload.d/*6

At that time, I had 0 modules at all, and not even modules support in the kernel. Turning of coldplugging didn't help at all.
[/profile]
Back to top
View user's profile Send private message
pussi
l33t
l33t


Joined: 08 May 2004
Posts: 727
Location: Finland

PostPosted: Sat Jan 03, 2009 3:08 pm    Post subject: Reply with quote

Letharion wrote:
I compiled the generate_filelist and sreadahead, and put them in /sbin. I installed the readahead that in portage and changed their addresses to point to sreadahead, but this is just pure guesswork. (And I don't boot any faster)
If I remember correctly that won't work but here's what I did:

Download and install the latest sreadahead from here.
Patch and recompile the kernel.
Reboot without sreadahead or any other readahead service and create the filelist (this might take awhile):
Code:
find / -type f \( -fstype ext3 -o -fstype rootfs \) > readahead.packed.new
sreadahead-pack readahead.packed.new
mv readahead.packed /etc/readahead.packed
Save this as /etc/init.d/sreadahead
Code:
#!/sbin/runscript
# $Header:

depend() {
        need checkroot
        # this should start as early as possible
        # we can't do 'before *' as that breaks it
        before hostname modules domainname crypto-loop checkfs localmount
}

start() {
        if ! grep -q "profile" /proc/cmdline && test ! -f /profile-once; then
                ebegin "Reading files needed to boot"
                /sbin/sreadahead
                eend $?
        fi
}
and add it to boot runlevel with rc-update (sysinit runlevel could be better if you're using openrc 0.4* but I haven't tried it) and reboot.

Let me know how it worked. My box actually booted about 10 seconds slower with sreadahead. :P
Back to top
View user's profile Send private message
Letharion
Veteran
Veteran


Joined: 13 Jun 2005
Posts: 1344
Location: Sweden

PostPosted: Tue Jan 06, 2009 3:14 pm    Post subject: Reply with quote

Hey :) Thanks
pussi wrote:
Letharion wrote:
I compiled the generate_filelist and sreadahead, and put them in /sbin. I installed the readahead that in portage and changed their addresses to point to sreadahead, but this is just pure guesswork. (And I don't boot any faster)
If I remember correctly that won't work but here's what I did:

Download and install the latest sreadahead from here.
Patch and recompile the kernel.

I'm fairly new here, so how exactly do I apply the patch?
I've tried some variations of patch < file.patch and patch -p0 < file.patch but I'm just guessing, and when I'm done there's no target for make all.
Back to top
View user's profile Send private message
Letharion
Veteran
Veteran


Joined: 13 Jun 2005
Posts: 1344
Location: Sweden

PostPosted: Wed Jan 07, 2009 11:37 pm    Post subject: Reply with quote

Oh, just copy the .patch file to the new kernel and do patch -p1 < file.patch.
I copied all the files, and thus overwrote the kernels makefile. Doh
Back to top
View user's profile Send private message
Letharion
Veteran
Veteran


Joined: 13 Jun 2005
Posts: 1344
Location: Sweden

PostPosted: Thu Jan 08, 2009 12:28 am    Post subject: Reply with quote

Hmm, well... I think I get sread to do SOME work, but it doesn't help.
I do clearly hear that the disc is far more active in the early stage of rc, and this is confirmed by my bootchart.
However, the "full" disc activity doesn't stop until the boot process is complete, which doesn't make much sense,
as the total disc usage is now a lot greater. Nor did it take a single second off my starttime.
I'm gonna try to get some picture up somewhere...
Back to top
View user's profile Send private message
Letharion
Veteran
Veteran


Joined: 13 Jun 2005
Posts: 1344
Location: Sweden

PostPosted: Thu Feb 12, 2009 9:39 pm    Post subject: Reply with quote

Just because I wanna keep this idea (thread) alive, I want to let everyone know that sreadhead 0.04 has been released awhile ago and is now in portage.
There's even a 1.00 version?! that will work with any FS, but also requires a 2.6.29 kernel, which I'm not ready to try yet.

Trying out the 0.04 now, I'll get back :)
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Fri Feb 27, 2009 3:43 pm    Post subject: Help Gentoo Boot As Fast As Possible Reply with quote

Hi all.

There is an idea that's been going in my head for a long time. I'd like to build a Gentoo system for fast booting. I'm planning to use a x86 or x86_64 virtual machine (KVM) first, probably with busybox and OpenRC.

I'm watching Phoronix and those GNU/Linux systems like SplashTop and the likes have tempted me to do it myself. I know about Gentoo's customizing abilities but I'm no expert. There will certainly be a point where I'll need help. My first goal is to get to the login screen on a TTY as quickly as possible.

If any of you has anything to share, you're welcome. :-)

It's only for the pride of doing it myself. And if I get to satisfying results, why not go further, who knows...
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
Sadako
Advocate
Advocate


Joined: 05 Aug 2004
Posts: 3792
Location: sleeping in the bathtub

PostPosted: Fri Feb 27, 2009 4:29 pm    Post subject: Reply with quote

Well, bootchart seems very useful to figure out where the delays are, which would be of help to you.

My desktop has a fairly minimalist setup, and while it wasn't something I was specifically aiming for, it boots from grub to a tty login prompt in about 10 seconds.

Obviously one of the first things to look at is the services you start at boot time, eliminate any you don't particularly need, and hopefully bootchart will tell you which services are taking the longest to start.

Editing init scripts can help a lot too, I've trimmed quite a bit from the bootmisc script (and added a few things to have /var/run and similar on tmpfs).

I believe a lot of the bootup delay is within the kernel itself, and initialising things which you may very well not need, so look there too.
I honestly believe that an optimised kernel made the big difference.
Probably common sense, but disable all debug options, and build in everything that you need upon boot rather than build them as modules.

Also, try booting with the "quiet" kernel parameter.
It's not altogether practical, but it does seem to make a big difference.
_________________
"You have to invite me in"
Back to top
View user's profile Send private message
nativemad
Developer
Developer


Joined: 30 Aug 2004
Posts: 918
Location: Switzerland

PostPosted: Fri Feb 27, 2009 5:34 pm    Post subject: Reply with quote

Hi,

i've seen it several times, that there was no real init at all (thinclients for example, or minimal livecds). They just used an initrd with busybox and probably uclib with some scripts (started through linuxrc) to startup the thing.

Also, i would also recommend to disable the possibility to load modules at all! (no check should speedup the thing!) ;-)

-I would be quite happy to have such a linux-rc script, but with bash<never tried dash!?!> and glibc! :P
Maybe i could help a bit out with scripting <hack up genkernel-scripts?!?>, if you decide to go that way! -I've several pxe-images that could perhaps profit from it! :P

Cheers
_________________
Power to the people!
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Fri Feb 27, 2009 8:12 pm    Post subject: Reply with quote

Thanks for your lights. As for the main library I'm thinking of uclibc -- not to hide I might use such a setup for embedded systems.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
Tariella
Guru
Guru


Joined: 10 Dec 2005
Posts: 384
Location: Europe/Austria

PostPosted: Mon Mar 02, 2009 9:24 am    Post subject: Reply with quote

Did you check out kyuba? Maybe you could help with that.
Its predecessor einit is already pretty fast, kyuba will be a complete rewrite.
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5937

PostPosted: Mon Mar 02, 2009 2:52 pm    Post subject: Reply with quote

Tariella wrote:
Did you check out kyuba? Maybe you could help with that.
Its predecessor einit is already pretty fast, kyuba will be a complete rewrite.


last time i talked to mdeininger, he said he was still working on it... i'm not sure if it's ready for public consumption yet. i, of course, could be wrong though.
_________________
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.

banned from #gentoo since sept 2017
Back to top
View user's profile Send private message
Tariella
Guru
Guru


Joined: 10 Dec 2005
Posts: 384
Location: Europe/Austria

PostPosted: Mon Mar 02, 2009 3:35 pm    Post subject: Reply with quote

I'm sure mdeininger would accept help.
I think it is better to help with an existing development than start another from scratch.
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Mon Mar 02, 2009 5:12 pm    Post subject: Reply with quote

Tariella wrote:
Did you check out kyuba? Maybe you could help with that.
Its predecessor einit is already pretty fast, kyuba will be a complete rewrite.

Didn't even know of its existence... :oops:
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
kernelOfTruth
Watchman
Watchman


Joined: 20 Dec 2005
Posts: 6111
Location: Vienna, Austria; Germany; hello world :)

PostPosted: Mon Mar 02, 2009 10:05 pm    Post subject: Reply with quote

VinzC wrote:
Tariella wrote:
Did you check out kyuba? Maybe you could help with that.
Its predecessor einit is already pretty fast, kyuba will be a complete rewrite.

Didn't even know of its existence... :oops:


++
_________________
https://github.com/kernelOfTruth/ZFS-for-SystemRescueCD/tree/ZFS-for-SysRescCD-4.9.0
https://github.com/kernelOfTruth/pulseaudio-equalizer-ladspa

Hardcore Gentoo Linux user since 2004 :D
Back to top
View user's profile Send private message
jel
Apprentice
Apprentice


Joined: 10 Aug 2005
Posts: 259
Location: Gothenburg

PostPosted: Mon Mar 02, 2009 11:35 pm    Post subject: Reply with quote

Hopeless wrote:

Editing init scripts can help a lot too, I've trimmed quite a bit from the bootmisc script (and added a few things to have /var/run and similar on tmpfs).


That's interesting! Would you like to share your bootmisc?

I'm always looking for ways to speed up booting since this is really my gf's box and she likes to do stuff in Windows XP which translates into a lot of reboots. Tried to make her use a virtual XP but she is really stubborn about it. XP boots really fast now that I have disabled most of the useless services.

cheers!
_________________
# dd if=/dev/urandom of=/dev/sda bs=512
Back to top
View user's profile Send private message
gerardo
Apprentice
Apprentice


Joined: 05 Feb 2004
Posts: 228
Location: Belgium

PostPosted: Sun Mar 08, 2009 11:28 am    Post subject: Reply with quote

I've just installed Kyuba:
Code:
layman -a jyujin
emerge kyuba

But how do I use it?
There's no documentation...
_________________
Windoze : Plug and Pay...
Back to top
View user's profile Send private message
Mimamau
Apprentice
Apprentice


Joined: 11 Jun 2002
Posts: 160
Location: Germany

PostPosted: Sun Mar 08, 2009 12:08 pm    Post subject: Reply with quote

As it's the successor of einit, maybe the docs of einit can help you?
http://einit.jyujin.de/node/16

I've had einit running, it was great. Compared to the normal gentoo init system it was really fast, but compared to baselayout2 and openrc the difference is very small.
Back to top
View user's profile Send private message
energyman76b
Advocate
Advocate


Joined: 26 Mar 2003
Posts: 2048
Location: Germany

PostPosted: Tue Mar 10, 2009 8:58 am    Post subject: Reply with quote

I boot in 14 seconds to the point where localmount kicks in. 41 seconds of mounting, 22 seconds for the rest.

...
_________________
Study finds stunning lack of racial, gender, and economic diversity among middle-class white males

I identify as a dirty penismensch.
Back to top
View user's profile Send private message
jel
Apprentice
Apprentice


Joined: 10 Aug 2005
Posts: 259
Location: Gothenburg

PostPosted: Wed Mar 11, 2009 1:35 am    Post subject: Reply with quote

energyman76b wrote:
I boot in 14 seconds to the point where localmount kicks in. 41 seconds of mounting, 22 seconds for the rest.

...


I boot in 2 seconds to the point where init is started... The rest is left as an excercise for the user. :wink:
_________________
# dd if=/dev/urandom of=/dev/sda bs=512
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Goto page 1, 2, 3, 4, 5, 6, 7  Next
Page 1 of 7

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum