Long boot time and long wait time for the desktop to show after logging in.

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
camy
Level 1
Level 1
Posts: 2
Joined: Wed Dec 01, 2021 6:33 am

Long boot time and long wait time for the desktop to show after logging in.

Post by camy »

It takes roughly around a minute or two to get to the login screen and around 30s for the desktop to show up after logging in.
I'm a Linux noob. I just installed Linux mint 20.2 and have been using it for only 2 weeks. I like using mint but the boot time is really long compared to when it was with Windows 10 1703, which was probably less than 15s. I've searched around but I couldn't find issues similar to mine. And also there's this acpi error that shows up on boot. I've read that it's harmless but it shows 3 times during boot and I was wondering if it has anything to do with the long boot time.
Would appreciate the help!

Informations of my device:

Code: Select all

$ systemd-analyze
Startup finished in 5.731s (kernel) + 39.770s (userspace) = 45.501s 
graphical.target reached after 39.090s in userspace

Code: Select all

$ systemd-analyze blame
14.567s systemd-journal-flush.service                        
13.525s snapd.service                                        
13.175s accounts-daemon.service                              
12.924s networkd-dispatcher.service                          
11.799s NetworkManager-wait-online.service                   
11.410s dev-sda5.device                                      
10.938s udisks2.service                                      
 8.071s polkit.service                                       
 7.932s NetworkManager.service                               
 7.876s avahi-daemon.service                                 
 7.348s thermald.service                                     
 7.346s systemd-logind.service                               
 7.340s wpa_supplicant.service                               
 7.337s ubuntu-system-adjustments.service                    
 5.399s ModemManager.service                                 
 3.355s dev-loop0.device                                     
 3.264s dev-loop2.device                                     
 3.210s dev-loop3.device                                     
 3.202s dev-loop4.device                                     
 2.878s gpu-manager.service                                  
 2.791s dev-loop1.device                                     
 2.524s lightdm.service                                      
 2.518s plymouth-quit-wait.service                           
 2.228s systemd-udevd.service                                
 1.815s networking.service                                   
 1.701s grub-common.service                                  
 1.496s systemd-resolved.service                             
 1.146s systemd-modules-load.service                         
  978ms dns-clean.service                                    
  933ms snapd.apparmor.service                               
  886ms systemd-backlight@backlight:intel_backlight.service  
  831ms alsa-restore.service                                 
  802ms e2scrub_reap.service                                 
  716ms systemd-sysusers.service                             
  715ms systemd-random-seed.service                          
  709ms systemd-sysctl.service                               
  689ms keyboard-setup.service                               
  632ms grub-initrd-fallback.service                         
  621ms apparmor.service                                     
  582ms systemd-fsck@dev-disk-by\x2duuid-5B02\x2dA7EF.service
  579ms rsyslog.service                                      
  517ms systemd-tmpfiles-setup-dev.service                   
  497ms snapd.seeded.service                                 
  467ms systemd-journald.service                             
  382ms systemd-udev-trigger.service                         
  378ms ifupdown-pre.service                                 
  372ms snap-hello\x2dworld-29.mount                         
  366ms lm-sensors.service                                   
  329ms swapfile.swap                                        
  325ms colord.service                                       
  325ms snap-core-11993.mount                                
  305ms pppd-dns.service                                     
  300ms snap-core18-2253.mount                               
  289ms upower.service                                       
  288ms snap-core18-2246.mount                               
  273ms virtualbox.service                                   
  268ms systemd-timesyncd.service                            
  266ms dev-hugepages.mount                                  
  265ms dev-mqueue.mount                                     
  264ms sys-kernel-debug.mount                               
  263ms sys-kernel-tracing.mount                             
  261ms blk-availability.service                             
  255ms ufw.service                                          
  233ms kmod-static-nodes.service                            
  232ms lvm2-monitor.service                                 
  218ms systemd-rfkill.service                               
  215ms snap-tmcbeans-5.mount                                
  198ms user@1000.service                                    
  181ms systemd-tmpfiles-setup.service                       
  178ms systemd-user-sessions.service                        
  173ms setvtrgb.service                                     
  127ms systemd-remount-fs.service                           
  123ms hddtemp.service                                      
  122ms systemd-update-utmp.service                          
  104ms boot-efi.mount                                       
   99ms kerneloops.service                                   
   81ms plymouth-read-write.service                          
   76ms rtkit-daemon.service                                 
   75ms console-setup.service                                
   49ms systemd-tmpfiles-clean.service                       
   15ms plymouth-start.service                               
   11ms user-runtime-dir@1000.service                        
    9ms systemd-update-utmp-runlevel.service                 
    5ms finalrd.service                                      
    3ms openvpn.service                                      
    3ms sys-fs-fuse-connections.mount                        
    3ms sys-kernel-config.mount                              
    1ms snapd.socket                                         

