Score:1

Boot process is very slow in Ubuntu 20.04

lb flag

I have upgraded my Ubuntu 16.04 to 20.04, but unfortunately the boot process is very slow.

First of all, I would like to share some output on the basis of some old questions

  • General system info

    • product: Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
    • RAM: 16 gb
    • I am using dual boot
  • I have found this question and used systemd-analyze blame command and found that mysql was taking so much time. I can remember that during the upgrade 16.04 > 18.04 > 20.04, in the second stage 18.04 > 20.04 package upgrading was causing a problem regarding mysql. Unfortunately, I have not stored the result of systemd-analyze blame. Later, I have disabled turning on mysql service during boot process using the following command

    sudo systemctl disable mysql
    
  • After this, my system has taken around 1 minute 20 to 30 second to boot

  • But then it has taken again more near about 2 minute 30 second to boot. Here, I am giving the output of systemd-analyze blame

1min 27.943s apt-daily-upgrade.service                                                
 1min 9.000s man-db.service                                                           
     42.406s plymouth-quit-wait.service                                               
     39.339s docker.service                                                           
     26.615s systemd-journal-flush.service                                            
     26.369s udisks2.service                                                          
     24.319s logrotate.service                                                        
     23.836s networkd-dispatcher.service                                              
     23.460s [email protected]                                               
     22.489s snapd.service                                                            
     21.801s [email protected]                                               
     20.363s [email protected]                                              
     20.210s accounts-daemon.service                                                  
     18.149s NetworkManager-wait-online.service                                       
     18.039s ifupdown-pre.service                                                     
     16.588s polkit.service                                                           
     15.185s dev-sda10.device                                                         
     14.936s avahi-daemon.service                                                     
     14.934s bluetooth.service                                                        
     14.877s NetworkManager.service                                                   
     14.363s switcheroo-control.service                                               
     14.352s wpa_supplicant.service                                                   
     14.292s thermald.service                                                         
     14.290s systemd-logind.service                                                   
     10.461s teamviewerd.service                                                      
      7.903s dev-loop3.device                                                         
      7.799s dev-loop6.device                                                         
      7.717s dev-loop10.device                                                        
      7.657s dev-loop11.device                                                        
      7.343s dev-loop12.device                                                        
      7.324s dev-loop7.device                                                         
      7.304s dev-loop13.device                                                        
      6.389s dev-loop4.device                                                         
      6.280s ModemManager.service                                                     
      6.217s dev-loop2.device                                                         
      5.985s dev-loop8.device                                                         
      5.659s dev-loop5.device                                                         
      5.618s dev-loop9.device                                                         
      5.512s dev-loop0.device                                                         
      5.123s dev-loop1.device                                                         
      4.993s xrdp.service                                                             
      4.720s gpu-manager.service                                                      
      4.377s ssh.service                                                              
      3.217s chrome-remote-desktop.service                                            
      3.151s upower.service                                                           
      3.048s apport.service                                                           
      2.940s colord.service                                                           
      2.848s systemd-udevd.service                                                    
      2.818s systemd-fsck@dev-disk-by\x2duuid-D48A\x2d7986.service                    
      2.643s rsyslog.service                                                          
      2.195s apparmor.service                                                         
      2.158s xrdp-sesman.service                                                      
      1.698s rc.local.service                                                         
      1.651s systemd-tmpfiles-setup.service                                           
      1.490s lm-sensors.service                                                       
      1.478s resolvconf-pull-resolved.service                                         
      1.467s containerd.service                                                       
      1.438s systemd-resolved.service                                                 
      1.437s gdm.service                                                              
      1.398s plymouth-start.service                                                   
      1.375s systemd-random-seed.service                                              
      1.354s snapd.seeded.service                                                     
      1.242s systemd-tmpfiles-setup-dev.service                                       
      1.099s systemd-modules-load.service                                             
      1.060s snap-heroku-4078.mount                                                   
      1.051s sysstat.service                                                          
      1.039s systemd-backlight@backlight:intel_backlight.service                      
      1.033s snap-core-11993.mount                                                    
      1.006s tlp.service                                                              
       969ms snap-pycharm\x2dcommunity-265.mount                                      
       941ms networking.service                                                       
       924ms binfmt-support.service                                                   
       851ms snap-core18-2253.mount                                                   
       796ms snapd.apparmor.service                                                   
       725ms snap-htop-3335.mount                                                     
       702ms snap-core-12603.mount                                                    
       674ms snap-core20-1270.mount                                                   
       658ms systemd-sysctl.service                                                   
       638ms e2scrub_reap.service                                                     
       553ms snap-core18-2284.mount                                                   
       549ms systemd-sysusers.service                                                 
       535ms snap-mathpix\x2dsnipping\x2dtool-192.mount                               
       524ms [email protected]                                                     
       512ms snap-heroku-4076.mount                                                   
       486ms systemd-udev-trigger.service                                             
       478ms snap-mathpix\x2dsnipping\x2dtool-195.mount                               
       455ms snap-core20-1242.mount                                                   
       420ms snap-pycharm\x2dcommunity-261.mount                                      
       391ms systemd-timesyncd.service                                                
       371ms systemd-journald.service                                                 
       356ms snap-htop-3354.mount                                                     
       351ms dev-disk-by\x2duuid-dce0a160\x2d2ad8\x2d4826\x2d8ee8\x2d39c86b0a72da.swap
       315ms dns-clean.service                                                        
       312ms keyboard-setup.service                                                   
       307ms kerneloops.service                                                       
       249ms plymouth-read-write.service                                              
       227ms alsa-restore.service                                                     
       220ms [email protected]                                                        
       212ms ufw.service                                                              
       199ms openvpn.service                                                          
       173ms dev-hugepages.mount                                                      
       172ms dev-mqueue.mount                                                         
       171ms kmod-static-nodes.service                                                
       171ms sys-kernel-debug.mount                                                   
       170ms systemd-remount-fs.service                                               
       170ms sys-kernel-tracing.mount                                                 
       156ms grub-initrd-fallback.service                                             
       129ms hddtemp.service                                                          
       113ms finalrd.service                                                          
       111ms grub-common.service                                                      
       104ms console-setup.service                                                    
       100ms pppd-dns.service                                                         
        81ms boot-efi.mount                                                           
        62ms systemd-update-utmp.service                                              
        52ms rc-local.service                                                         
        43ms motd-news.service                                                        
        43ms systemd-user-sessions.service                                            
        24ms rtkit-daemon.service                                                     
        22ms [email protected]                                            
        21ms setvtrgb.service                                                         
        17ms systemd-update-utmp-runlevel.service                                     
        16ms systemd-tmpfiles-clean.service                                           
        12ms proc-sys-fs-binfmt_misc.mount                                            
        10ms ureadahead-stop.service                                                  
         3ms sys-fs-fuse-connections.mount                                            
         3ms postgresql.service                                                       
         2ms sys-kernel-config.mount                                                  
         2ms docker.socket                                                            
         1ms snapd.socket                                                             
  • From the output it is seen that
    1min 27.943s apt-daily-upgrade.service                                                
    1min 9.000s man-db.service
    
    they are taking so much time. But, these were not present after disabling the mysql service. Is there any permanent solution to block all weird stuff to speed up the boot process? Besides, I would not like to do a fresh installation.
