Speed up boot time

Hello, I noticed slow boot time on my system. I have SSD Plextor 128 GB M.2 2280 SATA III (PX-128S3G) and find it very slow comparing to old SSD 2,5’’ I have on another laptop. My main laptop is Dell Inspiron 7577, 16 GB RAM. I use Ubuntu and Elementary OS before and system boot was even slower. I don’t now is that SSD is so slow or the reason is I have also second disc HDD for /home?
I want to speed up my boot time and remove some unnecessary services. Can somebody tell me what services I can disable?

[mariank@marian-dell /]$ systemd-analyze 
Startup finished in 2.094s (kernel) + 18.924s (userspace) = 21.019s 
graphical.target reached after 10.980s in userspace
[mariank@marian-dell /]$ systemd-analyze blame 
16.143s updatedb.service                                                                         
 7.992s systemd-networkd-wait-online.service                                                     
 6.773s NetworkManager-wait-online.service                                                       
 3.967s optimus-manager.service                                                                  
 3.168s man-db.service                                                                           
 1.802s fwupd.service                                                                            
 1.747s systemd-random-seed.service                                                              
 1.274s mnt-nas.mount                                                                            
 1.167s lvm2-monitor.service                                                                     
  925ms systemd-logind.service                                                                   
  924ms dev-sda1.device                                                                          
  834ms bolt.service                                                                             
  453ms systemd-timesyncd.service                                                                
  450ms upower.service                                                                           
  432ms systemd-udevd.service                                                                    
  411ms systemd-fsck@dev-disk-by\x2duuid-8abbf0a2\x2d8775\x2d4989\x2d9a9a\x2d035e2ca5b0c4.service
  403ms systemd-fsck@dev-disk-by\x2duuid-cdb90aaa\x2d617a\x2d4cba\x2d83ef\x2df35f6a8473fe.service
  317ms avahi-daemon.service                                                                     
  315ms NetworkManager.service                                                                   
  299ms systemd-networkd.service                                                                 
  292ms systemd-journald.service                                                                 
  213ms tlp.service                                                                              
  208ms ldconfig.service                                                                         
  167ms systemd-journal-flush.service                                                            
  143ms udisks2.service                                                                          
  138ms org.cups.cupsd.service                                                                   
  119ms systemd-tmpfiles-clean.service                                                           
  115ms systemd-backlight@backlight:intel_backlight.service                                      
  111ms systemd-backlight@leds:dell::kbd_backlight.service                                       
  101ms accounts-daemon.service                                                                  
   91ms user@120.service                                                                         
   84ms systemd-journal-catalog-update.service                                                   
   83ms polkit.service                                                                           
   79ms logrotate.service                                                                        
   71ms systemd-udev-trigger.service                                                             
   68ms user@1000.service                                                                        
   52ms systemd-tmpfiles-setup.service                                                           
   40ms modprobe@drm.service                                                                     
   39ms home.mount                                                                               
   38ms systemd-sysusers.service                                                                 
   37ms systemd-modules-load.service                                                             
   31ms systemd-binfmt.service                                                                   
   26ms systemd-rfkill.service                                                                   
   20ms colord.service                                                                           
   18ms wpa_supplicant.service                                                                   
   16ms dev-hugepages.mount                                                                      
   16ms dev-mqueue.mount                                                                         
   15ms sys-kernel-debug.mount                                                                   
   15ms gdm.service                                                                              
   14ms sys-kernel-tracing.mount                                                                 
   14ms systemd-tmpfiles-setup-dev.service                                                       
   14ms kmod-static-nodes.service                                                                
   12ms systemd-user-sessions.service                                                            
   11ms systemd-sysctl.service                                                                   
   11ms systemd-update-utmp.service                                                              
    8ms user-runtime-dir@1000.service                                                            
    8ms user-runtime-dir@120.service                                                             
    7ms systemd-remount-fs.service                                                               
    5ms tmp.mount                                                                                
    5ms boot.mount                                                                               
    5ms proc-sys-fs-binfmt_misc.mount                                                            
    5ms systemd-update-done.service                                                              
    4ms rtkit-daemon.service                                                                     
    4ms sys-fs-fuse-connections.mount                                                            
    2ms sys-kernel-config.mount                      

What happen if you mask the service ?

~$ sudo systemctl mask systemd-networkd-wait-online

Wait for @ricklinux he is the better one for masking

1 Like

Thanks, nothing happen, my network works fine :slight_smile: Can I mask also NetworkManager-wait-online.service?

I have also problem with mounting my home shares. I’m in work now with my laptop and system try to mount my home nfs shares. I have error on boot: FAILED mount nfs mnt-nas.mount and when I shutdown my laptop I see FAILED unmount /home and /tmp.

You can also mask to → sudo systemctl mask NetworkManager-wait-online.service

Since you have NetworkManager enabled, the former is not necessary.

3 Likes

Thanks. Can I mask any other services? Can I make something with my nfs share. For example to auto mount only on weekends when I bring my laptop home?

It has already lowered the boot time by more than 13 seconds, so its boot remains at normal values.

Resumen

$ systemd-analyze && systemd-analyze blame
Startup finished in 4.482s (kernel) + 3.546s (userspace) = 8.029s
graphical.target reached after 2.882s in userspace
1.583s systemd-random-seed.service
1.055s systemd-logind.service
1.035s lvm2-monitor.service
935ms lightdm.service
879ms dev-sdb1.device
716ms tlp.service
486ms systemd-udevd.service
307ms accounts-daemon.service
306ms systemd-journal-flush.service
293ms upower.service
249ms polkit.service
244ms systemd-journald.service
243ms systemd-timesyncd.service
168ms NetworkManager.service
143ms ldconfig.service
138ms avahi-daemon.service
91ms udisks2.service
90ms rtkit-daemon.service
85ms systemd-tmpfiles-clean.service
57ms systemd-udev-trigger.service
50ms modprobe@drm.service
39ms user@1000.service
34ms systemd-journal-catalog-update.service
33ms systemd-modules-load.service
32ms systemd-tmpfiles-setup.service
30ms systemd-sysusers.service
26ms wpa_supplicant.service
25ms systemd-rfkill.service
20ms systemd-tmpfiles-setup-dev.service
18ms dev-hugepages.mount
17ms dev-mqueue.mount
15ms sys-kernel-debug.mount
14ms sys-kernel-tracing.mount
13ms kmod-static-nodes.service
11ms systemd-sysctl.service
11ms systemd-remount-fs.service
10ms systemd-update-utmp.service
7ms systemd-update-done.service
5ms user-runtime-dir@1000.service
5ms systemd-user-sessions.service
3ms proc-sys-fs-binfmt_misc.mount
3ms sys-fs-fuse-connections.mount
1ms sys-kernel-config.mount
1ms tmp.mount

At your own risk you can touch and see, but I don’t think it necessary, in my opinion.

Hi, I have now similar output.
systemd-analyze Startup finished in 2.108s (kernel) + 5.711s (userspace) = 7.819s graphical.target reached after 5.710s in userspace
so it’s nice but do I have to worry about that info at the shutdown: Failed to unmount /home?

I don’t think so, it will change in next updates, as long as it keeps rebooting and powering up smoothly, don’t worry.

OK, thanks for help.
Regards.

1 Like

You’re welcome!