Code: Select all

$ 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 @39.090s
└─multi-user.target @39.090s
  └─virtualbox.service @38.816s +273ms
    └─network-online.target @38.808s
      └─NetworkManager-wait-online.service @27.005s +11.799s
        └─NetworkManager.service @19.071s +7.932s
          └─dbus.service @19.066s
            └─basic.target @18.938s
              └─sockets.target @18.938s
                └─snapd.socket @18.936s +1ms
                  └─sysinit.target @18.653s
                    └─systemd-timesyncd.service @18.384s +268ms
                      └─systemd-tmpfiles-setup.service @18.147s +181ms
                        └─systemd-journal-flush.service @3.578s +14.567s
                          └─systemd-journald.service @3.109s +467ms
                            └─systemd-journald.socket @3.102s
                              └─system.slice @3.098s
                                └─-.slice @3.098s

Code: Select all

$ inxi -Fxxxrz
System:
  Kernel: 5.4.0-91-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 
  Desktop: Cinnamon 5.0.7 wm: muffin 5.0.2 dm: LightDM 1.30.0 
  Distro: Linux Mint 20.2 Uma base: Ubuntu 20.04 focal 
Machine:
  Type: Laptop System: LENOVO product: 20AWA0AAJP v: ThinkPad T440p 
  serial: <filter> Chassis: type: 10 serial: <filter> 
  Mobo: LENOVO model: 20AWA0AAJP v: 0B98401 PRO serial: <filter> 
  UEFI [Legacy]: LENOVO v: GLET68WW (2.22 ) date: 03/24/2014 
Battery:
  ID-1: BAT0 charge: 40.3 Wh condition: 43.0/56.2 Wh (77%) volts: 12.2/10.8 
  model: LGC 45N1147 type: Li-ion serial: <filter> status: Charging 
CPU:
  Topology: Dual Core model: Intel Core i5-4300M bits: 64 type: MT MCP 
  arch: Haswell rev: 3 L2 cache: 3072 KiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx 
  bogomips: 20752 
  Speed: 798 MHz min/max: 800/3300 MHz Core speeds (MHz): 1: 798 2: 798 
  3: 798 4: 798 
Graphics:
  Device-1: Intel 4th Gen Core Processor Integrated Graphics 
  vendor: Lenovo ThinkPad T440p driver: i915 v: kernel bus ID: 00:02.0 
  chip ID: 8086:0416 
  Display: x11 server: X.Org 1.20.11 driver: modesetting 
  unloaded: fbdev,vesa resolution: 1366x768~60Hz 
  OpenGL: renderer: Mesa DRI Intel HD Graphics 4600 (HSW GT2) 
  v: 4.5 Mesa 21.0.3 compat-v: 3.0 direct render: Yes 
Audio:
  Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio 
  vendor: Lenovo ThinkPad T440p driver: snd_hda_intel v: kernel 
  bus ID: 00:03.0 chip ID: 8086:0c0c 
  Device-2: Intel 8 Series/C220 Series High Definition Audio 
  vendor: Lenovo ThinkPad T440p driver: snd_hda_intel v: kernel 
  bus ID: 00:1b.0 chip ID: 8086:8c20 
  Sound Server: ALSA v: k5.4.0-91-generic 
Network:
  Device-1: Intel Ethernet I217-LM vendor: Lenovo ThinkPad T440p 
  driver: e1000e v: 3.2.6-k port: 3080 bus ID: 00:19.0 chip ID: 8086:153a 
  IF: enp0s25 state: down mac: <filter> 
  Device-2: Intel Centrino Advanced-N 6235 driver: iwlwifi v: kernel 
  port: efa0 bus ID: 03:00.0 chip ID: 8086:088f 
  IF: wlp3s0 state: up mac: <filter> 
Drives:
  Local Storage: total: 465.76 GiB used: 139.78 GiB (30.0%) 
  ID-1: /dev/sda vendor: Toshiba model: MQ01ACF050 size: 465.76 GiB 
  speed: 6.0 Gb/s rotation: 7200 rpm serial: <filter> rev: 2E scheme: MBR 
Partition:
  ID-1: / size: 456.95 GiB used: 69.89 GiB (15.3%) fs: ext4 dev: /dev/sda5 
Sensors:
  System Temperatures: cpu: 47.0 C mobo: 0.0 C 
  Fan Speeds (RPM): cpu: 0 
