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