Sunday, December 09, 2007

How to make Ubuntu to start faster

Since I'm obviously having an Ubuntu theme month...

My Ubuntu used to start really slowly, even more slowly than my former XP. It was not really a problem except on the mornings when I wanted to surf while eating my breakfast. I was finished with it when my laptop was finally ready to be used. So I thought that there has to be a way to make it faster. After a little research I learned that it was not even hard to do. I gave it a try and now this machine starts a lot faster. Whoa! Totally worth it.

I tried to find a decent tutorial in English but I couldn't find any. So I'm writing my own instead. But I'm not expecting any of my regular readers to be interested. I just believe in the power of Google. One day some Ubuntu noob searches for "how to make Ubuntu to start faster" and ends up here. And voilà, here is the how-to.

First I installed a Bootchart. It's not necessary, but it will tell you exactly how much time your computer needs to boot. If you boot your computer before any changes and after the changes, it tells you how much faster it's actually starting. So it's recommended.

To install a Bootchart: Open your terminal (Applications → Accessories → Terminal). Type sudo apt-get install bootchart and hit the enter. It will ask your password (give it) and later if you want to continue (yes).

To use a Bootchart: Boot your computer. Once it's ready to be used, go to /var/log/bootchart and open the fresh .png file. Check out the time (and other stuff if you please).

There are many ways to make Ubuntu to start faster, but this is what particularly helped me:

Once again we're using terminal. This time type sudo apt-get install sysv-rc-conf and hit the enter. Just like installing the bootchart, give it your password and later choose yes.

When it's installed, start it by typing sudo sysv-rc-conf. It will ask for your password. When it's open it will look pretty much like this:


(Click to enlarge)

Use the arrow keys to move down until you reach usplash. Remove every X from its line by hitting space. Then press q to quit.

You're not done yet.

Still in terminal, type gksudo gedit /boot/grub/menu.lst. Gedit is a text editor, and if you don't, have it, replace it with the one you do have. For example I'm using only medit, so I typed gksudo medit /boot/grub/menu.lst instead. Whatever you're using, it will still ask for your password.

Now that you have your text editor open, search for this line: # defoptions=quiet splash. When you have finally found it, remove the word splash from it. Like this: # defoptions=quiet. Save your changes and exit. Then go to your terminal and type sudo update-grub and hit the enter. It will update the menu.lst.

Now you're done. Don't forget to reboot your computer and check out the new Bootchart stats.

15 comments:

sauce said...

Thanks for the straight forward howto.
My laptop starts up a bit faster now.

PhillC said...

Nice one.

Following these steps reduced my boot time from 27 seconds to 23 seconds, according to bootchart.

Anonymous said...

Why do you issue an 'sudo uptdate-grub' ?

I run Xp-Ubuntu feisty-Opensuse 10.3 and my grub's files are on my opensuse partition. The only thing I need to change boot parameters is to edit message.lst as root.

Apart from that I'll soon follow your howto -current boot time: 34s-

kushelmex said...

dude haha that didn't work for me , my boot time went from 26s to 1 min and 37 seconds

thanks anyway

Anonymous said...

Thank you so much, before running those commands my computer went from 3 minutes boot up time to 50 seconds!

Anonymous said...

Thousand thanks! This was the first simple and easy to follow solution to speed up the boot. At first my Ubuntu 7.10 was stalling for 2:46 minutes (according to bootchart) but now the startup only takes 23 seconds! So I'm really, really grateful for this.

Anonymous said...

Not what I was looking for, but definitely interesting. Thank you, shall try this out!
/// Nix

Anonymous said...

Thank you so much for the very easy how to! It has never been easier! My computer went from a 5 minute bootup to 1 minute! Thanks so much!

eboyjr said...

Thanks!
Now Ubuntu boots up in:
46 seconds!!!

Before, it was 47 seconds.

:(

everett said...

this increased my boot time a good thirty seconds...

Anonymous said...

Or you could install a startup-manager and tweak the settings..

Anonymous said...

thanks dude! i am the exact ubuntu n00b you were talking about! went from 26 to 20! yay!!

Anonymous said...

Note that boot times will vary by 3-4 seconds without changing anything, so if your boot time improves from 48 to 44, it could be a fluke. Reboot a few times before and after, just to make sure it helped.



Here's some things I did:


"sudo apt-get install preload". This is a really easy one, and it ought to be okay for basic users to try. No configuration necessary, just install it and you're good to go. This shaved about ten seconds off my boot time on the first reboot after installation (from 25-28 to 17-18,) and it will continue to get faster as it "gets a feel" for my system.


More advanced stuff:


If you're up to it, compile a 2.6.29 kernel and use ext4 instead of ext3 (you can just edit /etc/fstab to mount ext3 partitions as ext4.) The ext4 filesystem is slightly faster than ext3 during normal usage, and it can perform a full check for errors in just over 2 seconds(!) WARNING: Once you go ext4, you can almost never go back to ext3 without pain and suffering. ANOTHER WARNING: You need a kernel 2.6.28 or higher in order to use ext4, otherwise it will not work. Most distros do NOT ship with recent kernels by default, which is why you will probably have to compile one.

Disable some more stuff in sysv-rc-conf. Go through the list, make sure you know what each item is before you mess with it. Here's a pretty good list (although not exhaustive and not up-to-date) of what some of the most common items are for and if they can be safely messed with:
http://ubuntuforums.org/showthread.php?t=89491

Enable concurrency. First, install insserv and run it (back up your /etc/init.d and /etc/rc[0, 1, 2, 3, 4, 5, 6, S].d folders somewhere safe first, because insserv sometimes screws up.) Then, edit /etc/init.d/rc and set concurrency to "shell" instead of "none." THIS ONLY HELPS IF YOU HAVE MULTIPLE CPUS, MULTIPLE CORES, OR A CPU WITH HYPERTHREADING. Otherwise it slows things down.

Anonymous said...

I have Ubuntu 9.04 (Jackalope Jaunty). Can you tell me how to make sysv-rc-conf like it was ?

Mutuelle sante said...

Many thanks for the guide, this article was especially important for me to master how to make ubuntu to start faster. Thanks

Post a Comment