Repos:
  No active apt repos in: /etc/apt/sources.list 
  Active apt repos in: /etc/apt/sources.list.d/kokoye2007-ppa-focal.list 
  1: deb http://ppa.launchpad.net/kokoye2007/ppa/ubuntu focal main
  Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list 
  1: deb http://packages.linuxmint.com uma main upstream import backport
  2: deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
  3: deb http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
  4: deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
  5: deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
  6: deb http://archive.canonical.com/ubuntu/ focal partner
  Active apt repos in: /etc/apt/sources.list.d/uget-team-ppa-focal.list 
  1: deb http://ppa.launchpad.net/uget-team/ppa/ubuntu focal main
Info:
  Processes: 205 Uptime: 1h 12m Memory: 7.47 GiB used: 1.34 GiB (17.9%) 
  Init: systemd v: 245 runlevel: 5 Compilers: gcc: 9.3.0 alt: 9 Shell: bash 
  v: 5.0.17 running in: gnome-terminal inxi: 3.0.38 
Acpi error:
Image
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
karlchen
Level 23
Level 23
Posts: 18173
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Long boot time and long wait time for the desktop to show after logging in.

Post by karlchen »

Hello, camy.

Let me be quite frank:
I look at your system information (inxi ouput). It tells me that your machine is roughly 7 years old and uses a spinning Sata disk.
Taking these 2 factors into account, your total startup time, as reported by systemd-analyze, looks like what I would expect.

In case you are prepared to spend money and time on improving your startup time, then replacing the spinning Sata disk by an SSD will very like reduce the startup time, specifically the time spent in "(userspace)", substantially. By how much precisely, I cannot foretell.

Regards,
Karl
--
P.S.: Below is the startup time running from an SSD in a 2.5 year old Dell notebook, running LM 19.3 Cinnamon

Code: Select all

:~$ systemd-analyze
Startup finished in 4.664s (kernel) + 18.708s (userspace) = 23.372s
graphical.target reached after 18.697s in userspace
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 762 days now.
Lifeline
camy
Level 1
Level 1
Posts: 2
Joined: Wed Dec 01, 2021 6:33 am

Re: Long boot time and long wait time for the desktop to show after logging in.

Post by camy »

karlchen wrote: Wed Dec 01, 2021 7:24 am Hello, camy.

Let me be quite frank:
I look at your system information (inxi ouput). It tells me that your machine is roughly 7 years old and uses a spinning Sata disk.
Taking these 2 factors into account, your total startup time, as reported by systemd-analyze, looks like what I would expect.

In case you are prepared to spend money and time on improving your startup time, then replacing the spinning Sata disk by an SSD will very like reduce the startup time, specifically the time spent in "(userspace)", substantially. By how much precisely, I cannot foretell.

Regards,
Karl
So you mean it depends on the hardware and for devices like mine it's normal?

Getting a SSD will help but I'm not willing to spend at the moment.
karlchen wrote: Wed Dec 01, 2021 7:24 am P.S.: Below is the startup time running from an SSD in a 2.5 year old Dell notebook, running LM 19.3 Cinnamon

Code: Select all

:~$ systemd-analyze
Startup finished in 4.664s (kernel) + 18.708s (userspace) = 23.372s
graphical.target reached after 18.697s in userspace
I wonder how my laptop got 15s with Windows.
User avatar
karlchen
Level 23
Level 23
Posts: 18173
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Long boot time and long wait time for the desktop to show after logging in.

Post by karlchen »

Hello, camy.

Windows 8 + 10, unless explicitly told otherwise, does not shut down fully, but by default goes into a hybrid sleeping mode only, when you click shutdown. As a consequence it starts up seemingly very fast, because it restores the hibernated system state from disk into memory.
Force it to shut down fully by switching off Fast Startup, then shut it down. Power it on again and start it up. The total startup time will not be 15 seconds only.

But of course, please, wait for other users to chime in. Their experience may be different from mine. So they may give different advice as well.
No need to follow the first piece of advice having been given.

Regards,
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 762 days now.
Lifeline
rene
Level 20
Level 20
Posts: 12240
Joined: Sun Mar 27, 2016 6:58 pm

Re: Long boot time and long wait time for the desktop to show after logging in.

Post by rene »

As to the ACPI thing; no, can be ignored and hasn't anything to do with things; viewtopic.php?p=2097269#p2097269

While I agree with karlchen that at the very least the main problem is spinning rust, 2m to login screen + 30s for desktop does seem a bit longish still --- although I've no comparable systems any more to say such with large confidence. Still; very likely not the/an issue at all, but do still try hitting Esc when the Mint logo is showing during startup to possibly see something timing out (a search for an in /etc/fstab mentioned but no longer existing swap partition is common).
t42
Level 11
Level 11
Posts: 3707
Joined: Mon Jan 20, 2014 6:48 pm

Re: Long boot time and long wait time for the desktop to show after logging in.

Post by t42 »

still about 11 seconds to spare

Code: Select all

