Very slow boot time (2 min)

Hi!
I’ve done some research but since it looks like a specific problem here, I’m creating a new post

So the boot time to login screen is about ~1 minute and then an other 1 minute to be desktop ready.

But the output of these cmds looks quite OK for me and doesn’t reflect the real time taken (measured with an external timer).

My question is: is it caused by a lot of services that eat a lot of time, or is it from one thing ? And how can I know which aha ?

Thanks for your time

$ sudo systemd-analyze blame    
  
12.890s systemd-journal-flush.service                                            
10.969s polkit.service                                                           
10.388s snapd.service                                                            
 9.901s lvm2-monitor.service                                                     
 6.632s dev-sda2.device                                                          
 5.655s avahi-daemon.service                                                     
 5.641s NetworkManager.service                                                   
 5.174s systemd-logind.service                                                   
 3.320s cups.service                                                             
 2.623s systemd-udevd.service                                                    
 2.024s apparmor.service                                                         
 1.835s tlp.service                                                              
 1.719s ModemManager.service                                                     
 1.489s systemd-tmpfiles-setup-dev.service                                       
 1.388s systemd-fsck@dev-disk-by\x2duuid-80CD\x2d3E44.service                    
 1.112s systemd-fsck-root.service                                                
 1.034s udisks2.service                                                          
  873ms rtkit-daemon.service                                                     
  751ms wpa_supplicant.service
[...]
$ systemd-analyze

Startup finished in 3.882s (kernel) + 34.462s (userspace) = 38.345s 
graphical.target reached after 32.624s in userspace
$ systemd-analyze critical-chain

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 @32.624s
└─multi-user.target @32.623s
  └─ModemManager.service @30.902s +1.719s
    └─polkit.service @19.929s +10.969s
      └─basic.target @19.907s
        └─sockets.target @19.907s
          └─snapd.socket @19.905s +1ms
            └─sysinit.target @19.792s
              └─systemd-update-utmp.service @19.698s +94ms
                └─systemd-tmpfiles-setup.service @19.308s +388ms
                  └─systemd-journal-flush.service @6.414s +12.890s
                    └─systemd-remount-fs.service @6.317s +53ms
                      └─systemd-fsck-root.service @5.203s +1.112s
                        └─systemd-journald.socket @5.105s
                          └─-.mount @4.887s
                            └─-.slice @4.887s
1 Like

Can you post the hardware info:
inxi -Fza ?

Yes, not the best laptop indeed but 2 minutes seems quite extreme

$ inxi -Fza

System:    Kernel: 5.10.23-1-MANJARO x86_64 bits: 64 compiler: gcc v: 10.2.0 
           parameters: BOOT_IMAGE=/boot/vmlinuz-5.10-x86_64 
           root=UUID=c84a930f-fb16-45ec-af73-e12fc24e5cd1 ro quiet apparmor=1 security=apparmor 
           resume=UUID=0a96185b-4e3f-4de3-b1be-7b9590c078b7 udev.log_priority=3 
           Desktop: KDE Plasma 5.21.3 tk: Qt 5.15.2 info: latte-dock wm: kwin_x11 vt: 1 dm: SDDM 
           Distro: Manjaro Linux base: Arch Linux 
Machine:   Type: Laptop System: Hewlett-Packard product: HP Pavilion Sleekbook 15 PC 
           v: 087E1000003B5900000320100 serial: <filter> Chassis: type: 10 serial: <filter> 
           Mobo: Hewlett-Packard model: 18FD v: 82.28 serial: <filter> UEFI: Insyde v: F.1B 
           date: 08/13/2013 
CPU:       Info: Dual Core model: Intel Core i3-3217U bits: 64 type: MT MCP arch: Ivy Bridge 
           family: 6 model-id: 3A (58) stepping: 9 microcode: 21 cache: L2: 3 MiB 
           flags: avx lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 14373 
           Speed: 1175 MHz min/max: 800/1800 MHz Core speeds (MHz): 1: 1175 2: 919 3: 946 4: 986 
           Vulnerabilities: Type: itlb_multihit status: KVM: VMX disabled 
           Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable 
           Type: mds mitigation: Clear CPU buffers; SMT vulnerable 
           Type: meltdown mitigation: PTI 
           Type: spec_store_bypass 
           mitigation: Speculative Store Bypass disabled via prctl and seccomp 
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 
           Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, IBRS_FW, STIBP: 
           conditional, RSB filling 
           Type: srbds status: Not affected 
           Type: tsx_async_abort status: Not affected 
