如何加快 Ubuntu 20.04 的启动时间

如何加快 Ubuntu 20.04 的启动时间

对我来说,启动 Ubuntu 20.04 需要很长时间。我运行了命令systemd-analyze,结果如下。

Startup finished in 5.533s (kernel) + 1min 40.647s (userspace) = 1min 46.181s 
graphical.target reached after 1min 40.553s in userspace

我该如何减少用户空间时间?有人可以解释一下这是什么吗?

以下是输出systemd-analyze blame

systemd-analyze blame
1min 12.349s plymouth-quit-wait.service                           
     15.221s snapd.service                                        
     13.732s networkd-dispatcher.service                          
     13.096s dev-sda4.device                                      
     10.283s NetworkManager-wait-online.service                   
      8.650s udisks2.service                                      
      8.511s gpu-manager.service                                  
      7.907s NetworkManager.service                               
      7.089s dev-loop0.device                                     
      7.089s dev-loop1.device                                     
      7.015s dev-loop3.device                                     
      6.753s dev-loop6.device                                     
      6.645s dev-loop9.device                                     
      6.614s accounts-daemon.service                              
      6.603s dev-loop18.device                                    
      6.552s dev-loop8.device                                     
      6.467s dev-loop12.device                                    
      6.361s dev-loop13.device                                    
      6.257s dev-loop14.device                                    
      6.193s dev-loop15.device                                    
      6.149s dev-loop17.device                                    
      6.139s dev-loop16.device                                    
      5.774s polkit.service                                       
lines 1-23...skipping...
1min 12.349s plymouth-quit-wait.service                           
     15.221s snapd.service                                        
     13.732s networkd-dispatcher.service                          
     13.096s dev-sda4.device                                      
     10.283s NetworkManager-wait-online.service                   
      8.650s udisks2.service                                      
      8.511s gpu-manager.service                                  
      7.907s NetworkManager.service                               
      7.089s dev-loop0.device                                     
      7.089s dev-loop1.device                                     
      7.015s dev-loop3.device                                     
      6.753s dev-loop6.device                                     
      6.645s dev-loop9.device                                     
      6.614s accounts-daemon.service                              
      6.603s dev-loop18.device                                    
      6.552s dev-loop8.device                                     
      6.467s dev-loop12.device                                    
      6.361s dev-loop13.device                                    
      6.257s dev-loop14.device                                    
      6.193s dev-loop15.device                                    
      6.149s dev-loop17.device                                    
      6.139s dev-loop16.device                                    
      5.774s polkit.service                                       
      4.736s avahi-daemon.service                                 
      4.735s bluetooth.service                                    
      4.312s switcheroo-control.service                           
      4.281s dev-loop11.device                                    
      4.259s systemd-journal-flush.service                        
      4.246s dev-loop4.device                                     
      4.191s dev-loop10.device                                    
      4.070s bolt.service                                         
      4.062s dev-loop5.device                                     
      4.041s fwupd.service                                        
      3.943s dev-loop7.device                                     
      3.503s thermald.service                                     
      3.500s wpa_supplicant.service                               
      3.500s systemd-logind.service                               
      3.300s systemd-resolved.service                             
      3.217s grub-common.service                                  
      3.142s apport.service                                       
      3.072s e2scrub_reap.service                                 
      2.712s systemd-udevd.service                                
      2.582s grub-initrd-fallback.service                         
      2.193s secureboot-db.service                                
      2.165s ModemManager.service                                 
      1.813s rsyslog.service                                      
      1.798s gdm.service                                          
      1.556s systemd-tmpfiles-setup.service                       
      1.432s apparmor.service                                     
      1.424s pppd-dns.service                                     
      1.232s systemd-modules-load.service                         
      1.156s snapd.apparmor.service                               
      1.082s snap-vlc-1700.mount                                  
      1.056s snap-gnome\x2d3\x2d34\x2d1804-36.mount

我正在使用戴尔 G7 17

i7 9750H

Nvidia RTX 2070 MaxQ

16GB 2666 内存

256GB SSD + 1TB HDD

谢谢

编辑#1

我已经重新安装了 Ubuntu 20.04,但即使我进行了最小安装,我的时间也没有改变。我确实安装了 VLC、Terminator 和 Jupyter Notebooks 来执行我的任务。

这是新的时代。

