启动 - Ubuntu 20.04 启动时间过长

启动 - Ubuntu 20.04 启动时间过长

Ubuntu 20.04 的启动过程耗时太长。我想知道如何缩短启动时间。

这是我的硬件信息:

  • 内存——4GB
  • 磁盘类型 - HDD
  • 磁盘空间 - 1TB
  • 架构——amd64
  • 处理器 - 英特尔(酷睿 i3)第 7 代

如果有任何其他所需信息,请评论,我会提供。

输出dmesg

输出文件点击查看

systemd-analyze输出:

Startup finished in 4.133s (firmware) + 5.169s (loader) + 5.074s (kernel) + 31min 12.092s (userspace) = 31min 26.470s 
graphical.target reached after 3min 9.875s in userspace

systemd-anlyze blame输出 :

30min 36.678s fstrim.service                                                                           
 2min 19.796s plymouth-quit-wait.service                                                               
      33.670s snapd.service                                                                            
      31.615s networkd-dispatcher.service                                                              
      28.168s udisks2.service                                                                          
      21.824s accounts-daemon.service                                                                  
      21.649s fwupd.service                                                                            
      16.696s systemd-tmpfiles-clean.service                                                           
      16.168s ModemManager.service                                                                     
      15.824s dev-sda3.device                                                                          
      14.959s polkit.service                                                                           
      14.086s avahi-daemon.service                                                                     
      14.085s bluetooth.service                                                                        
      14.060s NetworkManager.service                                                                   
      14.049s dundee.service                                                                           
      14.018s ofono.service                                                                            
      13.795s switcheroo-control.service                                                               
      13.787s thermald.service                                                                         
      13.782s wpa_supplicant.service                                                                   
      13.780s systemd-logind.service                                                                   
      10.643s systemd-tmpfiles-setup.service                                                           
       9.122s [email protected]                                                                         
       9.110s plymouth-read-write.service                                                              
       8.307s dev-loop11.device                                                                        
       8.275s dev-loop1.device                                                                         
       8.188s dev-loop8.device                                                                         
       7.778s dev-loop5.device                                                                         
       7.385s dev-loop10.device                                                                        
       7.307s dev-loop9.device                                                                         
       6.845s dev-loop3.device                                                                         
       6.568s dev-loop2.device                                                                         
       6.476s dev-loop4.device                                                                         
       6.474s dev-loop7.device                                                                         
       6.210s grub-common.service                                                                      
       6.074s apport.service                                                                           
       5.830s systemd-resolved.service                                                                 
       5.821s bolt.service                                                                             
       5.818s secureboot-db.service                                                                    
       5.184s gpu-manager.service                                                                      
       4.838s gdm.service                                                                              
       4.580s dev-loop6.device                                                                         
       4.534s dev-loop0.device                                                                         
       4.447s rsyslog.service                                                                          
       4.261s ubuntu-fan.service                                                                       
       3.503s apparmor.service                                                                         
       3.407s grub-initrd-fallback.service                                                             
       2.575s snap-canonical\x2dlivepatch-95.mount                                                     
       2.253s binfmt-support.service                                                                   
       2.234s snapd.apparmor.service                                                                   
       2.221s snap-chromium-1399.mount                                                                 
       2.050s e2scrub_reap.service                                                                     
       1.964s systemd-rfkill.service                                                                   
       1.873s snap-core-10185.mount                                                                    
       1.616s snap-core18-1932.mount                                                                   
       1.491s pppd-dns.service                                                                         
       1.478s colord.service                                                                           
       1.448s snapd.seeded.service                                                                     
       1.353s upower.service                                                                           
       1.333s snap-gnome\x2d3\x2d28\x2d1804-145.mount                                                  
       1.181s systemd-backlight@backlight:intel_backlight.service                                      
       1.164s systemd-udevd.service                                                                    
       1.059s snap-gnome\x2d3\x2d34\x2d1804-60.mount                                                   
        984ms systemd-fsck@dev-disk-by\x2duuid-565baeeb\x2df53c\x2d44c6\x2da9b3\x2d7604d7b7e16f.service
        949ms systemd-modules-load.service                                                             
        908ms apport-autoreport.service                                                                
        828ms kerneloops.service                                                                       
        771ms systemd-random-seed.service                                                              
        770ms openvpn.service                                                                          
        752ms [email protected]                                                                     
        749ms snap-gtk\x2dcommon\x2dthemes-1506.mount                                                  
        725ms systemd-sysusers.service                                                                 
        675ms containerd.service                                                                       
        651ms systemd-udev-trigger.service                                                             
        638ms virtualbox.service                                                                       
        628ms systemd-sysctl.service                                                                   
        608ms snap-kde\x2dframeworks\x2d5\x2dcore18-32.mount                                           
        600ms snap-simplescreenrecorder\x2dbrlin-69.mount                                              
        588ms systemd-fsck@dev-disk-by\x2duuid-2F60\x2d3524.service                                    
        538ms [email protected]                                                                        
        538ms ufw.service                                                                              
        530ms systemd-journald.service                                                                 
        513ms snap-slack-32.mount                                                                      
        467ms systemd-remount-fs.service                                                               
        464ms qemu-kvm.service                                                                         
        414ms systemd-user-sessions.service                                                            
        413ms console-setup.service                                                                    
        396ms plymouth-start.service                                                                   
        324ms systemd-tmpfiles-setup-dev.service                                                       
        308ms systemd-timesyncd.service                                                                
        268ms fam.service                                                                              
        255ms alsa-restore.service                                                                     
        236ms rtkit-daemon.service                                                                     
        227ms dev-hugepages.mount                                                                      
        226ms dev-mqueue.mount                                                                         
        224ms sys-kernel-debug.mount                                                                   
        223ms sys-kernel-tracing.mount                                                                 
        220ms kmod-static-nodes.service                                                                
        204ms snap-snap\x2dstore-481.mount                                                             
        195ms [email protected]                                                             
        181ms setvtrgb.service                                                                         
        174ms dev-disk-by\x2duuid-628e5f66\x2dda0b\x2d41af\x2dbaca\x2dc4d1fafee694.swap                
        158ms systemd-update-utmp.service                                                              
        144ms home.mount                                                                               
        138ms snap-snapd-9721.mount                                                                    
        124ms boot-efi.mount                                                                           
         44ms proc-sys-fs-binfmt_misc.mount                                                            
         38ms systemd-update-utmp-runlevel.service                                                     
         34ms [email protected]                                                            
          5ms sys-fs-fuse-connections.mount                                                            
          4ms sys-kernel-config.mount                                                                  
          2ms docker.socket                                                                            
          1ms snapd.socket

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 @3min 9.875s
└─multi-user.target @3min 9.875s
  └─snapd.seeded.service @1min 9.328s +1.448s
    └─snapd.service @35.652s +33.670s
      └─basic.target @35.221s
        └─sockets.target @35.221s
          └─snapd.socket @35.219s +1ms
            └─sysinit.target @35.071s
              └─systemd-timesyncd.service @34.762s +308ms
                └─systemd-tmpfiles-setup.service @24.029s +10.643s
                  └─local-fs.target @24.017s
                    └─run-snapd-ns-chromium.mnt.mount @12min 46.580s
                      └─run-snapd-ns.mount @57.339s
                        └─swap.target @23.033s
                          └─dev-disk-by\x2duuid-628e5f66\x2dda0b\x2d41af\x2dbaca\x2dc4d1fafee694.swap @22.857s +174ms
                            └─dev-disk-by\x2duuid-628e5f66\x2dda0b\x2d41af\x2dbaca\x2dc4d1fafee694.device @22.854s

cat /etc/fstab输出:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda3 during installation
UUID=bc7f56e3-b60c-48a9-b04d-385d9c46c938 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=2F60-3524  /boot/efi       vfat    umask=0077      0       1
# /home was on /dev/sda4 during installation
UUID=565baeeb-f53c-44c6-a9b3-7604d7b7e16f /home           ext4    defaults        0       2
# swap was on /dev/sda2 during installation
UUID=628e5f66-da0b-41af-baca-c4d1fafee694 none            swap    sw              0       0

我已经检查了交换的 UUID。

相关内容