Ubuntu 启动需要很长时间

Ubuntu 启动需要很长时间

我的 Ubuntu 机器启动时很奇怪。问题是,它需要大约五分钟的时间。首先我看到主板启动屏幕(我的情况是 MSI),然后我看到 Ubuntu 加载屏幕和加载器点。一段时间后,点冻结,我的 PC 加载大约 3 分钟。这只是我的电脑,还是 Ubuntu 的一个错误?感谢您的回复。


systemd-analyze blame输出:

1min 27.905s vboxdrv.service
 1min 9.655s plymouth-quit-wait.service
     55.950s e2scrub_reap.service
     40.057s lampp.service
     34.958s snapd.service
     22.833s apport.service
     18.392s dev-sda2.device
     14.697s NetworkManager.service
     13.202s udisks2.service
     12.972s systemd-journal-flush.service
     12.570s gpu-manager.service
     12.491s power-profiles-daemon.service
     12.376s accounts-daemon.service
     12.079s polkit.service
     10.473s avahi-daemon.service
     10.442s dbus.service
     10.376s cups.service
     10.091s plymouth-read-write.service
      9.108s snap-authy-22.mount
      9.076s snap-authy-23.mount
      9.056s snap-bare-5.mount
      8.944s snap-canonical\x2dlivepatch-246.mount
      8.820s snap-canonical\x2dlivepatch-264.mount
      8.704s snap-chromium-2783.mount
      8.600s snap-chromium-2786.mount
      8.464s snap-code-154.mount
      8.420s snap-code-155.mount
      8.288s snap-core-16574.mount
      8.277s switcheroo-control.service
      8.205s snap-core-16928.mount
      8.093s snap-core18-2796.mount
      7.933s snap-core18-2812.mount
      7.903s snap-core20-2105.mount
      7.833s snap-core20-2182.mount
      7.798s snap-core22-1033.mount
      7.737s snap-core22-1122.mount
      7.709s snap-cornyjokes-216.mount
      7.613s snap-cumulonimbus-85.mount
      7.485s snap-cumulonimbus-89.mount
      7.281s snap-cups-1024.mount
      7.266s snap-cups-980.mount
      7.094s snap-discord-180.mount
      7.071s snap-discord-181.mount
      6.981s apache2.service
      6.926s snap-firefox-3836.mount
      6.862s snap-firefox-3941.mount
      6.750s snap-firmware\x2dupdater-109.mount
      6.706s update-notifier-download.service
      6.678s snap-firmware\x2dupdater-121.mount
      6.655s snap-gnome\x2d3\x2d28\x2d1804-198.mount
      6.628s snap-gnome\x2d3\x2d38\x2d2004-143.mount
      6.593s snap-gnome\x2d42\x2d2204-132.mount
      6.587s snap-gnome\x2d42\x2d2204-141.mount
      6.538s snap-gnome\x2dclocks-465.mount
      6.391s rsyslog.service
      6.031s snap-gnome\x2ddictionary-59.mount
      5.960s ModemManager.service
      5.831s snap-gtk2\x2dcommon\x2dthemes-13.mount
      5.743s snap-gtk\x2dcommon\x2dthemes-1535.mount
      5.722s grub-common.service
      5.575s snap-gtk\x2dtheme\x2dorchis-3.mount
      5.513s pulseaudio-enable-autospawn.service
      5.499s snap-gtk\x2dtheme\x2dpocillo-5.mount
      5.421s snapd.apparmor.service
      5.327s snap-isoimagewriter-22.mount
      5.302s snap-kf5\x2d5\x2d104\x2dqt\x2d5\x2d15\x2d8\x2dcore22-9.mount
      5.159s smartmontools.service
      5.135s snap-kf5\x2d5\x2d111\x2dqt\x2d5\x2d15\x2d11\x2dcore22-7.mount
      5.133s NetworkManager-wait-online.service
      5.027s snap-mesa\x2dcore20-151.mount
      4.987s snap-ms\x2d365\x2delectron-4.mount
      4.948s snap-ms\x2d365\x2delectron-5.mount
      4.734s dev-loop60.device
      4.732s dev-loop66.device
      4.730s dev-loop67.device
      4.728s dev-loop65.device
      4.728s dev-loop64.device
      4.726s dev-loop63.device
      4.726s dev-loop62.device
      4.725s dev-loop59.device
      4.725s dev-loop57.device
      4.724s dev-loop61.device
      4.723s dev-loop41.device
      4.722s dev-loop56.device
      4.721s dev-loop55.device
      4.721s dev-loop53.device
      4.721s dev-loop58.device
      4.721s dev-loop49.device
      4.720s dev-loop51.device
      4.719s dev-loop54.device
      4.717s dev-loop52.device
      4.714s dev-loop50.device
      4.714s dev-loop48.device
      4.714s dev-loop47.device
      4.712s dev-loop44.device
      4.712s dev-loop45.device
      4.711s dev-loop43.device
      4.710s dev-loop40.device
      4.709s dev-loop38.device
      4.709s dev-loop46.device
      4.708s dev-loop42.device
      4.706s dev-loop37.device
      4.706s dev-loop36.device
      4.705s dev-loop34.device
      4.705s dev-loop31.device
      4.703s dev-loop39.device
      4.702s dev-loop35.device
      4.702s dev-loop28.device
      4.702s dev-loop33.device
      4.701s dev-loop32.device
      4.700s dev-loop30.device
      4.698s dev-loop27.device
      4.698s dev-loop26.device
      4.697s dev-loop25.device
      4.697s dev-loop29.device
      4.697s dev-loop22.device
      4.696s dev-loop17.device
      4.696s dev-loop24.device
      4.694s dev-loop21.device
      4.694s dev-loop23.device
      4.694s dev-loop20.device
      4.692s dev-loop8.device
      4.690s dev-loop9.device
      4.690s dev-loop19.device
      4.689s dev-loop18.device
      4.689s dev-loop15.device
      4.688s dev-loop14.device
      4.688s dev-loop16.device
      4.688s dev-loop11.device
      4.687s dev-loop13.device
      4.686s dev-loop10.device
      4.683s dev-loop12.device
      4.620s snap-obs\x2dstudio-1298.mount
      4.340s snap-onlyoffice\x2ddesktopeditors-181.mount
      4.192s snap-onlyoffice\x2ddesktopeditors-186.mount
      4.024s snap-pinta-27.mount
      3.924s snap-pinta-29.mount
      3.808s snap-pixelorama-187.mount
      3.724s snap-qt513-24.mount
      3.710s plymouth-start.service
      3.561s thermald.service
      3.536s snap-qt515\x2dcore20-29.mount
      3.504s dev-loop0.device
      3.503s dev-loop1.device
      3.493s dev-loop3.device
      3.491s dev-loop2.device
      3.490s dev-loop6.device
      3.487s dev-loop4.device
      3.484s dev-loop5.device
      3.474s dev-loop7.device
      3.465s systemd-tmpfiles-setup.service
      3.455s systemd-udevd.service
      3.140s snap-qt515\x2dcore20-31.mount
      3.056s snap-red\x2dapp-40.mount
      2.965s apparmor.service
      2.925s gdm.service
      2.885s snap-shotcut-1357.mount
      2.803s systemd-logind.service
      2.765s snap-shotcut-1389.mount
      2.649s snap-snap\x2dstore-1106.mount
      2.413s snap-snap\x2dstore-1110.mount
      2.151s lm-sensors.service
      2.089s snap-snapd-20671.mount
      2.009s snap-snapd-21184.mount
      1.885s snap-snapd\x2ddesktop\x2dintegration-83.mount
      1.757s systemd-tmpfiles-setup-dev-early.service
      1.565s systemd-resolved.service
      1.559s colord.service
      1.509s snap-thunderbird-455.mount
      1.421s snap-thunderbird-460.mount
      1.385s systemd-tmpfiles-clean.service
      1.343s wpa_supplicant.service
      1.185s snap-ubuntu\x2dbudgie\x2dwelcome-490.mount
      1.036s snapd.seeded.service
       989ms snap-ubuntu\x2dbudgie\x2dwelcome-492.mount
       750ms snap-yubioath\x2ddesktop-13.mount
       732ms grub-initrd-fallback.service
       726ms upower.service
       663ms systemd-oomd.service
       655ms [email protected]
       630ms systemd-modules-load.service
       623ms apport-autoreport.service
       617ms keyboard-setup.service
       567ms systemd-sysctl.service
       556ms systemd-random-seed.service
       546ms snap-zoom\x2dclient-218.mount
       495ms phpsessionclean.service
       467ms systemd-timesyncd.service
       430ms systemd-journald.service
       430ms snap-zoom\x2dclient-225.mount
       334ms systemd-udev-trigger.service
       330ms ufw.service
       300ms swapfile.swap
       278ms openvpn.service
       257ms systemd-update-utmp.service
       249ms kerneloops.service
       237ms sddm.service
       219ms systemd-binfmt.service
       214ms systemd-user-sessions.service
       180ms systemd-rfkill.service
       153ms systemd-remount-fs.service
       149ms systemd-fsck@dev-disk-by\x2duuid-69AE\x2d394C.service
       148ms dev-hugepages.mount
       147ms boot-efi.mount
       146ms dev-mqueue.mount
       142ms sys-kernel-debug.mount
       140ms sys-kernel-tracing.mount
       119ms kmod-static-nodes.service
       118ms [email protected]
       111ms [email protected]
       106ms [email protected]
        98ms var-snap-firefox-common-host\x2dhunspell.mount
        97ms rtkit-daemon.service
        80ms console-setup.service
        62ms proc-sys-fs-binfmt_misc.mount
        44ms setvtrgb.service
        33ms vboxautostart-service.service
        31ms snapd.socket
        30ms vboxballoonctrl-service.service
        27ms [email protected]
        25ms vboxweb-service.service
        24ms systemd-tmpfiles-setup-dev.service
        19ms alsa-restore.service
        14ms systemd-update-utmp-runlevel.service
        11ms modprobe@efi_pstore.service
         8ms sys-fs-fuse-connections.mount
         8ms sys-kernel-config.mount
         7ms [email protected]
         5ms modprobe@dm_mod.service
