2

The boot time for my Desktop PC is more than 4 minutes. I would love to know what processes and services should be terminated in order to fix this issue.

I have already tried fixing up startup applications, but since, the issue is boot time, it does not help in any manner.

System Details:

OS: Ubuntu 20.04 LTS, upgraded from 19.10
Processor: Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz,
RAM: 8GB DDR4
GPU: Nvidia GeForce 940MX
Hard Drive: 1TB, Seagate

Output from systemd-analyze blame:

anubhav@anubhav-ubuntu:~$ sudo systemd-analyze blame
[sudo] password for anubhav: 
46.599s plymouth-quit-wait.service                           
17.140s snapd.service                                        
16.674s networkd-dispatcher.service                          
16.645s dev-sda2.device                                      
16.136s NetworkManager-wait-online.service                   
15.605s udisks2.service                                      
12.050s systemd-journal-flush.service                        
11.381s dev-loop10.device                                    
11.374s dev-loop4.device                                     
11.317s accounts-daemon.service                              
10.951s dev-loop15.device                                    
10.908s user@124.service                                     
10.419s dev-loop17.device                                    
10.371s dev-loop19.device                                    
10.363s dev-loop16.device                                    
10.315s dev-loop14.device                                    
10.260s dev-loop18.device                                    
 9.566s dev-loop11.device                                    
 9.499s dev-loop3.device                                     
 9.197s dev-loop1.device                                     
 9.162s NetworkManager.service                               
 9.086s polkit.service                                       
 8.961s dev-loop5.device                                     
 8.906s dev-loop12.device                                    
 8.871s dev-loop8.device                                     
 8.676s dev-loop7.device                                     
 8.561s dev-loop13.device                                    
 8.472s avahi-daemon.service                                 
 8.459s bluetooth.service                                    
 8.446s dev-loop2.device                                     
 8.317s switcheroo-control.service                           
 8.309s thermald.service                                     
 8.291s systemd-logind.service                               
 8.287s wpa_supplicant.service                               
 7.903s dev-loop0.device                                     
 7.448s dev-loop6.device                                     
 6.816s gpu-manager.service                                  
 6.658s dev-loop9.device                                     
 6.284s preload.service                                      
 6.121s vboxdrv.service                                      
 5.464s grub-common.service                                  
 5.174s apport.service                                       
 5.115s apport-autoreport.service                            
 5.099s ModemManager.service                                 
 4.516s dhcpcd.service                                       
 4.478s systemd-resolved.service                             
 4.475s secureboot-db.service                                
 4.457s grub-initrd-fallback.service                         
 4.293s systemd-udevd.service                                
 4.123s rsyslog.service                                      
 3.654s systemd-tmpfiles-setup.service                       
 3.351s lpd.service                                          
 2.666s gdm.service                                          
 1.954s apparmor.service                                     
 1.821s tlp.service                                          
 1.723s e2scrub_reap.service                                 
 1.522s snap-core-8689.mount                                 
 1.488s nvidia-persistenced.service                          
 1.449s systemd-modules-load.service                         
 1.440s snap-core18-1754.mount                               
 1.424s snap-pycharm\x2dprofessional-196.mount               
 1.409s snap-core18-1705.mount                               
 1.379s systemd-backlight@backlight:intel_backlight.service  
 1.338s upower.service                                       
 1.266s snap-gtk\x2dcommon\x2dthemes-1440.mount              
 1.150s plymouth-start.service                               
 1.148s systemd-random-seed.service                          
 1.064s systemd-sysctl.service                               
 1.023s systemd-tmpfiles-setup-dev.service                   
 1.012s snap-clion-111.mount                                 
  967ms systemd-journald.service                             
  965ms kerneloops.service                                   
  957ms modprobe@drm.service                                 
  950ms snap-vlc-1397.mount                                  
  939ms snapd.seeded.service                                 
  907ms snapd.apparmor.service                               
  872ms swapfile.swap                                        
  827ms systemd-timesyncd.service                            
  755ms snap-gtk\x2dcommon\x2dthemes-1506.mount              
  748ms snap-scrcpy-211.mount                                
  733ms binfmt-support.service                               
  702ms snap-scrcpy-217.mount                                
  645ms snap-goland-87.mount                                 
  624ms snap-vlc-1620.mount                                  
  561ms colord.service                                       
  470ms systemd-remount-fs.service                           
  420ms openvpn.service                                      
  392ms systemd-sysusers.service                             
  388ms setvtrgb.service                                     
  354ms systemd-user-sessions.service                        
  348ms vboxautostart-service.service                        
  348ms vboxballoonctrl-service.service                      
  327ms keyboard-setup.service                               
  321ms kmod-static-nodes.service                            
  321ms snap-goland-86.mount                                 
  316ms snap-pycharm\x2dprofessional-198.mount               
  310ms vboxweb-service.service                              
  305ms snap-clion-112.mount                                 
  250ms systemd-udev-trigger.service                         
  244ms snap-spotify-41.mount                                
  240ms snap-gnome\x2d3\x2d34\x2d1804-33.mount               
  229ms user@1000.service                                    
  224ms systemd-fsck@dev-disk-by\x2duuid-94AE\x2dCADC.service
  218ms systemd-tmpfiles-clean.service                       
  217ms snap-gnome\x2d3\x2d34\x2d1804-27.mount               
  216ms console-setup.service                                
  182ms snap-snap\x2dstore-433.mount                         
  177ms dev-hugepages.mount                                  
  177ms dev-mqueue.mount                                     
  176ms sys-kernel-debug.mount                               
  175ms sys-kernel-tracing.mount                             
  160ms snap-core-9066.mount                                 
  140ms pppd-dns.service                                     
   88ms user-runtime-dir@124.service                         
   80ms user-runtime-dir@1000.service                        
   79ms ufw.service                                          
   76ms systemd-update-utmp.service                          
   64ms boot-efi.mount                                       
   52ms proc-sys-fs-binfmt_misc.mount                        
   16ms rtkit-daemon.service                                 
   14ms alsa-restore.service                                 
   13ms systemd-update-utmp-runlevel.service                 
   12ms plymouth-read-write.service                          
    3ms sys-kernel-config.mount                              
    2ms sys-fs-fuse-connections.mount                        
  697us snapd.socket 

