Long system boot time

I am noticing very long boot times on my endeavour os install. From pressing power button to getting grub menu takes more than a minute, then 5 seconds on grub and after that the boot process takes additional 3-4 mins. Most of that time it is stuck in "starting arch version " screen. After entering password it takes another minute for system to be usable. I have only one app (xdm) with autostart permission. Here are some data that might be helpful. This is an HDD install with btrfs file system.

Here is the output of neofetch

                   ./sssso-                ------------------- 
                 `:osssssss+-              OS: EndeavourOS Linux x86_64 
               `:+sssssssssso/.            Host: TravelMate P259-G2-MG V1.51 
             `-/ossssssssssssso/.          Kernel: 5.14.7-arch1-1 
           `-/+sssssssssssssssso+:`        Uptime: 24 mins 
         `-:/+sssssssssssssssssso+/.       Packages: 1232 (pacman) 
       `.://osssssssssssssssssssso++-      Shell: bash 5.1.8 
      .://+ssssssssssssssssssssssso++:     Resolution: 1366x768 
    .:///ossssssssssssssssssssssssso++:    DE: Plasma 5.22.5 
  `:////ssssssssssssssssssssssssssso+++.   WM: KWin 
`-////+ssssssssssssssssssssssssssso++++-   Theme: Gently [Plasma], Breeze [GTK3] 
 `..-+oosssssssssssssssssssssssso+++++/`   Icons: [Plasma], Breeze-Noir-White-Blue [GTK2/3] 
   ./++++++++++++++++++++++++++++++/:.     Terminal: konsole 
  `:::::::::::::::::::::::::------``       CPU: Intel i5-7200U (4) @ 3.100GHz 
                                           GPU: NVIDIA GeForce 940MX 
                                           GPU: Intel HD Graphics 620 
                                           Memory: 1799MiB / 7819MiB 

                                                                   
                                                                   

Here is the output of systemd-analyze

Startup finished in 53.763s (firmware) + 5.231s (loader) + 56.334s (kernel) + 2min 194ms (userspace) = 3min 55.524s 
graphical.target reached after 1min 59.286s in userspace

Here is the output of systemd-analyze blame

1min 135ms NetworkManager-wait-online.service
   18.058s dev-sda3.device
   13.169s systemd-remount-fs.service
    5.054s systemd-sysctl.service
    4.797s ldconfig.service
    4.078s systemd-journal-flush.service
    3.473s media-D.mount
    2.580s samba.service
    2.236s systemd-fsck@dev-disk-by\x2duuid-146D\x2dDE0D.service
    2.204s sys-kernel-config.mount
    2.161s systemd-modules-load.service
    2.153s sys-kernel-debug.mount
    2.131s sys-fs-fuse-connections.mount
    2.084s systemd-binfmt.service
    2.038s proc-sys-fs-binfmt_misc.mount
    1.928s sys-kernel-tracing.mount
    1.896s dev-hugepages.mount
    1.893s dev-mqueue.mount
    1.861s systemd-journald.service
    1.833s nmb.service
    1.418s NetworkManager.service
    1.282s udisks2.service
    1.254s cups.service
    1.233s smb.service
     969ms systemd-udevd.service
     921ms avahi-daemon.service
     903ms tlp.service
     897ms systemd-logind.service
     890ms systemd-machined.service
     762ms systemd-sysusers.service
     752ms dev-disk-by\x2duuid-123da89a\x2d3359\x2d4464\x2dac33\x2d278ef989495c.swap
     674ms systemd-random-seed.service
     626ms zramd.service
     575ms polkit.service
     570ms systemd-rfkill.service
     478ms upower.service
     435ms systemd-backlight@backlight:intel_backlight.service
     415ms user@1000.service
     324ms modprobe@drm.service
     297ms systemd-udev-trigger.service
     269ms systemd-tmpfiles-setup.service
     257ms systemd-journal-catalog-update.service
     247ms bluetooth.service
     170ms home.mount
     167ms systemd-timesyncd.service
     166ms lvm2-monitor.service
     158ms wpa_supplicant.service
     135ms modprobe@fuse.service
     135ms var-log.mount
     112ms var-cache.mount
     110ms rtkit-daemon.service
     107ms systemd-tmpfiles-setup-dev.service
     105ms systemd-update-utmp.service
      70ms kmod-static-nodes.service
      67ms modprobe@configfs.service
      65ms boot-efi.mount
      44ms user-runtime-dir@1000.service
      42ms udisks2-zram-setup@zram0.service
      41ms alsa-restore.service
      25ms systemd-user-sessions.service
      23ms systemd-fsck@dev-disk-by\x2duuid-7c66c33c\x2d4a12\x2d44ac\x2da40e\x2d6aa9d6d34ceb.service
      11ms systemd-update-done.service
       6ms tmp.mount

Here is the output of systemd-analyze critical-chain. some outputs were in red colour so i indicated them with [red]

The time when unit became active or started is printed after the "@" character.
The time the unit took to start is printed after the "+" character.

graphical.target @1min 59.286s
└─multi-user.target @1min 59.286s
  └─smb.service @1min 58.051s +1.233s [red]
    └─nmb.service @1min 56.212s +1.833s [red]
      └─network-online.target @1min 56.208s
        └─network.target @56.066s
          └─wpa_supplicant.service @58.314s +158ms [red]
            └─dbus.service @54.638s
              └─basic.target @54.625s
                └─sockets.target @54.625s
                  └─virtlogd.socket @54.625s
                    └─sysinit.target @54.576s
                      └─systemd-update-done.service @54.564s +11ms [red]
                        └─ldconfig.service @49.764s +4.797s [red]
                          └─local-fs.target @49.761s
                            └─run-user-1000.mount @1min 22.681s
                              └─swap.target @45.290s
                                └─dev-zram0.swap @55.292s
                                  └─dev-zram0.device @55.001s

