How do I speed up boot time? [duplicate]

I have seen many videos that make Ubuntu faster, but these methods only make desktop performance faster.

I am looking to make my computer boot faster. Is their anything I can do to make Ubuntu boot significantly faster?


Solution 1:

Generally, the less programs you have loading on bootup, the faster your system should be. Try BUM (from software center) to disable some unneeded services, and also ensure you don't have any unnecessary programs installed that will be loaded when booting. Finally, using a solid state drive (SSD) as your boot device should significantly improve bootime.

Oh one more thing, your filesystem type makes a difference as well. EXT4 has suffered some performance regressions (according to phoronix) but I've still found EXT4 to be great for booting fast.

Solution 2:

Improving boot time is highly related with disabling/managing service, but the current answers lack details in disabling services which uses systemd.

What is systemd?

In short, systemd is a system and service manager for Linux, compatible with SysV and LSB init scripts. More about this can be read from official project page.

Check which services takes most time

Use the following command to check which service takes most of time

systemd-analyze blame

Disabling auto-start of services during boot

If you want to disable auto-starting of services during boot you can use the following command

sudo systemctl disable some-time-eater-service.service --now

However, you might want to see which other services needs the service in question. To check use the following command

systemctl list-dependencies some-time-eater-service.service --reverse

Note: Replace some-time-eater-service.service with actual service name like [email protected].

Note that, disabling auto-start doesn't make a service non-startable. The service can be started after boot when requirement arises. If you want to completely disable it, read the next section

Disabling services completely.

If you want to completely disable a service so that it can't be started, you should use mask instead of disable. Like this

sudo systemctl mask <SERVICE-NAME>

Replace the <SERVICE-NAME> with actual name of a service

The difference between mask and disable is mask make a service completely disable, you can't start it. You must unmask to start it with systemd (you can still start with service). But disable simply disable auto-start of a service, you can start it later.

For example, After masking my [email protected] service, when I wanted to start it with systemctl the following message is shown

Failed to start [email protected]: Unit [email protected] is masked.

GUI Tool

One GUI Tool I particularly find interesting is systemd-manager, it is still in development stage and hasn't been made it's path to Official Ubuntu repository. However, you can install it very easily from Systemd-Manager's github page. The releases contain a .deb package, which is very easy to install. You need GTK-3.16 or higher though.

Once you download and install, you can start it with systemd-manager command. Start it.

The application has two main view. One is Systemd Units and other one is Systemd Analyze. You can switch it with the label in top-left corner. See the screenshot.

Swithch Between Views

And There are three types of units you can manage. Servcies, Sockets and Timers. You can switch between them. See the screenshot.

Switch between unit types

Displaying Information

The three main tabs are Files, Journal, Dependencies.

  • Files is the selected unit's configuration file.
  • Journal is the live systemd's output while enabling/disabling/starting/stopping units
  • Dependencies shows what other services or units must be enabled to start a selected service.

Status Indicators

There are two columns beside the name of units to indicate the Status. Left one indicates whether that unit is enabled to start at boot and the right one indicates whether that unit is currently running. See them in picture.

Enabled at boot status

Currently running status

Control Switches

To toogle enabled-at-boot or running status, there are two toogle buttons at the top-right corner. Enabled means the units will start and boot. See them in picture.

Toogle switches to enable/start

The complete view of the application is shown below

Complete View

Hope this will help. I get benefited from other answers about systemd, but really needed to gather the information in one Place.

More information:

To know more about systemd you can visit these links:

  • I find ArchLinux's Wiki particularly rich. You can view it here https://wiki.archlinux.org/index.php/systemd
  • And the official Website: https://www.freedesktop.org/wiki/Software/systemd/

    Other Suggestions

Other answers have different suggestions. Including buying SSD, increasing RAM etc. If you can afford, those will definitely help, particularly the SSD suggestion.