Ubuntu 18.04 启动用户空间缓慢 = 2 分钟

Ubuntu 18.04 启动用户空间缓慢 = 2 分钟

我的系统启动需要 2 分钟以上。我有一台 HP Omen 笔记本电脑,双启动,装有 Windows 10 和 Ubuntu Studio 18.04.2 LTS。

  • CPU:英特尔酷睿 i7-7700 (4核) 2.8GHz
  • 内存:12 GiB
  • 显卡:Radeon RX580
  • 硬盘:1TB

浏览类似问题时,我看到帖子说交换 UUID 命名不正确。我确认情况并非如此。我找不到任何其他解释或解决方案。

结果如下systemd-analyze blame/time

$ systemd-analyze blame
1min 57.885s apt-daily-upgrade.service
     39.575s systemd-journal-flush.service
     23.990s dev-sda6.device
     19.274s systemd-tmpfiles-setup-dev.service
     17.718s mpd.service
     15.864s systemd-sysctl.service
      8.998s NetworkManager-wait-online.service
      6.845s snapd.service
      5.360s udisks2.service
      4.877s thermald.service
      4.537s ModemManager.service
      4.386s NetworkManager.service
      3.865s systemd-modules-load.service
      3.655s smbd.service
      3.248s iio-sensor-proxy.service
      3.153s keyboard-setup.service
      3.140s accounts-daemon.service
      3.122s networkd-dispatcher.service
      2.825s gpu-manager.service
      2.724s [email protected]
      2.629s nmbd.service
      2.214s grub-common.service
      2.034s lightdm.service
      2.029s plymouth-quit-wait.service
      2.006s wpa_supplicant.service
      1.955s rtirq.service
      1.703s apt-daily.service
      1.548s avahi-daemon.service
      1.545s upower.service
      1.329s systemd-logind.service
      1.182s motd-news.service
      1.091s polkit.service
      1.050s resolvconf.service
       900ms systemd-resolved.service
       847ms colord.service
       812ms dev-loop3.device
       777ms ssh.service
       774ms systemd-random-seed.service
       764ms sys-kernel-debug.mount
       763ms systemd-remount-fs.service                                                                                      
       762ms dev-hugepages.mount                                                                                             
       762ms dev-mqueue.mount                                                                                                
       752ms media-lilphoenix-E014555514553030.mount                                                                         
       680ms snap-core-6818.mount                                                                                            
       674ms rsyslog.service                                                                                                 
       670ms dev-loop1.device                                                                                                
       656ms apparmor.service                                                                                                
       609ms snap-core-6964.mount                                                                                            
       595ms ufw.service                                                                                                     
       588ms snap-core-6673.mount                                                                                            
       567ms systemd-fsck@dev-disk-by\x2duuid-18B6\x2d2C28.service                                                           
       541ms virtualbox.service                                                                                              
       475ms dev-loop0.device                                                                                                
       465ms binfmt-support.service                                                                                          
       444ms systemd-tmpfiles-clean.servicelines 

1-55...跳过...

分析时间

$ systemd-analyze time 
Startup finished in 4.335s (firmware) + 12.627s (loader) + 36.910s  (kernel) + 1min 34.122s (userspace) = 2min 27.995s graphical.target reached after 1min 8.866s in userspace````
~$ systemd-analyze critical-chain
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.

graphical.target @1min 8.866s
└─multi-user.target @1min 8.866s
  └─mpd.service @51.147s +17.718s
    └─network.target @51.144s
      └─NetworkManager.service @46.758s +4.386s
        └─dbus.service @45.509s
          └─basic.target @45.456s
            └─sockets.target @45.456s
              └─snapd.socket @45.455s +621us
                └─sysinit.target @44.946s
                  └─systemd-timesyncd.service @44.554s +392ms
                    └─systemd-tmpfiles-setup.service @44.228s +293ms
                      └─systemd-journal-flush.service @4.651s +39.575s
                        └─systemd-remount-fs.service @3.884s +763ms
                          └─systemd-journald.socket @3.882s
                            └─system.slice @3.882s
                              └─-.slice @3.859s

似乎很多人都有类似的问题,但如果不是 UUID 解决方案,很少有人能解决问题。任何帮助都将不胜感激。

~$ ls -l /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 10 Jun  6 14:47 18B6-2C28 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jun  6 14:47 3C3EA08F3EA043AC -> ../../sda3
lrwxrwxrwx 1 root root 10 Jun  6 14:47 53c7d176-56fa-43b7-867a-b0168427850e -> ../../sda6
lrwxrwxrwx 1 root root 10 Jun  6 14:47 7ACC8F67CC8F1D0F -> ../../sda4
lrwxrwxrwx 1 root root 10 Jun  6 14:47 82B6FF43B6FF35EF -> ../../sda5
lrwxrwxrwx 1 root root 10 Jun  6 14:47 e4e01ee5-bf4c-4346-8363-92869f6b1a6a -> ../../sda8
~$ 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/sda6 during installation                                                                                          
UUID=53c7d176-56fa-43b7-867a-b0168427850e /               ext4    errors=remount-ro 0       1                                     
# /boot/efi was on /dev/sda1 during installation                                                                                  
UUID=18B6-2C28  /boot/efi       vfat    umask=0077      0       1                                                                 
# swap was on /dev/sda8 upon reconfiguration                                                                                      
# UUID=e4e01ee5-bf4c-4346-8363-92869f6b1a6a none            swap    sw              0       0                                     ```

答案1

我的启动时间也差不多。我只有 Ubuntu。

Ubuntu 18.04.3 Intel(R) Core(TM) i7-3930K CPU @ 4.2GHz RAM 16G 500G WD5000 磁盘。

我安装了 SSD,启动时间好多了。

相关内容