sudo systemctl stop NetworkManager-wait-online.service ModemManager.service
sudo systemctl disable NetworkManager-wait-online.service ModemManager.service
-=t42=-
rene
Level 20
Level 20
Posts: 12240
Joined: Sun Mar 27, 2016 6:58 pm

Re: Long boot time and long wait time for the desktop to show after logging in.

Post by rene »

Disabling NetworkManager-wait-online.service is not good advise and in particular will not in fact gain anything real: those times you see listed by analyze-blame are not sequential; just denote how long the service took from init to completion. In the case of NM-wait-online this is to say that it took 11 seconds total for the network to be online but this is fully parallel with all other initialization tasks --- and although in most standard setups it's not in fact a problem to disable it either, it as said doesn't gain anything and does forego its actual task as a synchronization point if something were to want to synchronize to online state (winbind networking at some point needed to for example).

(ModemManager you may as well if you don 't need it for anything it seems, but otherwise the same as above...)
t42
Level 11
Level 11
Posts: 3707
Joined: Mon Jan 20, 2014 6:48 pm

Re: Long boot time and long wait time for the desktop to show after logging in.

Post by t42 »

rene wrote: Wed Dec 01, 2021 10:29 am Disabling NetworkManager-wait-online.service is not good advise and in particular will not in fact gain anything real
I can invent some use to wait-online of doing nothing service but not for the trivial desktop. Please note this 11 seconds are seen in critical-chain. I'm disabling this service starting from LM18.0 and always see some gain. Maybe not a good advice edification-wise but nothing bad happens if OP will try and (not) revert it back. As for ModemManager you are killing me: there are some state of art hardware under the spider web in my store and maybe we are the last people alive who know what it's for...
-=t42=-
rene
Level 20
Level 20
Posts: 12240
Joined: Sun Mar 27, 2016 6:58 pm

Re: Long boot time and long wait time for the desktop to show after logging in.

Post by rene »

t42 wrote: Wed Dec 01, 2021 12:18 pm Please note this 11 seconds are seen in critical-chain.
Yes, and please note that as said this is fully parallelised and doesn't mean anything onto itself; specifically does not add "11 seconds" to anything other than to the systemd-analyze output. Grab a physical stopwatch and time from, for example, hitting enter on a Grub prompt to, for example, hearing the desktop startup sound both with NetworkManager-wait-online.service enabled and with it disabled.

The service has a reason for existing, as said so as to function as a potential synchronization point for services that need the network online; Samba/Winbind is/was as also said an example of that and would not count as non-desktop applicable. I.e., best to just leave it alone.

ModemManager is by the way for mobile broadband, i.e., connectivity via phones and alike. As said, fine to disable if N/A but again not in fact a source of any non-trivial delay.
t42
Level 11
Level 11
Posts: 3707
Joined: Mon Jan 20, 2014 6:48 pm

Re: Long boot time and long wait time for the desktop to show after logging in.

Post by t42 »

rene wrote: Wed Dec 01, 2021 1:15 pm Grab a physical stopwatch and time from, for example, hitting enter on a Grub prompt to, for example, hearing the desktop startup sound both with NetworkManager-wait-online.service enabled and with it disabled.
@ rene: And so I did. Using script I made six measurements of real boot time with NetworkManager-wait-online.service enabled and disabled. Getting NetworkManager-wait-online.service @8.997s +6.834s boot time was longer for 1 sec each time. As you said.
-=t42=-
rene
Level 20
Level 20
Posts: 12240
Joined: Sun Mar 27, 2016 6:58 pm

Re: Long boot time and long wait time for the desktop to show after logging in.

Post by rene »

It's in fact even surprising that there was any consistently measurable difference --- but the mere fact that there was indicate something is in fact synchronizing to it (might as said be Samba related). In practice undoubtedly (and seemingly) not in fact an issue but in theory this would seem to say you with it disabled have likely a race-condition in your bootup (something which systemd boots are historically very good at having...). It's in any case then the reason I advise against disabling NetworkManager-wait-online.service: it either does nothing, or it does something potentially or actually detrimental.
User avatar
RollyShed
Level 8
Level 8
Posts: 2434
Joined: Sat Jan 12, 2019 8:58 pm
Location: South Island, New Zealand
Contact:

Re: Long boot time and long wait time for the desktop to show after logging in.

Post by RollyShed »

I've had 8 minutes for Windows 10 to boot up and about 26 seconds with Linux Mint Cinnamon on the same laptop. The main difference was $57NZ, ($25?US) spent on an SSD.

SSDs? Fitted about 20 so far and definitely the way to go. Depending on the computer, boot speeds have ranged from 22 seconds to 46 seconds. And yes, up to 10+ (note the +) year old laptops.
Locked

Return to “Installation & Boot”