Excessive booting time

On my ASUS laptop (Intel® Core™ i7-6500U CPU @ 2.50GHz × 4) the time of booting is about 1’45’’.

This is the output of “systemd-analyze critical-chain” command:

graphical.target @1min 20.839s
└─multi-user.target @1min 20.839s
  └─plymouth-quit-wait.service @1min 77ms +20.761s
    └─systemd-user-sessions.service @59.936s +129ms
      └─remote-fs.target @59.931s
        └─remote-fs-pre.target @59.931s
          └─nfs-client.target @48.836s
            └─gssproxy.service @48.358s +473ms
              └─network.target @48.340s
                └─wpa_supplicant.service @50.695s +65ms
                  └─dbus-broker.service @15.474s +1.051s
                    └─dbus.socket @15.099s
                      └─sysinit.target @15.089s
                        └─systemd-userdbd.service @1min 842ms +110ms
                          └─systemd-userdbd.socket @5.032s
                            └─system.slice
                              └─-.slice

These are the most important log messages:

15:04:04 systemd: Failed to start Application launched by gnome-session-binary.
15:03:57 gdm-session-wor: gkr-pam: unable to locate daemon control file
14:59:39 wpa_supplicant: bgscan simple: Failed to enable signal strength monitoring
14:59:10 bluetoothd: Failed to set mode: Blocked through rfkill (0x12)
14:59:02 alsactl: alsa-lib main.c:1405:(snd_use_case_mgr_open) error: failed to import hw:1 use case configuration -6
14:59:01 irqbalance: libcap-ng used by "/usr/sbin/irqbalance" failed due to not having CAP_SETPCAP in capng_apply
14:58:57 kernel: snd_hda_intel 0000:01:00.1: no codecs found!
14:58:40 kernel: tpm_crb MSFT0101:00: [Firmware Bug]: ACPI region does not cover the entire command/response buffer. [mem 0xfed40000-0xfed4087f flags 0x200] vs fed40080 f80
14:58:40 kernel: ACPI Error: Skipping While/If block (20210331/psloop-426)
14:58:40 kernel: x86/cpu: SGX disabled by BIOS.
14:58:40 kernel: DMAR: [Firmware Bug]: No firmware reserved region can cover this RMRR [0x0000000078800000-0x000000007affffff], contact BIOS vendor for fixes

Any suggestions to reduce the booting time to a more acceptable level?
Thank you very much in advance

This is my desktop machine result:

graphical.target @13.086s
└─multi-user.target @13.086s
  └─plymouth-quit-wait.service @8.471s +4.613s
    └─systemd-user-sessions.service @8.441s +23ms
      └─remote-fs.target @8.430s
        └─remote-fs-pre.target @8.427s
          └─nfs-client.target @5.675s
            └─gssproxy.service @5.558s +115ms
              └─network.target @5.544s
                └─wpa_supplicant.service @11.629s +42ms
                  └─dbus-broker.service @3.928s +175ms
                    └─dbus.socket @3.812s
                      └─sysinit.target @3.803s
                        └─systemd-userdbd.service @8.582s +50ms
                          └─systemd-userdbd.socket @1.908s
                            └─system.slice
                              └─-.slice

You might also want to check the output of systemd-analyze blame

