Optimize the boot time of Linux

2

How can I optimize the boot time of Linux? Should I modify some scripts or init scripts? If yes, what are the scripts? Can I modify the kernel source?

krakat

Posted 2010-05-14T09:32:39.547

Reputation: 161

that depends on the init system of your distribution – None – 2010-05-14T09:34:35.983

Yeah, we really need to know what distro you're running. The way I went about doing this a few months back was installing gentoo. Quite a bit of work, but it booted 1.5-2x faster afterwards. – marcusw – 2010-05-16T13:29:28.610

Answers

2

Basically the simplest way to optimize the boot time is to disable all services that you don't need - how this is done depends on the particular distribution. Desktop oriented distributions like Ubuntu, however, don't have stuff like MySQL, Apache in them by default and have pretty optimized boot times (less than 10 secs on "common" hardware).

Bozhidar Batsov

Posted 2010-05-14T09:32:39.547

Reputation: 424

please leave suggestions about which site a question should be posted to in the comments. if it gets moved, it's more work for somebody to edit out of your answer. – quack quixote – 2010-05-14T10:01:22.653

I run Kubuntu here, never get better than 2 minutes. How the heck did you manage ten seconds? – marcusw – 2010-05-16T13:31:52.043

0

Edit file /etc/conf/rc and change this:

RC_PARALLEL_STARTUP="no"

to "yes".

mosg

Posted 2010-05-14T09:32:39.547

Reputation: 101

please leave suggestions about which site a question should be posted to in the comments. if it gets moved, it's more work for somebody to edit out of your answer. – quack quixote – 2010-05-14T10:00:38.693

Could you explain what does it do/side effects ? – nicoulaj – 2010-05-16T16:19:13.123

0

The best way to optimize boot time is to start only the needed scripts during the boot process. Some init procecesses allow forking scripts to the background while they start. You may consider a BSD style init as it is simpler. Also, make sure that your kernel has the right modules loaded. Arch Linux makes these steps trivial and seems to boot quickly for me.

kainosnous

Posted 2010-05-14T09:32:39.547

Reputation: 2 388

0

Try re-running the readahead profiling. This will make one boot slow and speed up all the subsequent ones (apparently).

krzysz00

Posted 2010-05-14T09:32:39.547

Reputation: 285

0

It really depends on what distribution you are using (in most cases), since they use different structures, they have different defaults. As well as your own system, e.g. it's faster to boot from a SSD disk than a regular harddrive.

Usually, the distribution community has guides on how to optimize the boot time for your system. It usually comes down to stuff like this:

  • Recompile the kernel
  • Use a static IP (versus relying on DHCP, which can affect speed - again this depends on your system, in my system the network startup is one of the biggest bottlenecks.)
  • Only start things you really need on a fresh start.

If boot time is really important to you, you should pick a distributon which offers you quick boottimes.

And there's always, suspending to ram (or swap) instead of shutting down the system always, resulting in almost instant "boot" - each and every time.

Sirupsen

Posted 2010-05-14T09:32:39.547

Reputation: 630

0

I decreased boot time by changing my "old" harddrive to a SSD - using more optimizations is not neccessary. My current Ubuntu 10.04 starts in less than 10 seconds (from GRUB to usable desktop).

user37371

Posted 2010-05-14T09:32:39.547

Reputation: 1