let me know if i can add anymore info.

return lsblk and sudo parted -l That is the letter l and not a number 1.

using wifi to connect to network?

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda      8:0    0 931.5G  0 disk 
├─sda1   8:1    0     1G  0 part /boot/efi
├─sda2   8:2    0    10G  0 part [SWAP]
├─sda3   8:3    0 319.9G  0 part /var/cache
│                                /home
│                                /var/log
│                                /
└─sda4   8:4    0 600.6G  0 part /media/D
sr0     11:0    1  1024M  0 rom  
zram0  254:0    0   7.6G  0 disk [SWAP]

Model: ATA TOSHIBA MQ01ABD1 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name  Flags
 1      1049kB  1075MB  1074MB  fat32                 boot, esp
 2      1075MB  11.8GB  10.7GB  linux-swap(v1)        swap
 3      11.8GB  355GB   344GB   btrfs
 4      355GB   1000GB  645GB   btrfs                 hidden


Model: Unknown (unknown)
Disk /dev/zram0: 8200MB
Sector size (logical/physical): 4096B/4096B
Partition Table: loop
Disk Flags: 

Number  Start  End     Size    File system     Flags
 1      0.00B  8200MB  8200MB  linux-swap(v1)


Yes, but not always. Some times i use wired Ethernet also.

Might be zram taking long time to get “mounted” and enabled?
How have you set it up?

With zramd. I followed this tutorial Speedy Install: EndeavourOS 2021.04.17 ArchLinux with BTRFS, TimeShift, Gnome 40, ZRAM, and PipeWire - YouTube

I can’t tell for sure that zramd service is the reason for giving the rather long boot time in your system but I have never seen such a start time for a zram device on my installs.

You might want to disable zramd.service and reboot to test:

sudo systemctl disable zramd.service

By the way, I am using zram-generator:

https://wiki.archlinux.org/title/Improving_performance#zram_or_zswap

Disabled zramd and startup seems a bit better. Also enabled fastboot from bios menu and disabled samba, smb, nmb services. It cut down startup to around a minute and half(seems reasonable for an hdd). Will restart system fea more times to see if the startup is consistent.

1 Like

You might want to disable NetworkManager-wait-online.service as well.

https://wiki.archlinux.org/title/NetworkManager#NetworkManager-wait-online

I believe this is the main issue. I have KDE Plasma but it boots fine, but I noticed many times after booting it keeps struggling with WiFi connection and cant connect unless I connect and disconnect a few times.
Perhaps it keeps trying to connect during boot and can’t.
Maybe letting it try to connect last thing will help.

UPDATE:
Out of curiosity I did:

sudo systemctl disable NetworkManager-wait-online.service

and rebooted. I didn’t notice any difference.
So I reverted to:

sudo systemctl enable NetworkManager-wait-online.service

I had to disconnect an connect manually to get WiFi.

I tried (out of curiosity and hoping even for a faster boot), it is not installed.

I think to disable if using NetworkManager you need to mask it instead of disable… as it will get triggered anyway

1 Like

I understand that Masking a service prevents the service from being started manually or automatically.
Does this mean that I won’t even be able to manually connect after boot?

Currently after boot it is taking long time to connect. I have to manually disconnect then connect.
Any suggestions?

UPDATE:
I found this It takes a long time to establish a WiFi connection [Video added] - #62 by limotux and it worked perfectly for the wifi issue.

Still, a bit slow boot, (HDD, KDE Plasma, relatively old laptop)

After multiple reboots, the startup time seems consistent. I just realized zram is pretty useless for my system as i am yet to run out of ram.
One more issue is that, after pressing the power button it takes about a minute sometimes for grub menu to load. Sometimes it loads instantaneously.

Have you checked that the PC has enough entropy?

cat /proc/sys/kernel/random/entropy_avail

Value should be above 1.000. If not, you should try out the haveged service.

Also, did you try a different kernel, preferrably linux-lts?

That is certainly not a linux issue but more related to BIOS. Are you using UEFI? Have you checked the boot order?

For me, I installed LTS
This is my entropy"

[limo@lenovo ~]$ cat /proc/sys/kernel/random/entropy_avail
3512
[limo@lenovo ~]$ 

This is much more than the 1000 you mentioned I think.
It is booting a little bit faster, but … OK. I can leave it on for days.
Battling actually to enter BIOS to check. Just to be sure, what should I modify in BIOS?

yes

yes. here is the output of efibootmgr

BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000,2001,2002,2003
Boot0000* Yes
Boot2001* EFI USB Device
Boot2002* EFI DVD/CDROM
Boot2003* EFI Network

The ‘boot0000 yes’ is endeavour os grub.

[limo@lenovo ~]$ sudo efibootmgr 
No BootOrder is set; firmware will attempt recovery
[limo@lenovo ~]$ efibootmgr -v
No BootOrder is set; firmware will attempt recovery

This does not seem ok.
What you think?

I am a little bit confused. For whom are we trouble shooting here? For @limotux or @rottinhell ?

1 Like