# systemd-analyze  blame
19.705s var-vols-photos-YearWeek.mount
19.625s mnt-8T.mount
19.615s var-vols-dat.mount
12.652s mnt-6T.mount
 8.063s dnf-makecache.service
 4.613s plymouth-quit-wait.service
 2.957s dracut-initqueue.service
 2.870s NetworkManager-wait-online.service
 2.280s upower.service
 2.158s sssd.service
 1.983s initrd-switch-root.service
 1.957s udisks2.service
 1.555s firewalld.service
 1.005s lvm2-monitor.service
  908ms smartd.service
  884ms mariadb.service
  876ms user@1000.service
  697ms sssd-kcm.service
  686ms packagekit.service
  669ms polkit.service
  497ms systemd-tmpfiles-clean.service
  496ms systemd-journal-flush.service
  412ms ModemManager.service
  318ms avahi-daemon.service
  317ms systemd-resolved.service
  315ms bluetooth.service
  290ms rtkit-daemon.service
  276ms switcheroo-control.service
  272ms libvirtd.service
  269ms systemd-homed.service
  262ms systemd-machined.service
  244ms thermald.service
  241ms initrd-parse-etc.service
  221ms lm_sensors.service
  187ms abrtd.service
  187ms systemd-oomd.service
  179ms systemd-rfkill.service
  175ms dbus-broker.service
  161ms livesys.service
  148ms dev-hugepages.mount
  148ms dev-sda1.swap
  140ms dev-mqueue.mount
  139ms NetworkManager.service
  136ms systemd-udev-trigger.service
  133ms geoclue.service
  132ms sys-kernel-debug.mount
  128ms sys-kernel-tracing.mount
  126ms kmod-static-nodes.service
  122ms sshd.service
  115ms gssproxy.service
  114ms systemd-tmpfiles-setup.service
  113ms home.mount
  111ms mnt-1T.mount
  107ms systemd-fsck@dev-disk-by\x2duuid-2754\x2dD36D.service
  107ms systemd-logind.service
  105ms nfs-convert.service
  105ms boot.mount
  100ms import-state.service
   96ms systemd-udevd.service
   86ms systemd-vconsole-setup.service
   82ms var-lib-libvirt-images.mount
   78ms var-lib-mysql.mount
   76ms cups.service
   75ms dracut-cmdline.service
   74ms plymouth-switch-root.service
   73ms var-log.mount
   73ms user-runtime-dir@1000.service
   70ms chronyd.service
   70ms plymouth-read-write.service
   68ms var-lib-nfs-rpc_pipefs.mount
   68ms dracut-pre-pivot.service
   68ms var-vols-apps.mount
   67ms systemd-modules-load.service
   67ms systemd-tmpfiles-setup-dev.service
   65ms auditd.service
   63ms dev-zram0.swap
   63ms systemd-remount-fs.service
   61ms accounts-daemon.service
   55ms systemd-zram-setup@zram0.service
   50ms systemd-userdbd.service
   50ms initrd-cleanup.service
   49ms livesys-late.service
   47ms colord.service
   42ms wpa_supplicant.service
   37ms systemd-journald.service
   34ms uresourced.service
   32ms dracut-pre-udev.service
   28ms boot-efi.mount
   25ms gdm.service
   24ms systemd-sysctl.service
   24ms systemd-random-seed.service
   23ms systemd-fsck-root.service
   23ms systemd-user-sessions.service
   22ms sys-fs-fuse-connections.mount
   21ms plymouth-start.service
   19ms rpc-statd-notify.service
   18ms sys-kernel-config.mount
   14ms modprobe@drm.service
   12ms systemd-update-utmp.service
   12ms systemd-update-utmp-runlevel.service
   11ms systemd-backlight@backlight:acpi_video0.service
   10ms initrd-udevadm-cleanup-db.service
   10ms dracut-shutdown.service
    7ms modprobe@configfs.service
    5ms tmp.mount
    4ms modprobe@fuse.service
   37us systemd-homed-activate.service

This it the output of the “systemd-analyze blame” command, however “systemd-analyze plot” shows that “firewalld.service” works in parallel with other services, at first glance without conditioning them:

