I'm looking to lower my boot time by whatever means possible. I have about 8GB of RAM in my laptop, and if there's any way I could leverage that into faster boot time, that'd be awesome. Is there a way to make the kernel load itself and all modules immediately into RAM to make things faster? Does the Linux kernel already do this?
3 Answers
Answering precisely to the question: Is there a way to speed things up at boot time?. Yes.
Welcome to systemd, this is available on RHEL6 onwards, Fedora 15,16 onwards, CentOS 6 onwards.
In other worlds of Linux like Ubuntu -- you would have upstart
In other world of Unix like Solaris, BSD, MacOSx: you have SMF
Both attempt to solve the nature of the booting methods, and try to minimize the amount of time booting sequence takes to start the system into fully functional login ready host.
Take a look at systemd -- it is refreshing.
Go through these doc links from the author of systemd himself, they are all long and very technical, so take a leisure read when you can.
-
Systemd is brand new untested and doesn't work with individual settings.Cybercartel– Cybercartel2012-01-31 11:30:19 +00:00Commented Jan 31, 2012 at 11:30
-
Did you test it? what settings did not work with for you? I am interested in knowing more about it. Although, I agree that systemd is in its new infancy stages of wide acceptance(&evolution) , but it is production ready I believe.Nikhil Mulley– Nikhil Mulley2012-01-31 11:35:25 +00:00Commented Jan 31, 2012 at 11:35
-
I use OpenSUSE 12.1 with a custom Zen Kernel 3.2.2 and with systemd it loads the emergency shell at power on. I think it's a problem with the x server not running but I got tired to look after it.Cybercartel– Cybercartel2012-01-31 11:40:15 +00:00Commented Jan 31, 2012 at 11:40
You can avoid initrd and compile all modules statically. Maybe you can enable option small size kernel and strip assembly debug symbols and also compile modules without debug symbols: make INSTALL_MOD_STRIP=1 modules_install.
-
1no initrd?- that can jeopardize other issues that are due in future, like filesystem rescue/recovery. Having less modules would work for me. Having less and absolutely necessary services started at the boot time works for me. Having another script which will take care of loading the other required services, after the system is completely booted, works for me.Nikhil Mulley– Nikhil Mulley2012-01-31 08:01:49 +00:00Commented Jan 31, 2012 at 8:01
-
@Nikhil: To rescue and recovery you can use init=/bin/sh to boot into a shell or a live cd like knoppix.Cybercartel– Cybercartel2012-01-31 11:37:22 +00:00Commented Jan 31, 2012 at 11:37
-
Does compiling modules statically make a measurable difference to the boot time?Gilles 'SO- stop being evil'– Gilles 'SO- stop being evil'2012-01-31 23:50:22 +00:00Commented Jan 31, 2012 at 23:50
-
@Gilles: I think so but I don't have a proof. I don't need initrd and I use ICC to compile my kernel. I don't use a splash screen and my framebuffer output is a bit slow but my box power on really fast. Faster then W7 because it doesn't use lazy loading.Cybercartel– Cybercartel2012-02-01 00:06:04 +00:00Commented Feb 1, 2012 at 0:06
-
I think it would be interesting to see performances when having a monolithic kernel as much as possible and then the rest of the necessary ones in initrd, and v/s kernel with NO initrd and all modules statistically compiled. (I have myself have not had things to do without initrd, so..curious)Nikhil Mulley– Nikhil Mulley2012-02-02 05:29:11 +00:00Commented Feb 2, 2012 at 5:29
Install bootchart to visualize where the time is spent during boot. So you can improve and find solutions for actual bottlenecks.
/etcon a ramdisk which is populated early in the boot process from an archive (many small files = seek time dominates hard drive performance, it's better to have a tarball in one piece), and it might have saved a second at the cost of having to manually alter configuration files in the tarball. Realistically, the big startup time fixer is: get a SSD.