nova@G7:~$ systemd-analyze blame 
37.821s plymouth-quit-wait.service                           
13.609s dev-sda4.device                                      
13.119s networkd-dispatcher.service                          
11.606s NetworkManager-wait-online.service                   
10.705s systemd-journal-flush.service                        
 9.914s udisks2.service                                      
 8.143s accounts-daemon.service                              
 8.063s dev-loop1.device                                     
 8.008s dev-loop2.device                                     
 7.920s fwupd.service                                        
 7.846s dev-loop4.device                                     
 7.665s dev-loop10.device                                    
 7.654s dev-loop11.device                                    
 7.082s dev-loop8.device                                     
 6.791s dev-loop5.device                                     
 6.660s NetworkManager.service                               
 6.494s dev-loop9.device                                     
 5.541s polkit.service                                       
 5.309s dev-loop7.device                                     
 5.224s dev-loop12.device                                    
 5.154s dev-loop13.device                                    
 4.965s gpu-manager.service                                  
 4.951s bluetooth.service                                    
 4.949s avahi-daemon.service                                 
 4.766s dev-loop0.device                                     
 4.418s switcheroo-control.service                           
 4.414s thermald.service                                     
 4.413s wpa_supplicant.service                               
 4.412s systemd-logind.service                               
 4.344s dev-loop6.device                                     
 4.251s ModemManager.service                                 
 4.035s apport.service                                       
 3.922s grub-common.service                                  
 3.853s dev-loop3.device                                     
 3.341s bolt.service                                         
 3.033s secureboot-db.service                                
 2.699s rsyslog.service                                      
 2.370s systemd-resolved.service                             
 2.183s systemd-udevd.service                                
 1.818s gdm.service                                          
 1.783s grub-initrd-fallback.service                         
 1.695s systemd-modules-load.service                         
 1.309s keyboard-setup.service                               
 1.219s plymouth-start.service                               
 1.138s systemd-random-seed.service                          
 1.135s apparmor.service                                     
 1.093s snapd.seeded.service                                 
 1.000s snapd.apparmor.service                               
  945ms colord.service                                       
  872ms systemd-sysusers.service                             
  852ms systemd-tmpfiles-setup-dev.service                   
  801ms systemd-backlight@backlight:intel_backlight.service  
  760ms [email protected]                                 
  708ms e2scrub_reap.service                                 
  678ms systemd-rfkill.service                               
  671ms snap-telegram\x2ddesktop-2064.mount                  
  658ms snap-vlc-1700.mount                                  
  585ms snapd.service                                        
  572ms snap-canonical\x2dlivepatch-95.mount                 
  524ms systemd-tmpfiles-setup.service                       
  514ms upower.service                                       
  504ms systemd-udev-trigger.service                         
  493ms swapfile.swap                                        
  484ms snap-spotify-42.mount                                
  467ms snap-jupyter-6.mount                                 
  443ms systemd-journald.service                             
  438ms snap-core20-634.mount                                
  422ms pppd-dns.service                                     
  407ms kerneloops.service                                   
  406ms systemd-fsck@dev-disk-by\x2duuid-E2FE\x2dB8EE.service
  371ms snap-gnome\x2d3\x2d34\x2d1804-24.mount               
  353ms openvpn.service                                      
  345ms snap-gnome\x2d3\x2d28\x2d1804-128.mount              
  339ms snap-snap\x2dstore-433.mount                         
  321ms setvtrgb.service                                     
  307ms ufw.service                                          
  291ms [email protected]                                    
  280ms snap-gtk\x2dcommon\x2dthemes-1506.mount              
  279ms systemd-remount-fs.service                           
  266ms snap-snapd-7264.mount                                
  261ms systemd-sysctl.service                               
  242ms systemd-timesyncd.service                            
  227ms snap-core-9993.mount                                 
  194ms console-setup.service                                
  177ms systemd-update-utmp.service                          
  154ms plymouth-read-write.service                          
  146ms snap-discord-115.mount                               
  132ms snap-core18-1705.mount                               
  128ms snap-snapd-9279.mount                                
  103ms dev-hugepages.mount                                  
  102ms dev-mqueue.mount                                     
  102ms sys-kernel-debug.mount                               
  101ms sys-kernel-tracing.mount                             
   99ms systemd-tmpfiles-clean.service                       
   99ms kmod-static-nodes.service                            
   88ms snap-gnome\x2d3\x2d34\x2d1804-36.mount               
   77ms snap-snap\x2dstore-467.mount                         
   60ms rtkit-daemon.service                                 
   48ms boot-efi.mount                                       
   46ms systemd-user-sessions.service                        
   33ms snap-core18-1885.mount                               
   20ms dev-loop16.device                                    
   14ms dev-loop15.device                                    
    9ms [email protected]                        
    7ms dev-loop14.device                                    
    7ms systemd-update-utmp-runlevel.service                 
    6ms alsa-restore.service                                 
    3ms dev-loop17.device                                    
    1ms sys-fs-fuse-connections.mount                        
    1ms sys-kernel-config.mount                              
  478us snapd.socket  

编辑#2

安装后,我注意到 Ubuntu 软件和其他内置应用程序也需要一些时间来加载。

Ubuntu 已加载到我的硬盘的一个分区上

答案1

有几件事情可以帮助我加快电脑速度。

1.重新安装 Ubuntu。

重新安装时,请确保选择最小安装选项,因为这将减少安装在您电脑上的应用程序和软件包的数量。您可以随时使用终端手动添加所需的任何内容。

2. 使用 SSD。

在我的电脑上,Ubuntu 安装在硬盘上,这使得启动时间变慢

3. 当双启动 PC 时,使用驱动器的第一个分区。

当我第一次在硬盘上双启动 Ubuntu 时,第一个分区用于存储 Windows 使用的数据。此后,Windows 创建了一些必要的部分,最后是 Ubuntu 的分区。计算机按顺序扫描所有分区,然后在到达 Ubuntu 驱动器(在我的情况下是 sdb4)时启动到 Ubuntu。

现在完成所有这些后,我的启动时间已大大减少。

相关内容