32.916s firewalld.service
20.761s plymouth-quit-wait.service
20.271s upower.service
19.745s sssd.service
17.525s ModemManager.service
11.581s NetworkManager-wait-online.service
 8.609s bluetooth.service
 7.106s systemd-journal-flush.service
 7.060s systemd-udev-settle.service
 6.801s initrd-switch-root.service
 6.788s lvm2-monitor.service
 4.874s abrtd.service
 4.701s accounts-daemon.service
 4.551s sssd-kcm.service
 4.328s avahi-daemon.service
 3.358s packagekit.service
 3.133s udisks2.service
 2.891s fwupd.service
 2.794s rtkit-daemon.service
 2.790s thermald.service
 2.308s dnf-makecache.service
 2.132s systemd-udevd.service
 1.738s dracut-initqueue.service
 1.661s cups.service
 1.218s systemd-homed.service
 1.205s switcheroo-control.service
 1.205s auditd.service
 1.171s livesys.service
 1.097s systemd-zram-setup@zram0.service
 1.051s dbus-broker.service
  998ms polkit.service
  976ms user@1000.service
  931ms systemd-backlight@backlight:intel_backlight.service
  893ms systemd-resolved.service
  684ms systemd-tmpfiles-setup-dev.service
  579ms libvirtd.service
  540ms systemd-fsck@dev-disk-by\x2duuid-10D9\x2dE0F1.service
  519ms systemd-tmpfiles-clean.service
  473ms gssproxy.service
  407ms systemd-fsck@dev-disk-by\x2duuid-a30525eb\x2dea5a\x2d4316\x2d8749\x2dd90ee2414f2d.service
  365ms systemd-sysctl.service
  344ms gdm.service
  341ms systemd-oomd.service
  340ms plymouth-switch-root.service
  331ms rpc-statd-notify.service
  327ms systemd-udev-trigger.service
  322ms systemd-tmpfiles-setup.service
  298ms import-state.service
  291ms var-lib-nfs-rpc_pipefs.mount
  283ms dev-zram0.swap
  269ms NetworkManager.service
  232ms nfs-convert.service
  228ms systemd-modules-load.service
  225ms systemd-journald.service
  221ms plymouth-read-write.service
  219ms initrd-parse-etc.service
  218ms systemd-fsck-root.service
  213ms systemd-random-seed.service
  196ms systemd-logind.service
  190ms chronyd.service
  164ms colord.service
  137ms boot-efi.mount
  129ms systemd-user-sessions.service
  129ms systemd-rfkill.service
  129ms boot.mount
  110ms systemd-userdbd.service
   96ms systemd-vconsole-setup.service
   95ms dev-hugepages.mount
   93ms dev-mqueue.mount
   91ms sys-kernel-debug.mount
   89ms sys-kernel-tracing.mount
   72ms systemd-update-utmp.service
   71ms systemd-remount-fs.service
   65ms dracut-cmdline.service
   65ms wpa_supplicant.service
   63ms sys-fs-fuse-connections.mount
   62ms sys-kernel-config.mount
   60ms dracut-shutdown.service
   53ms geoclue.service
   52ms home.mount
   50ms uresourced.service
   50ms dracut-pre-pivot.service
   30ms initrd-cleanup.service
   30ms dracut-pre-udev.service
   22ms flatpak-system-helper.service
   19ms kmod-static-nodes.service
   15ms user-runtime-dir@1000.service
   15ms plymouth-start.service
   13ms tmp.mount
   10ms livesys-late.service
    9ms systemd-update-utmp-runlevel.service
    6ms initrd-udevadm-cleanup-db.service
    4ms modprobe@drm.service
    4ms modprobe@configfs.service
    3ms modprobe@fuse.service

Your firewalld and upower seems taking quite long to start.

If you’re not using a modem, you can disable and mask ModemManager.service, and the same goes for bluetooth.

pranav@fedora ~/GitHub/Linux-101 (master)> systemd-analyze blame
31.118s fstrim.service
13.453s NetworkManager-wait-online.service
 4.370s plymouth-quit-wait.service
 3.802s upower.service
 2.334s systemd-udev-settle.service
 2.212s vmware.service

In my case, Fstrim is taking a lot of seconds to run and the same goes for NetworkManager-wait-online service. Is there a way to fix this?

And I see VMware service running. Can I block this service? I want VMware to run its “services” only when the user is using VMware GUI software because I don’t use VMware all the time. Why it need to run 24/7 during boot-time?!

sudo systemctl disable NetworkManager-wait-online.service
2 Likes

Will it create problems, like having users manually connect to wifi every time they boot the device?

Not really, moreover disabling it actually better suits laptops.
Mobile devices typically have no persistent connectivity.
So, it makes no sense to delay startup waiting for the online target.

Keep in mind, the things you see in blame don’t always impact your boot time. Some of those happen asynchronously in parallel. To see what is impacting your boot time use systemd-analyze critical-chain

3 Likes

Does that mean that all those services which are red in color, are the ones that I need to look into (i.e causing a delay in boot time)? Right? Why else it would be red in color?

Edit: All the plus sign denotes the extra time it requires.

It also shows the same but my timings are much much worse. Check this out :-


what might be the reason behind this thing. its literally taking 1 minute 4 seconds to start up.

Welcome,

Please post that output in code tags so we can see all of it from the beginning which is off screen at the bottom there

umm… could you please explain what is code tags as i don’t know what it is.

Highlight the text that needs code formatting and then click this button:

Alternatively, you can put 3 ~ before and after the text block you want to be encoded, like this

~~~
Some text
~~~

If you do, it will look like this:

Some text

You also can post it like this

[code]
your text here
[/code]

and it will be a preformatted text block as shown