Graphics:  Device-1: Intel 3rd Gen Core processor Graphics vendor: Hewlett-Packard driver: i915 
           v: kernel bus-ID: 00:02.0 chip-ID: 8086:0166 class-ID: 0300 
           Device-2: NVIDIA GF117M [GeForce 610M/710M/810M/820M / GT 620M/625M/630M/720M] driver: N/A 
           alternate: nouveau, nvidia_drm, nvidia bus-ID: 01:00.0 chip-ID: 10de:1140 class-ID: 0302 
           Device-3: Chicony HP Truevision HD type: USB driver: uvcvideo bus-ID: 3-3:2 
           chip-ID: 04f2:b35f class-ID: 0e02 serial: <filter> 
           Display: x11 server: X.Org 1.20.10 compositor: kwin_x11 driver: loaded: intel 
           display-ID: :0 screens: 1 
           Screen-1: 0 s-res: 1366x768 s-dpi: 96 s-size: 361x203mm (14.2x8.0") s-diag: 414mm (16.3") 
           Monitor-1: LVDS1 res: 1366x768 hz: 60 dpi: 99 size: 350x190mm (13.8x7.5") 
           diag: 398mm (15.7") 
           OpenGL: renderer: Mesa DRI Intel HD Graphics 4000 (IVB GT2) v: 4.2 Mesa 20.3.4 
           compat-v: 3.0 direct render: Yes 
Audio:     Device-1: Intel 7 Series/C216 Family High Definition Audio vendor: Hewlett-Packard 
           driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 chip-ID: 8086:1e20 class-ID: 0403 
           Sound Server-1: ALSA v: k5.10.23-1-MANJARO running: yes 
           Sound Server-2: JACK v: 0.125.0 running: no 
           Sound Server-3: PulseAudio v: 14.2 running: yes 
           Sound Server-4: PipeWire v: 0.3.23 running: yes 
Network:   Device-1: Ralink RT3290 Wireless 802.11n 1T/1R PCIe vendor: Hewlett-Packard 
           driver: rt2800pci v: 2.3.0 port: 5040 bus-ID: 07:00.0 chip-ID: 1814:3290 class-ID: 0280 
           IF: wlo1 state: up mac: <filter> 
           Device-2: Realtek RTL810xE PCI Express Fast Ethernet vendor: Hewlett-Packard driver: r8169 
           v: kernel port: 3000 bus-ID: 08:00.0 chip-ID: 10ec:8136 class-ID: 0200 
           IF: eno1 state: down mac: <filter> 
Bluetooth: Device-1: Ralink RT3290 Bluetooth vendor: Hewlett-Packard driver: N/A bus-ID: 07:00.1 
           chip-ID: 1814:3298 class-ID: 0d11 
           Report: This feature requires one of these tools: hciconfig/bt-adapter 
RAID:      Hardware-1: Intel 82801 Mobile SATA Controller [RAID mode] driver: ahci v: 3.0 port: 5060 
           bus-ID: 00:1f.2 chip-ID: 8086.282a rev: 04 class-ID: 0104 
Drives:    Local Storage: total: 465.76 GiB used: 87.04 GiB (18.7%) 
           SMART Message: Unable to run smartctl. Root privileges required. 
           ID-1: /dev/sda maj-min: 8:0 vendor: Hitachi model: HTS545050A7E380 size: 465.76 GiB 
           block-size: physical: 4096 B logical: 512 B speed: 3.0 Gb/s rotation: 5400 rpm 
           serial: <filter> rev: A7A0 scheme: GPT 
Partition: ID-1: / raw-size: 456.66 GiB size: 448.5 GiB (98.21%) used: 86.85 GiB (19.4%) fs: ext4 
           dev: /dev/sda2 maj-min: 8:2 
           ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%) used: 312 KiB (0.1%) fs: vfat 
           dev: /dev/sda1 maj-min: 8:1 
Swap:      Kernel: swappiness: 60 (default) cache-pressure: 100 (default) 
           ID-1: swap-1 type: partition size: 8.8 GiB used: 197.4 MiB (2.2%) priority: -2 
           dev: /dev/sda3 maj-min: 8:3 
Sensors:   System Temperatures: cpu: 36.0 C mobo: N/A 
           Fan Speeds (RPM): N/A 
Info:      Processes: 264 Uptime: 5h 43m wakeups: 2 Memory: 7.67 GiB used: 2.36 GiB (30.7%) 
           Init: systemd v: 247 tool: systemctl Compilers: gcc: 10.2.0 clang: 11.1.0 Packages: 
           pacman: 1379 lib: 395 flatpak: 0 Shell: Bash v: 5.1.0 running-in: konsole inxi: 3.3.03

Hello @leopnt :wink:

The bottle neck is here the rotating physical drive. 2min is quite normal for a:

running on a HDD.

You can change the scheduler to bfq: https://wiki.archlinux.org/index.php/Improving_performance#Changing_I/O_scheduler OR reducing services, but there is not much you can do about it. But better exchange your HDD with a decent SSD.

If you don’t have lvm volumes, this can be masked.

Just don’t use snap, remove it completely. Instead install it directly without sandbox.

Hope it helps.

This is quite a common thread in these forums with always the same answers, basically your main services to look at are systemd-journal-flush.service , polkit.service, a very little of ModemManager.service and some things probably relevant inside grub.

don’t let journal get too big, do your maintenance as described here System Maintenance - Manjaro or here systemd/Journal - ArchWiki

Check your value under cat /etc/default/grub | grep GRUB_TIMEOUT=

Inspect with journalctl -b -u polkit what it does in those 11 seconds, the rest with journalctl -b, for example what your system does after reaching sddm as you say.

You may remove quiet from your grub line and regenerate grub to be able to see in real time where your booting “hangs”. Also while I don’t see an impact in those systemd-analyze lines, your root filesystem is mounted read-only, this was changed recently and you should have set it to RW, check the instructions in your grub.pacnew file.

I assume if you don’t use modemmanager you could disable that service too but it isn’t that much of a deal as said.

1 Like

Tanks a lot for your replies !
I’ve been able to do some more research on everything that you’ve mentioned and it’s much better now
Also I’ve discovered that boot time from hibernate is even more reduced (if it can help someone in the future) :grin:

I will also definitely give a try to ssd aha

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.