双启动系统,Ubuntu 20.04 启动缓慢

双启动系统,Ubuntu 20.04 启动缓慢

我有一个双启动系统,其中全新安装了 Ubuntu 20.04。两个操作系统都运行良好,启动完美。我一直遇到 Clonezilla 的问题,长话短说,别问了,而且在关机时过早拉出了安装介质。我的 Grub 菜单被破坏了,但我能够使用启动修复来修复系统,Windows 10 和 Ubuntu 20.04 又回来了。然而,问题是 Ubuntu 20.04 现在需要大约 2 分钟才能打开。

以下是 systemd-analyze 的结果

Startup finished in 8.600s (firmware) + 3.764s (loader) + 33.965s (kernel) + 1min 35.755s (userspace) = 2min 22.085s 
graphical.target reached after 1min 35.745s in userspace

以下是 systemd-analyze blame 的结果:

5.113s plymouth-quit-wait.service                                    
1.435s snap-gnome\x2d3\x2d28\x2d1804-116.mount                       
1.430s snap-gtk\x2dcommon\x2dthemes-1506.mount                       
1.402s snap-kate-64.mount                                            
1.341s snap-sqlitebrowser-1864.mount                                 
1.299s snap-core18-1705.mount                                        
1.265s fwupd.service                                                 
1.222s snap-gimp-252.mount                                           
1.168s snap-gnome\x2d3\x2d34\x2d1804-27.mount                        
1.109s snap-kde\x2dframeworks\x2d5\x2dqt\x2d5\x2d14\x2dcore18-4.mount
1.104s snap-vlc-1397.mount                                           
 889ms snap-sqlitebrowser-1894.mount                                 
 887ms snap-vlc-1620.mount                                           
 709ms dev-loop1.device                                              
 686ms snap-blender-37.mount                                         
 682ms snap-chromium-1123.mount                                      
 674ms snap-postman-107.mount                                        
 673ms snap-snapd-7264.mount                                         
 660ms dev-loop2.device                                              
 649ms dev-sda1.device                                               
 611ms dev-loop3.device                                              
 582ms dev-loop4.device                                              
 570ms systemd-logind.service                                        
 567ms dev-loop6.device                                              
 519ms bolt.service                                                  
 493ms dev-loop5.device                                              
 425ms dev-loop0.device                                              
 391ms snap-gnome\x2d3\x2d34\x2d1804-24.mount                        
 387ms snap-snap\x2dstore-433.mount                                  
 365ms snapd.service                                                 
 340ms systemd-journald.service                                      
 334ms dev-loop8.device                                              
 318ms snap-core18-1754.mount                                        
 316ms upower.service                                                
 290ms dev-loop10.device                                             
 278ms dev-loop9.device                                              
 255ms systemd-resolved.service                                      
 244ms snap-core-9066.mount                                          
 240ms systemd-timesyncd.service                                     
 228ms networkd-dispatcher.service                                   
 212ms snap-code-31.mount                                            
 210ms dev-loop13.device                                             
 202ms dev-loop7.device                                              
 198ms accounts-daemon.service                                       
 193ms udisks2.service                                               
 173ms systemd-journal-flush.service                                 
 164ms snap-chromium-1135.mount                                      
 134ms dev-loop11.device                                             
 126ms dev-loop15.device                                             
 125ms dev-loop16.device                                             
 120ms avahi-daemon.service                                          
 118ms bluetooth.service                                             
 116ms NetworkManager.service                                        
 112ms polkit.service                                                
 105ms dev-loop14.device                                             
 105ms dev-loop17.device                                             
  97ms systemd-rfkill.service                                        
  92ms switcheroo-control.service                                    
  86ms thermald.service                                              
  84ms wpa_supplicant.service                                        
  83ms [email protected]                                              
  82ms systemd-udev-trigger.service                                  
  80ms dev-loop18.device                                             
  75ms [email protected]                                             
  73ms apport.service                                                
  69ms ModemManager.service                                          
  68ms gpu-manager.service                                           
  62ms grub-common.service                                           
  61ms systemd-udevd.service                                         
  58ms secureboot-db.service                                         
  54ms systemd-fsck@dev-disk-by\x2duuid-4A81\x2d6B49.service         
  52ms keyboard-setup.service                                        
  49ms dev-loop12.device                                             
  44ms e2scrub_reap.service                                          
  42ms grub-initrd-fallback.service                                  
  42ms geoclue.service                                               
  39ms apparmor.service                                              
  34ms rsyslog.service                                               
  30ms gdm.service                                                   
  27ms kerneloops.service                                            
  25ms dev-loop19.device                                             
  25ms systemd-tmpfiles-clean.service                                
  24ms snapd.apparmor.service                                        
  22ms nvidia-persistenced.service                                   
  21ms systemd-modules-load.service                                  
  20ms plymouth-start.service                                        
  19ms systemd-user-sessions.service                                 
  19ms systemd-tmpfiles-setup.service                                
  18ms pppd-dns.service                                              
  17ms binfmt-support.service                                        
  17ms boot-efi.mount                                                
  15ms [email protected]                                          
  13ms colord.service                                                
  13ms snapd.seeded.service                                          
  13ms systemd-sysusers.service                                      
  13ms alsa-restore.service                                          
  13ms plymouth-read-write.service                                   
  11ms systemd-remount-fs.service                                    
  11ms systemd-random-seed.service                                   
  11ms dev-loop20.device                                             
  11ms systemd-sysctl.service                                        
  10ms systemd-backlight@backlight:acpi_video0.service               
  10ms [email protected]                                 
  10ms [email protected]                                  
  10ms dev-hugepages.mount                                           
   9ms proc-sys-fs-binfmt_misc.mount                                 
   9ms systemd-tmpfiles-setup-dev.service                            
   9ms dev-mqueue.mount                                              
   9ms sys-kernel-debug.mount                                        
   8ms sys-kernel-tracing.mount                                      
   8ms systemd-update-utmp.service                                   
   7ms console-setup.service                                         
   7ms systemd-update-utmp-runlevel.service                          
   6ms systemd-backlight@backlight:nvidia_0.service                  
   6ms kmod-static-nodes.service                                     
   5ms ufw.service                                                   
   3ms openvpn.service                                               
   3ms rtkit-daemon.service                                          
   3ms sys-fs-fuse-connections.mount                                 
   2ms setvtrgb.service                                              
   1ms sys-kernel-config.mount                                       
 644us snapd.socket

