Score:2

Long startup time in Ubuntu 20.04

kr flag

I have Windows10 and Ubuntu on a SSD. Today the startup time was higher than normal, but I don't understand enough of Ubuntu to solve this problem.

Output of command: systemd-analyze

Startup finished in 5.054s (kernel) + 4min 17.984s (userspace) = 4min 23.038s 
graphical.target reached after 3min 3.859s in userspace

Output of command: systemd-analyze blame

3min 47.148s fstrim.service                                       
2min 17.095s plymouth-quit-wait.service                           
     36.871s snapd.service                                        
     32.701s networkd-dispatcher.service                          
     27.646s udisks2.service                                      
     20.448s dev-sda6.device                                      
     18.779s accounts-daemon.service                              
     18.752s systemd-journal-flush.service                        
     17.599s NetworkManager-wait-online.service                   
     15.899s NetworkManager.service                               
     14.648s ModemManager.service                                 
     14.055s polkit.service                                       
     13.977s avahi-daemon.service                                 
     13.975s bluetooth.service                                    
     13.224s switcheroo-control.service                           
     13.217s thermald.service                                     
     12.963s systemd-logind.service                               
     12.961s wpa_supplicant.service                               
     10.591s dev-loop5.device                                     
     10.589s dev-loop2.device                                     
     10.588s dev-loop7.device                                     
     10.585s dev-loop3.device                                     
     10.583s dev-loop9.device                                     
     10.486s dev-loop11.device                                    
     10.243s dev-loop14.device                                    
     10.211s dev-loop13.device                                    
     10.162s dev-loop10.device                                    
      9.154s dev-loop15.device                                    
      8.773s dev-loop8.device                                     
      8.590s dev-loop0.device                                     
      8.145s dev-loop12.device                                    
      7.367s dev-loop4.device                                     
      7.174s dev-loop6.device                                     
      6.109s [email protected]                                     
      6.076s dev-loop1.device                                     
      5.027s apport.service                                       
      4.302s gpu-manager.service                                  
      4.257s rsyslog.service                                      
      4.203s colord.service                                       
      4.196s systemd-udevd.service                                
      4.174s secureboot-db.service                                
      3.630s gdm.service                                          
      2.586s e2scrub_reap.service                                 
      2.561s systemd-sysctl.service                               
      2.390s systemd-resolved.service                             
      2.255s systemd-rfkill.service                               
      2.214s grub-common.service                                  
      1.863s fwupd.service                                        
      1.812s systemd-random-seed.service                          
      1.762s snap-bare-5.mount                                    
      1.757s upower.service                                       
      1.694s snap-core-12725.mount                                
      1.564s apparmor.service                                     
      1.507s snap-core18-2128.mount                               
      1.491s systemd-tmpfiles-setup.service                       
      1.474s systemd-modules-load.service                         
      1.445s snapd.seeded.service                                 
      1.351s snap-core18-2284.mount                               
      1.279s pppd-dns.service                                     
      1.231s systemd-tmpfiles-setup-dev.service                   
      1.214s grub-initrd-fallback.service                         
      1.196s snap-core20-1328.mount                               
      1.176s snapd.apparmor.service                               
      1.121s snap-core20-1361.mount                               
       886ms snap-discord-132.mount

Edit:
Output of command: sudo smartctl -a /dev/sda

ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       0
  3 Spin_Up_Time            0x0027   193   192   021    Pre-fail  Always       -       1333
  4 Start_Stop_Count        0x0032   029   029   000    Old_age   Always       -       71408
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   090   090   000    Old_age   Always       -       7338
 10 Spin_Retry_Count        0x0032   100   100   000    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   100   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   099   099   000    Old_age   Always       -       1933
191 G-Sense_Error_Rate      0x0032   001   001   000    Old_age   Always       -       99500
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       92
193 Load_Cycle_Count        0x0032   141   141   000    Old_age   Always       -       178416
194 Temperature_Celsius     0x0022   103   093   000    Old_age   Always       -       40
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   100   253   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       1
200 Multi_Zone_Error_Rate   0x0008   100   253   000    Old_age   Offline      -       0

Googling it looks like the most important part of the ouput are those with id 5 and 197, which maybe indicate future ssd failure, is it correct? Should i buy new ssd? Is the ssd causing the high startup time?

oldfred avatar
cn flag
Some things to review: https://askubuntu.com/questions/1284302/is-it-possible-to-make-ubuntu-20-04-boot-faster But fstrim taking a long time may indicate SSD issue? What does SmartStatus show of SSD? https://help.ubuntu.com/community/Smartmontools In Disks is Smart Data: https://askubuntu.com/questions/983619/s-m-a-r-t-data-no-longer-available-in-ubuntu-16-04-disks-application
user535733 avatar
cn flag
I see three coincidental items: 1) sda6 took an unusually long time to mount, 2) snapd happened to check for updates, and 3) Your network hardware took an unusually long time to become available, so you network was slow to come up. Individual boot times can vary for many reasons -- look for patterns across many different boots.
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.