Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

migrated from stackoverflow.com May 14 '10 at 9:41

This question came from our site for professional and enthusiast programmers.

    
that depends on the init system of your distribution –  johannes May 14 '10 at 9:34
    
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 May 16 '10 at 13:29

6 Answers 6

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).

share|improve this answer
    
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 May 14 '10 at 10:01
    
I run Kubuntu here, never get better than 2 minutes. How the heck did you manage ten seconds? –  marcusw May 16 '10 at 13:31

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

RC_PARALLEL_STARTUP="no"

to "yes".

share|improve this answer
    
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 May 14 '10 at 10:00
    
Could you explain what does it do/side effects ? –  Julien Nicoulaud May 16 '10 at 16:19

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.

share|improve this answer

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

share|improve this answer

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.

share|improve this answer

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).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.