...skipping...
       140ms sys-kernel-tracing.mount
       119ms kmod-static-nodes.service
       118ms [email protected]
       111ms [email protected]
       106ms [email protected]
        98ms var-snap-firefox-common-host\x2dhunspell.mount
        97ms rtkit-daemon.service
        80ms console-setup.service
        62ms proc-sys-fs-binfmt_misc.mount
        44ms setvtrgb.service
        33ms vboxautostart-service.service
        31ms snapd.socket
        30ms vboxballoonctrl-service.service
        27ms [email protected]
        25ms vboxweb-service.service
        24ms systemd-tmpfiles-setup-dev.service
        19ms alsa-restore.service
        14ms systemd-update-utmp-runlevel.service
        11ms modprobe@efi_pstore.service
         8ms sys-fs-fuse-connections.mount
         8ms sys-kernel-config.mount
         7ms [email protected]
         5ms modprobe@dm_mod.service


答案1

查看您的 systemd-analyse 输出,加载大多数服务确实需要几分钟。

以下是我的工作站服务器的示例system-analyse --blame输出,供您参考。这是一台笔记本电脑,配有 2018 年的普通 i7 英特尔 CPU 和 SSD。

 7.676s apt-daily.service
 7.077s systemd-networkd-wait-online.service
 3.465s snap.lxd.activate.service
 3.376s snapd.service
 2.447s fwupd-refresh.service
  976ms ua-timer.service
  683ms systemd-tmpfiles-setup.service
  409ms dev-mapper-ubuntu\x2d\x2dvg\x2dubuntu\x2d\x2dlv.device
  329ms cloud-init-local.service
  329ms cloud-init.service
  300ms cloud-final.service
  296ms cloud-config.service
  281ms man-db.service
  271ms dev-loop5.device
  270ms dev-loop6.device
  266ms dev-loop3.device
  265ms dev-loop2.device
  263ms dev-loop4.device
  262ms dev-loop1.device
  256ms dev-loop0.device
  190ms systemd-resolved.service
  153ms snapd.apparmor.service
  148ms dev-hugepages.mount
  147ms dev-mqueue.mount
  145ms sys-kernel-debug.mount
  144ms sys-kernel-tracing.mount
  139ms keyboard-setup.service
  138ms kmod-static-nodes.service
  137ms lvm2-monitor.service
  133ms [email protected]
  132ms systemd-journald.service
  131ms [email protected]
  128ms modprobe@efi_pstore.service
  110ms udisks2.service

相关内容