1

Recently, my Ubuntu LTS 20.04 booting is crazy slow on Crucial MX500 1TB SSD. Here is the the output of systemd-analyze.

(base) hell@Dell-Precision-T1600:~$ systemd-analyze
Startup finished in 4.554s (kernel) + 1min 1.417s (userspace) = 1min 5.971s 
graphical.target reached after 1min 1.409s in userspace

I remember it used to take 20 seconds 2-3 months back. Now its taking 1 min 6 sec. My PC is an old workstation Dell Precision T1600.

I used systemd-analyze blame to see the breakdown of the individual component.

(base) hell@Dell-Precision-T1600:~$  systemd-analyze blame
30.065s NetworkManager-wait-online.service                   
22.825s plymouth-quit-wait.service                           
21.737s docker.service                                       
 4.352s dev-sda5.device                                      
 4.041s snapd.service                                        
 3.495s containerd.service                                   
 2.548s systemd-journal-flush.service                        
 2.337s networkd-dispatcher.service                          
 1.755s vboxdrv.service                                      
 1.746s udisks2.service                                      
 1.304s accounts-daemon.service                              
 1.103s NetworkManager.service                               
 1.087s polkit.service                                       
 1.083s avahi-daemon.service                                 
 1.033s switcheroo-control.service                           
 1.021s thermald.service                                     
 1.019s systemd-logind.service                               
 1.019s apache2.service                                      
 1.018s wpa_supplicant.service                               
 1.009s user@1000.service                                    
 1.007s teamviewerd.service                                  
  987ms ModemManager.service                                 
  862ms dev-loop8.device                                     
  841ms dev-loop3.device                                     
  822ms dev-loop1.device                                     
  814ms dev-loop2.device                                     
  803ms dev-loop9.device                                     
  792ms dev-loop6.device                                     
  791ms dev-loop4.device                                     
  791ms dev-loop5.device                                     
  788ms dev-loop7.device                                     
  766ms dev-loop10.device                                    
  742ms dev-loop0.device                                     
  649ms dev-loop11.device                                    
  647ms dev-loop12.device                                    
  626ms apparmor.service                                     
  529ms dev-loop13.device                                    
  503ms snap-snap\x2dstore-558.mount                         
  495ms systemd-udevd.service                                
  478ms dev-loop14.device                                    
  457ms systemd-resolved.service                             
  444ms snap-snapd-15314.mount                               
  437ms gpu-manager.service                                  
  412ms systemd-fsck@dev-disk-by\x2duuid-15F4\x2d3917.service
  378ms snap-gtk\x2dcommon\x2dthemes-1519.mount              
  372ms systemd-modules-load.service                         
  354ms systemd-tmpfiles-setup.service                       
  310ms snap-snapd-15177.mount                               
  291ms ua-timer.service                                     
  280ms snap-gtk\x2dcommon\x2dthemes-1515.mount              
  270ms rsyslog.service                                      
  239ms snapd.apparmor.service                               
  234ms colord.service                                       
  225ms snap-gnome\x2d3\x2d38\x2d2004-87.mount               
  180ms grub-initrd-fallback.service                         
  170ms snapd.seeded.service                                 
  168ms lvm2-lvmpolld.service                                
  165ms ssh.service                                          
  163ms snap-gnome\x2d3\x2d38\x2d2004-99.mount               
  160ms e2scrub_reap.service                                 
  160ms gdm.service                                          
  151ms upower.service                                       
  149ms grub-common.service                                  
  140ms snap-gnome\x2d3\x2d34\x2d1804-72.mount               
  129ms snap-core18-2344.mount                               
  112ms systemd-tmpfiles-setup-dev.service                   
  109ms snap-core20-1376.mount                               
  109ms systemd-udev-trigger.service                         
  100ms keyboard-setup.service                               
   97ms boot-efi.mount                                       
   91ms systemd-journald.service                             
   90ms snap-bare-5.mount                                    
   88ms systemd-timesyncd.service                            
   85ms systemd-sysctl.service                               
   85ms snap-gnome\x2d3\x2d34\x2d1804-77.mount               
   83ms lm-sensors.service                                   
   83ms systemd-sysusers.service                             
   82ms systemd-random-seed.service                          
   82ms snap-core18-2284.mount                               
   71ms snap-core20-1405.mount                               
   67ms snap-snap\x2dstore-547.mount                         
   62ms plymouth-start.service                               
   60ms home-hell-Desktop-Old\x20HDD.mount                   
   58ms setvtrgb.service                                     
   46ms user-runtime-dir@1000.service                        
   44ms swapfile.swap                                        
   36ms kerneloops.service                                   
   33ms modprobe@drm.service                                 
   32ms console-setup.service                                
   31ms systemd-remount-fs.service                           
   27ms pppd-dns.service                                     
   23ms dev-hugepages.mount                                  
   22ms dev-mqueue.mount                                     
   22ms sys-kernel-debug.mount                               
   21ms systemd-update-utmp.service                          
   21ms sys-kernel-tracing.mount                             
   20ms rtkit-daemon.service                                 
   19ms plymouth-read-write.service                          
   18ms systemd-user-sessions.service                        
   17ms apport.service                                       
   16ms ufw.service                                          
   15ms kmod-static-nodes.service                            
   15ms systemd-tmpfiles-clean.service                       
   13ms openvpn.service                                      
   11ms vboxweb-service.service                              
    7ms alsa-restore.service                                 
    6ms vboxautostart-service.service                        
    6ms systemd-update-utmp-runlevel.service                 
    4ms vboxballoonctrl-service.service                      
    3ms sys-fs-fuse-connections.mount                        
    3ms sys-kernel-config.mount                              
    2ms docker.socket                                        
    1ms snapd.socket                                         

