12

I have been checking some systemd-analyze outputs and I actually don't have a crucial problem with my boot time but just wondering whether I can decrease it further. I'd like to mention that I'm using an SSD and Ubuntu is my only OS.

systemd-analyze
Startup finished in 5.450s (firmware) + 565ms (loader) + 2.632s (kernel) + 10.086s (userspace) = 18.734s 
graphical.target reached after 10.071s in userspace
systemd-analyze blame
          6.607s NetworkManager-wait-online.service
          5.660s fwupd.service
          5.042s bolt.service
          4.134s plymouth-quit-wait.service
          1.579s dev-sda2.device
          1.552s systemd-backlight@backlight:intel_backlight.service
          1.367s plymouth-read-write.service
          1.211s snapd.service
           903ms systemd-logind.service
           572ms systemd-journald.service
           555ms dev-loop9.device
           523ms dev-loop6.device
           515ms man-db.service
           499ms dev-loop8.device
           478ms dev-loop5.device
           472ms dev-loop13.device
           448ms dev-loop7.device
           441ms dev-loop11.device
           438ms dev-loop10.device
           432ms dev-loop12.device
           415ms udisks2.service
           406ms dev-loop14.device
           319ms snap-gnome\x2d3\x2d28\x2d1804-71.mount
graphical.target @10.071s
└─multi-user.target @10.071s
  └─kerneloops.service @10.042s +27ms
    └─network-online.target @10.032s
      └─NetworkManager-wait-online.service @3.422s +6.607s
        └─NetworkManager.service @3.224s +186ms
          └─dbus.service @3.218s
            └─basic.target @3.211s
              └─sockets.target @3.211s
                └─snapd.socket @3.208s +2ms
                  └─sysinit.target @3.205s
                    └─systemd-backlight@backlight:intel_backlight.service @1.468s +1.552s
                      └─system-systemd\x2dbacklight.slice @1.467s
                        └─system.slice @212ms
                          └─-.slice @212ms
1
  • Replace snap apps with regular apps. Each installed snap app increases boot time. Note all of the loop devices in your analyze output. You can also run sudo fdisk -l and see if it tells you that you have partitions on your SSD that are not aligned.
    – heynnema
    Aug 17, 2019 at 21:51

3 Answers 3

30

If this system is not a server in a network, you can start by cutting down on time used by NetworkManager-wait-online.service, to do this please disable the service like so:

sudo systemctl disable NetworkManager-wait-online.service

If it shows up again after reboot, you can follow the above command with this:

sudo systemctl mask NetworkManager-wait-online.service

Pleas, try this first and check if your boot time improves before carrying on with any further steps. This alone, sometimes, reduces your boot time by a great deal.


To roll back the above changes anytime, please run:

sudo systemctl unmask NetworkManager-wait-online.service

Then follow it by:

sudo systemctl enable NetworkManager-wait-online.service

What is systemd-networkd-wait-online.service?

NAME systemd-networkd-wait-online.service, systemd-networkd-wait-online - Wait for network to come online

SYNOPSIS systemd-networkd-wait-online.service

   /lib/systemd/systemd-networkd-wait-online

DESCRIPTION systemd-networkd-wait-online is a oneshot system service (see systemd.service(5)), that waits for the network to be configured. By default, it will wait for all links it is aware of and which are managed by systemd- networkd.service(8) to be fully configured or failed, and for at least one link to be online. Here, online means that the link's operational state is equal or higher than "degraded". The threshold can be configured by --operational-state= option.

The purpose of the NetworkManager-wait-online.service is to wait for the network to come online before proceeding with the boot process.

This is needed in case of for example servers that rely on network resources as part of the boot process ( eg. mounting remote drives ) or in the case of workstations that rely on the network to boot correctly ( eg. Thin Clients ).

Otherwise, desktop users can disable NetworkManager-wait-online.service and network will connect normally after boot has finished minus the unneeded wait time.

It is safe to disable in this case.

4
  • 2
    Thanks for the reply. It greatly decreased the boot time. Farewell!
    – codear
    Aug 19, 2019 at 9:20
  • @codear I am glad it helped
    – Raffa
    Aug 23, 2019 at 18:35
  • 1
    I logged in just to give you an up vote, Thank you for your detailed and great explanation :D Oct 20, 2022 at 9:14
  • Thank you, this solved my issue. Mar 20 at 1:38
1

This line with 1.5 seconds is a bug:

      1.552s systemd-backlight@backlight:intel_backlight.service

On my system without bug it is only 1 millisecond:

$ systemd-analyze blame | grep backlight

         1ms systemd-backlight@backlight:intel_backlight.service

More tips (including NetworkManager-wait-online.service) can be found here:

0

For me, disabling snapd managed to solve the issue. Ubuntu was my only OS as well, and upgrading to a newer version resulted in super slow boot times for some reason.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .