How do I improve boot speed?

123,154

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:

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

Solution 3

I just ran across this the other day. Its "e4rat" Instructions Here

This little app is amazing.

I took an overtired single processor AMD sempron running at 2800+ which normaly boots Natty at 1.45 mins to 27.885 secs.

I have the boot-charts to prove it. Its crazy! enter image description here

Solution 4

Switch from a magnetic drive to a Solid State Drive, or a Magnetic & Solid State Hybrid drive. That will make any OS boot a lot faster. Hybrid drives are not that much more expensive. If you don't want to go that far, then just get a 7200 or 10K RPM hard drive.

Solution 5

I assume you're talking about Ubuntu 11.04? I have been trying this for a pretty long time now without much success. These steps made a few seconds difference:

  1. Removing unneeded packages

     sudo apt-get purge brltty brltty-x11 foo2zjs min12xxw ttf-indic-fonts-core ttf-kacst-one ttf-khmeros-core ttf-lao ttf-punjabi-fonts ttf-unfonts-core
    
  2. Using both cores/CPUs during the boot process

    ONLY DO THIS IF YOU ARE SURE YOUR COMPUTER HAS MULTIPLE CPUs / CORES!
    Open /etc/init.d/rc (you'll need root privileges) and replace CONCURRENCY=none by CONCURRENCY=shell. Then save the file.

    Update: "CONCURRENCY=shell is now obsolete and is aliased to 'makefile'. Since 2010-05-14 the default has been 'makefile'."*   ~Jonathon

  3. Disabling unneeded daemons

    This is a bit more advanced, so best not to do it if you don't know what this means.

    Install bum, and start it with root privileges. Then just untick the boxes in front of the daemons you are sure you don't need. For instance, when you don't have a scanner, you can disable saned. And if you never use bluetooth, you can disable bluetooth as well.

    When you're done, click the Apply button and click either yes or no (it doesn't matter much).

    After completing these steps, reboot twice. For some reason the first reboot after changing all these options takes much longer than the other ones, but you should notice some difference during the second reboot.

Share:
123,154

Related videos on Youtube

jnut
Author by

jnut

has been using Ubuntu since hardy and is still a windows user. one day i will be able to use everything with Ubuntu. and i believe that day is coming

Updated on September 17, 2022

Comments

  • jnut
    jnut over 1 year

    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?

    • Anwar
      Anwar over 7 years
      @ByteCommander A step by step answer will do the job.
  • Brad Henderson
    Brad Henderson over 13 years
    Disk speed is the current boot-bottleneck.
  • extraymond
    extraymond almost 12 years
    This really helps!!!
  • Victor Bjelkholm
    Victor Bjelkholm about 11 years
    More people need to know about e4rat, it's a fantastic tool that made the biggest improvement of many different tips and tricks.
  • John
    John about 11 years
    Is it still legit for 12.04? I heard it would cause problems with ureadahead. Is this true?
  • Jonathon
    Jonathon almost 11 years
    CONCURRENCY=shell is now obsolete and is aliased to 'makefile'. Since 2010-05-14 the default has been 'makefile'.
  • Willem Van Onsem
    Willem Van Onsem over 8 years
    Is it possible to list (or give a short explanation) which packages you advice to remove? (first point in your explanation). Always mind that there are people that simply do copy-paste and all of a sudden are unable to read from terminal etc.
  • RobinJ
    RobinJ over 8 years
    @CommuSoft Since this answer is about Ubuntu 11.04 anyway it would be unadvisable anyway to apply the same answer to more recent versions. Some of this stuff will not work anymore, and other things may break the system.
  • Philippe Gachoud
    Philippe Gachoud over 8 years
    you could add which service could be disabled which is not usefull normally?
  • Jason Southwell
    Jason Southwell over 8 years
    @PhilippeGachoud I really can't remember now. This is from 2010!
  • Hi-Angel
    Hi-Angel over 8 years
    @user138784 as I understand, this is because ureadahead does alike job as the e4rat, so they're obviously conflicts. But e4rat for some reason seems to be better than ureadahead. Also, perhaps would be useful — the e4rat for some reason doesn't work by default, it needs some tweak, otherwise the log file isn't created.
  • userDepth
    userDepth over 7 years
    I am using a backward compatible SSD and my board is SATA. It boots crazy fast.
  • Anwar
    Anwar over 7 years
    e4rat didn't work in 16.04
  • 0xC0000022L
    0xC0000022L over 6 years
    @scottl given my disks are SATA and my boot time is similar to the 1:45 min reported by @RobinJ, I doubt that there's any reason to point fingers to disk performance in particular. On thing I do see, however, is that mounting disks and shares is done in a synchronous fashion, despite 1.) using fastboot and 2.) those disks not being important for the boot process.
  • Wilf
    Wilf over 5 years
    The modern equivalent is covered here askubuntu.com/a/763070/178596
  • r_alex_hall
    r_alex_hall about 5 years
    It seems to me this utility is basically a file system defragementer? That will probably not produce speedups on devices that have equal time for all reads/writes, like SSDs.
  • rdtsc
    rdtsc over 4 years
    mmstick/systemd-manager seems to have disappeared... would you have an alternative?
  • reducing activity
    reducing activity over 2 years
    Is bum still relevant in 20.04 or other supported Ubuntu?
  • reducing activity
    reducing activity over 2 years
    Is bum still relevant in 20.04 or other supported Ubuntu? (maybe question should be reworded to be about Ubuntu 11 and a new one opened?
  • Marco Sulla
    Marco Sulla over 2 years
    I would add that, if you have the technical skills, you can analyze the errors during the boot using journalctl -b -p 4 and check on internet if there's a remedy.