Output from systemd-analyze critical-chain graphical.target

anubhav@anubhav-ubuntu:~$ systemd-analyze critical-chain graphical.target
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 20.194s
└─multi-user.target @1min 20.194s
  └─kerneloops.service @51.394s +1.526s
    └─network-online.target @50.933s
      └─NetworkManager-wait-online.service @34.497s +16.433s
        └─NetworkManager.service @25.721s +8.774s
          └─dbus.service @25.718s
            └─basic.target @25.672s
              └─sockets.target @25.672s
                └─snapd.socket @25.671s +1ms
                  └─sysinit.target @25.368s
                    └─systemd-timesyncd.service @57.447s +310ms
                      └─systemd-tmpfiles-setup.service @22.090s +2.127s
                        └─local-fs.target @22.081s
                          └─run-user-124-gvfs.mount @59.648s
                            └─run-user-124.mount @44.537s
                              └─local-fs-pre.target @7.154s
                                └─systemd-tmpfiles-setup-dev.service @6.129s +1.024s
                                  └─systemd-sysusers.service @5.757s +371ms
                                    └─systemd-remount-fs.service @5.594s +115ms
                                      └─systemd-journald.socket @5.125s
                                        └─system.slice @5.057s
                                          └─-.slice @5.057s
  • Do you use any snap apps? If you don't need snap you could disable it. Or if it is just for testing if your boot process finishes faster. And you should try sudo apt-get install haveged. – starkus May 19 '20 at 14:09
  • Oh, I just saw you are using some snap apps... – starkus May 19 '20 at 14:16
  • Apart from VLC, which is used regularly, I have PyCharm and GoLand installed from Snap Store. @Sta – Anubhav Sachan May 19 '20 at 14:18
  • Yeah, just saw it. Did you give the haveged package a try? It gives some more entropy to your system. If you want to make sure that you need it before installing you could move your mouse while booting, because that also creates entropy. – starkus May 19 '20 at 14:23
  • I prefer .deb over snaps where possible. https://askubuntu.com/questions/1187117/slow-boot-boot-19-10-tried-almost-everything & https://askubuntu.com/questions/1018576/what-does-networkmanager-wait-online-service-do & https://askubuntu.com/questions/800479/ubuntu-16-04-slow-boot-apt-daily-service – oldfred May 19 '20 at 14:24
  • @oldfred, I'm using .deb apps primarily, apart from above three mentioned apps. – Anubhav Sachan May 19 '20 at 14:25
  • @starkus, On using cat /proc/sys/kernel/random/entropy_avail, I available entropy = 3936. And this is not a server. It's a laptop PC. Do I still need haveged? – Anubhav Sachan May 19 '20 at 14:28
  • 1
    Looks, like that should be enough. I'd just give it a try... Maybe it's the time needed generating that amount of entropy. – starkus May 19 '20 at 14:29
  • @starkus, I tried. But it did not bring much change. Still taking almost same amount of time. – Anubhav Sachan May 19 '20 at 14:44
  • 1
    What does systemd-analyze critical-chain graphical.target tell you? – starkus May 19 '20 at 14:45
  • I have edited the question. Please have a look, @starkus. Added output of systemd-analyze critical-chain graphical.target. – Anubhav Sachan May 19 '20 at 14:47
  • 1
    Maybe this thread could help --> https://askubuntu.com/a/1018731/1037709 I once read something about there's a possibility setting a delay to starting that service for that it will be started right after booting your system. Someone else wrote about editing some networking setup file... I remember some options with allow hotplug and/or the new predictable names. – starkus May 19 '20 at 14:55
  • Yeah. Boot time reduce by around 20-25 secs. But still, it's taking more than 3:30 minutes. – Anubhav Sachan May 19 '20 at 15:17
  • 1
    Did you try to remove the splash option from grub? Just like when hitting e while grub appears and moving the cursor down to the splash entry, deleting it (temporarily) and hitting F10 for booting up? – starkus May 19 '20 at 15:23
  • How do I do that? – Anubhav Sachan May 19 '20 at 15:28
  • 1
    And/or you could give the noplymouth option a try, instead of quiet and splash. Just hit e while the grub boot menu appears and search for GRUB_CMDLINE_LINUX_DEFAULT= if there's an entry for splash, just remove it and/or try the noplymouth option instead. You may boot up hitting F10. This is just temporarily to test your boot settings... – starkus May 19 '20 at 15:32
  • @starkus - perhaps, a suggestion, convert all your comments and statements into an answer; you're going logically through steps to resolve the issue - so make it a detailed answer we can all enjoy! :) – DankyNanky May 19 '20 at 16:28
  • @starkus, noplymouth option kinda worked (Link:https://robbinespu.github.io/eng/2018/09/04/Disable_plymouth_and_boot_faster.html). It helped me reduce more 30 secs, thereby reducing it to 3:05 minutes. Though it produced an error of not finding a fonts file, 'unicode.pf2', but that can be solved through Answer 15 of this thread: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=630998. – Anubhav Sachan May 19 '20 at 20:18
  • As suggested by @DankyNanky, starkus could you please add these details to your answer, so that I could mark it as accepted and have a discussion to reduce the time more. – Anubhav Sachan May 19 '20 at 20:21

0 Answers0