LinuxLinks.com
Newbies What Next ? News Forums Calendar


Ubuntu Tips - Boot Faster (Page 1 of 4)

With the amazing feats performed by Linux kernel developers over the years, you might be tempted to think that systems installed with the latest Ubuntu distribution are already running at the fastest possible speed. However, this is often not the case. Ubuntu's developers, Canonical, have to appeal to a wide audience, and ensure that their distribution runs with a diverse set of hardware. This has the unfortunate consequence that systems are not always fully optimised.

How important the length of time a system takes to boot largely depends on the function it performs. For example, fast bootup times are inconsequential to a system administrator who reboots a server infrequently. However, desktop users typically do not leave their computer running constantly. To be productive, desktop users need to be up and running as quickly as possible. A slow boot can be very annoying for them especially if they only want to catch up with email or check the latest sporting results, before dashing out the door.

There are some hardware solutions that provide an 'Instant-On' function, where the time to boot can be as little as five seconds. However, these have limited use, given that such embedded solutions only provide a limited functionality. What many users really need is their standard desktop operating system being available to use in the quickest time possible.

With just a few modifications and some experimentation, your Ubuntu box can realise its untapped potential. We have identified 8 tips to help you achieve this. Most of the tips are really easy to implement, and are perfectly safe. Nevertheless, it is always sage advice to backup data before experimenting with a machine. We would therefore recommend you backup your data before embarking on reading this four page article.

Remove the timeout

One of the easiest ways to make your Ubuntu machine boot faster is to simply remove the timeout in the boot loader. When your machine boots, a small countdown takes place. Historically, the purpose of this delay was to ensure that modules loaded in time for the kernel to boot. However, this is only really needed for legacy hardware. For modern computers, we can just remove the delay without any ill effect.

How to remove the timeout depends on what version of the GRand Unified Bootloader (GRUB) the computer is running. To check the version, type in a terminal:

grub --version

On our Ubuntu 9.04 systems, this outputs GRUB 0.97, which is best thought of as GRUB version 1. To remove the timeout, you just need to edit the file /boot/grub/menu.lst in a text editor (you need to use sudo for permission reasons). For example, to use gedit to edit the file you would type in a terminal:

sudo gedit /boot/grub/menu.lst

In this file, locate the line timeout=3 and change it to timeout=0. Save the file, and then reboot the system.

Please note that if your Ubuntu system uses Grub 2 (version 1.96), the procedure is different. With Grub 2 user-configurable settings are contained mainly in /etc/default/grub and the files in /etc/grub.d/. When update-grub is executed the results are input into the /boot/grub/grub.cfg file. To remove the timeout, you need to edit the file /etc/default/grub and change the GRUB_TIMEOUT line accordingly, and save the file. Then run update-grub which will update the /boot/grub/grub.cfg file.


Disable services that are not needed

A stock Ubuntu distribution cannot possibly meet the exact requirements of evey user. Consequently, there are some processes that are started up in the boot process that may not be required by some users. In these circumstances, resources are not being utilitised optimally, and the boot process is being extended unnecessarily. Moreover, as you try out new software and services you may find that boot times get longer and longer over time.

Bootchart is a handy utility which allows you to audit the boot sequence of your computer. It generates an attactive chart of the processes that are run at bootup, how long they take to initiate, and what resources they use. Armed with this information, you can identify the processes which take a significant amount of time to load, and then decide whether they can be removed.

Bootchart is not installed by default in Ubuntu, but this is easily rectified by installing it in the usual way with the Synaptic Package Manager.

The auditing is performed early in your boot sequence, and records system statistics as your computer boots.

When the boot loader starts, select the relevant kernel you are booting, press 'e' to edit the commands,and add the following to the kernel line:

init=/sbin/bootchartd

After booting, the software will have created a .png graphic chart in /var/log/bootchart/

The screenshot on the left is the result from one of our test servers. Whilst the machine has a dual core processor it is slow to boot largely because we use it to test lots of software, which has in turn has installed numerous services. However, much of this software is not actually needed, and therefore unnecessarily extends the time it takes for the machine to be ready to use. Your bootchart might also look as bad as that machine.

Click on the image to make it full size

As you can see, there's a whole raft of services being launched on this machine, many of which are not actually needed.

OK, bootchart lets you identify the services, but does not let you configure the services.

Ubuntu does not automatically install a graphical tool to disable services. The Boot-Up-Manager (BUM) is the most comprehensive and user-friendly tool for Ubuntu available, and can again be installed using Synaptic.

Boot-Up Manager is a graphical tool to allow easy configuration of init services in user and system runlevels.

Before removing a service, you should do some research to ensure that it is not essential to the operation of your machine.

Fortunately, Boot-Up Manager provides a detailed description of each service you have running, which should provide sufficient information to decide whether to deactivate the service.

On our test machine there are more than a dozen services we did not need, which shaved five seconds from the boot sequence.

I would stress that you should make a backup of your system before deactivating services.


Read more > >

Jump ahead:

1. Ubuntu Tips - Booting - Page 1 (current page)
2. Ubuntu Tips - Booting - Page 2 (next page)
3. Ubuntu Tips - Booting - Page 3
4. Ubuntu Tips - Booting - Page 4

Bookmark and Share


Last Updated Wednesday, September 30 2009 @ 01:42 PM EDT


We have written a range of guides highlighting excellent free books for popular programming languages. Check out the following guides: C, C++, C#, Java, JavaScript, CoffeeScript, HTML, Python, Ruby, Perl, Haskell, PHP, Lisp, R, Prolog, Scala, Scheme, Forth, and SQL.

Built with GeekLog and phpBB
Comments to the webmaster are welcome
Copyright 2009 LinuxLinks.com - All rights reserved