HDD 上 19.10 启动很慢?

HDD 上 19.10 启动很慢?

[编辑] 我刚刚意识到 Ubuntu 没有安装在 SSD 上 - 我只是假设它安装了。

我按照此说明在 Dell Inspirion 的 HDD 上安装了 Ubuntu 19.10 https://askubuntu.com/a/1127541/1022455

SSD 上的 Windows 启动时间约为 16 秒,Ubuntu 启动时间约为 55 秒。

$ systemd-analyze time
Startup finished in 3.204s (kernel) + 1min 18.943s (userspace) = 1min 22.147s 
graphical.target reached after 1min 18.837s in userspace
$ systemd-analyze blame
         52.979s plymouth-quit-wait.service
         14.469s dev-sda3.device
         10.106s NetworkManager-wait-online.service
          9.651s networkd-dispatcher.service
          9.650s systemd-journal-flush.service
          9.455s snapd.service
          8.486s ModemManager.service
          7.680s udisks2.service
          7.272s accounts-daemon.service
          6.186s dev-loop0.device
          5.571s grub-common.service
          5.399s secureboot-db.service
          5.328s apport.service
          4.636s NetworkManager.service
          4.561s switcheroo-control.service
          4.559s rsyslog.service
          4.555s grub-initrd-fallback.service
          4.554s thermald.service
          4.551s bluetooth.service
          4.505s plymouth-read-write.service
          4.496s dev-loop4.device
          4.342s avahi-daemon.service
          3.942s systemd-logind.service
          3.940s gpu-manager.service
          3.935s pppd-dns.service
          3.640s apparmor.service
          3.623s wpa_supplicant.service
          3.601s dev-loop2.device
          3.367s dev-loop5.device
          3.101s e2scrub_reap.service
          3.055s dev-loop3.device
          3.031s dev-loop1.device
          3.002s dev-loop6.device
          2.816s systemd-resolved.service
          2.552s systemd-udevd.service
          2.152s plymouth-start.service
          1.692s gdm.service
          1.624s packagekit.service
          1.515s polkit.service
          1.011s systemd-backlight@leds:dell::kbd_backlight.service
           744ms systemd-modules-load.service
           674ms systemd-rfkill.service
           642ms systemd-backlight@backlight:intel_backlight.service
           639ms systemd-timesyncd.service
           619ms upower.service
           615ms systemd-sysusers.service
           586ms systemd-sysctl.service
           540ms keyboard-setup.service
           498ms snap-core-7917.mount
           441ms systemd-journald.service
           439ms systemd-fsck@dev-disk-by\x2duuid-3637\x2dAEF4.service
           434ms systemd-udev-trigger.service
           349ms snap-core18-1223.mount
           332ms snap-gnome\x2d3\x2d28\x2d1804-71.mount
           319ms snapd.seeded.service
           307ms systemd-random-seed.service
           303ms snap-gtk\x2dcommon\x2dthemes-1353.mount
           300ms snap-gnome\x2dlogs-81.mount
           278ms snap-gnome\x2dcharacters-317.mount
           264ms systemd-tmpfiles-setup-dev.service
           260ms ufw.service
           232ms snap-gnome\x2dcalculator-501.mount
           232ms systemd-tmpfiles-setup.service
           229ms systemd-user-sessions.service
           211ms systemd-remount-fs.service
           203ms colord.service
           180ms [email protected]
           159ms dev-mqueue.mount
           122ms systemd-update-utmp.service
           118ms kerneloops.service
           104ms openvpn.service
           100ms setvtrgb.service
            87ms rtkit-daemon.service
            81ms sys-kernel-debug.mount
            81ms kmod-static-nodes.service
            79ms dev-hugepages.mount
            63ms boot-efi.mount
            23ms snapd.socket
            21ms systemd-update-utmp-runlevel.service
            17ms console-setup.service
             9ms [email protected]
             2ms sys-fs-fuse-connections.mount
             1ms sys-kernel-config.mount

$ 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 @51.809s
└─multi-user.target @51.809s
  └─kerneloops.service @38.653s +213ms
    └─network-online.target @38.622s
      └─NetworkManager-wait-online.service @27.210s +11.411s
        └─NetworkManager.service @21.074s +6.118s
          └─dbus.service @21.071s
            └─basic.target @20.653s
              └─sockets.target @20.653s
                └─snapd.socket @20.652s +755us
                  └─sysinit.target @20.605s
                    └─cryptsetup.target @20.590s
                      └─systemd-ask-password-wall.path @2.550s
                        └─-.mount @2.548s
                          └─system.slice @2.548s
                            └─-.slice @2.548s

我浏览了建议的链接,以下是结果

谢谢你的帮助。我认为第一个链接不是同一个问题,我的启动过程中没有apt-daily。

关闭交换(我有 16GB 的 RAM,默认交换是 1GB)

$ systemd-analyze time
Startup finished in 3.352s (kernel) + 51.883s (userspace) = 55.236s 
graphical.target reached after 51.809s in userspace
sudo apt autoremove --purge snapd
$ systemd-analyze time
Startup finished in 3.325s (kernel) + 45.791s (userspace) = 49.117s 
graphical.target reached after 45.708s in userspace

编辑日志:https://askubuntu.com/a/1094543/1022455

$ systemd-analyze time
Startup finished in 3.536s (kernel) + 41.438s (userspace) = 44.974s 
graphical.target reached after 41.373s in userspace

不知道还有什么值得做的吗?Ubuntu 的预期启动时间是多少?它仍然比 ubuntu 慢

[编辑] 更新critical chain

graphical.target @28.709s
└─multi-user.target @28.709s
  └─kerneloops.service @28.554s +153ms
    └─network-online.target @28.552s
      └─NetworkManager-wait-online.service @19.311s +9.240s
        └─NetworkManager.service @14.001s +5.306s
          └─dbus.service @13.994s
            └─basic.target @13.911s
              └─paths.target @13.911s
                └─acpid.path @13.911s
                  └─sysinit.target @13.578s
                    └─systemd-timesyncd.service @12.952s +626ms
                      └─systemd-tmpfiles-setup.service @11.804s +1.108s
                        └─systemd-journal-flush.service @3.142s +8.661s
                          └─systemd-journald.service @2.808s +332ms
                            └─syslog.socket @2.806s
                              └─system.slice @2.572s
                                └─-.slice @2.572s

答案1

我已经在帖子中回答了这个问题系统启动缓慢 其中我已经列出了哪些服务可以安全禁用以及如何禁用它们。

相关内容