这是 systemd-analyze critical-chain

graphical.target @1min 35.745s
└─multi-user.target @1min 35.745s
  └─unattended-upgrades.service @1min 31.085s
    └─systemd-logind.service @1min 30.513s +570ms
      └─basic.target @1min 30.469s
        └─sockets.target @1min 30.469s
          └─snapd.socket @1min 30.469s +644us
            └─sysinit.target @1min 30.464s
              └─systemd-backlight@backlight:nvidia_0.service @1min 32.170s +6ms
                └─system-systemd\x2dbacklight.slice @922ms
                  └─system.slice @228ms
                    └─-.slice @228ms

我怎样才能让它恢复工作状态?

答案1

好的,我能够修复此问题。我必须进入位于以下位置的启动日志:

/var/log/boot.log

有人多次致电

A start job is running for

UUID 4a4d5c2b-cfe1-4ad2-8ebe-49940aaee855

我进入位于 /etc/fstab 的 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/sda1 during installation
UUID=246a96fa-1f09-4d82-9488-792c05ba971a /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/nvme0n1p2 during installation
#UUID=4A81-6B49  /boot/efi       vfat    umask=0077      0       1
# swap was on /dev/sda2 during installation
#UUID=4a4d5c2b-cfe1-4ad2-8ebe-49940aaee855 none            swap    sw              0       0
UUID=4A81-6B49  /boot/efi   vfat    defaults    0   1

这里您可以看到两件事。交换位于 UUID 4a4d5c2b-cfe1-4ad2-8ebe-49940aaee855 上,我已将其注释掉。在拯救我的双启动系统的过程中,这个 fstab 表可能已重新生成,或者它不再与当前表布局匹配,并且此条目现在无效。

这是有道理的,因为在拯救我的系统的过程中,我必须使用 GParted 在 Ubuntu 20.04 安装之外重新创建交换。

根据我的互联网搜索,我将其注释掉,以便 systemd 可以自动安装它。

https://bbs.archlinux.org/viewtopic.php?id=201816

以下是 systemd-analyze 的当前结果:

Startup finished in 8.603s (firmware) + 11.918s (loader) + 33.977s (kernel) + 7.229s (userspace) = 1min 1.728s 
graphical.target reached after 7.220s in userspace

希望这能帮助到其他人!

相关内容