I don't know if I could somehow stop NetworkManager, plymouth, docker.service and save time. Can I stop snapd, teamviewer, vboxdrv as I hardly use them.

Does any one has any recommendation for me? Also, I use portmaster to inspect the incoming connections. But it has no option to disable the automatic startup.

I am adding the details of systemd-analyze critical-chain.

(base) hell@Dell-Precision-T1600:~$ 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 @1min 1.409s
└─multi-user.target @1min 1.409s
  └─teamviewerd.service @39.682s +1.007s
    └─network-online.target @39.670s
      └─network.target @9.602s
        └─NetworkManager.service @8.498s +1.103s
          └─dbus.service @8.495s
            └─basic.target @8.470s
              └─sockets.target @8.470s
                └─snapd.socket @8.468s +1ms
                  └─sysinit.target @8.423s
                    └─snapd.apparmor.service @8.183s +239ms
                      └─apparmor.service @7.555s +626ms
                        └─local-fs.target @7.553s
                          └─run-snapd-ns-snap\x2dstore.mnt.mount @33.393s
                            └─run-snapd-ns.mount @32.709s
                              └─local-fs-pre.target @2.876s
                                └─systemd-tmpfiles-setup-dev.service @2.763s +1>
                                  └─systemd-sysusers.service @2.679s +83ms
                                    └─systemd-remount-fs.service @2.636s +31ms
                                      └─systemd-journald.socket @2.614s
                                        └─-.mount @2.611s
                                          └─system.slice @2.611s
                                            └─-.slice @2.611s

Ok, after stopping NetworkManager-wait-online.service from this post halved the boot time.

(base) hell@Dell-Precision-T1600:~$ systemd-analyze
Startup finished in 2.876s (kernel) + 34.174s (userspace) = 37.050s 
graphical.target reached after 34.142s in userspace

Can I disable the plymouth-quit-wait.service similarly?

Prakhar Sharma
  • 159
  • 1
  • 13
  • 2
    `30.065s NetworkManager-wait-online.service` is not delaying your boot. That task simply tells you how long it's taking the network to come up. Some tasks must wait for the network to be up before they can start. – user535733 Apr 13 '22 at 16:31
  • 1
    `22.825s plymouth-quit-wait.service` is not delaying your boot. That task simply tells you how long it takes to complete all pre-login startup activity. Some tasks must wait until that target is reached before they can start. – user535733 Apr 13 '22 at 16:33
  • 1
    `21.737s docker.service` IS delaying your boot. Try `systemctl disable docker.service` to prevent it starting at boot. – user535733 Apr 13 '22 at 16:35
  • 1
    `systemd-analyze critical-chain` might be more helpful in confirming what the critical path is and how long those critical tasks are taking – PonJar Apr 13 '22 at 16:38
  • 1
    Useful info about `plymouth-quit-wait.service`: [Slow boot issue due to plymouth-quit-wait.service + ubuntu 18.04](https://askubuntu.com/a/1168249) – Raffa Apr 13 '22 at 17:51
  • I have added the details of `systemd-analyze critical-chain` – Prakhar Sharma Apr 13 '22 at 18:50
  • 1
    disable that teamviewer stuff and try again. Before replacing that with anydesk I've painstakingly made sure the teamviewer service is not running after use.. – kanehekili Apr 13 '22 at 19:20

0 Answers0