user10634362 avatar
lb flag
No, it is not the first boot. And yes, the `shutdown` time is also long. I am doing what you have told and giving the update.
user10634362 avatar
lb flag
@user535733 , I have done repeatedly 4 times turn on & off. Every time shutdown has taken ~15 seconds. Boot has taken ~2 minute. `systemd-analyze blame` has not also shown any long time behaviour by any service. Recent result is `36.946s systemd-journal-flush.service 19.260s ifupdown-pre.service 18.907s plymouth-quit-wait.service 15.226s docker.service `. Is this boot time normal?
pasman pasmański avatar
mx flag
Check if Ubuntu installation image boots faster. If yes, then you installed too much software. If no, then probably your disk has end of life.
user535733 avatar
cn flag
It's better to add new information to your Question above, especially if it needs to be formatted. It's unclear what patterns you are seeing, so add that to your Question too. You've done a lot of troubleshooting work, so I'm sure you will get results from it!
oldfred avatar
cn flag
Some things to check & links to even more. https://askubuntu.com/questions/1284302/is-it-possible-to-make-ubuntu-20-04-boot-faster Are you also running postgresql? Is this a server version? Often better to do a clean install & restore from backups. That way everything is correct and lots of old cruft is housecleaned out.
user10634362 avatar
lb flag
@user535733 Sorry to say that I have not understood what is meant by you with `It's unclear what patterns you are seeing`. if you make it more clear I can edit my question or add some output with the required info by you.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.