我对 Ubuntu 机器的启动有疑问。我的大约需要五分钟。首先我看到主板启动屏幕(我有 MSI),然后弹出一个屏幕:
[25.886013] usb 2-3: Falied to query (GET_INFO) UVC control 2 on unit 1: -32
之后我看到 Ubuntu 加载屏幕和加载点。有时,这些点会冻结,我的电脑会加载大约 3 分钟。这只是我的比较,还是 Ubuntu 中的一个错误?感谢您的任何回复。
systemd-analyze --blame
输出:
54.189s plymouth-quit-wait.service
37.130s mysql.service
27.610s systemd-journal-flush.service
23.314s snapd.service
20.256s e2scrub_reap.service
19.526s networkd-dispatcher.service
16.563s dev-sdb2.device
14.273s cups.service
14.120s gpu-manager.service
12.381s NetworkManager-wait-online.service
11.062s accounts-daemon.service
10.777s udisks2.service
9.986s ModemManager.service
9.539s dev-loop26.device
8.926s dev-loop14.device
8.291s dev-loop17.device
8.204s dev-loop8.device
8.166s dev-loop28.device
7.922s dev-loop15.device
7.910s dev-loop27.device
7.849s dev-loop30.device
7.832s dev-loop31.device
7.790s dev-loop13.device
7.670s dev-loop22.device
7.516s dev-loop16.device
7.463s dev-loop18.device
7.421s dev-loop25.device
7.188s dev-loop29.device
7.081s dev-loop9.device
7.008s dev-loop20.device
6.878s dev-loop21.device
6.724s dev-loop24.device
6.566s dev-loop19.device
6.563s polkit.service
6.560s power-profiles-daemon.service
6.539s dev-loop23.device
6.527s dev-loop11.device
6.445s systemd-sysctl.service
6.424s dev-loop12.device
6.188s dev-loop10.device
6.155s avahi-daemon.service
6.147s NetworkManager.service
5.839s dev-loop2.device
5.649s switcheroo-control.service
5.489s dev-loop5.device
5.278s snap-authy-22.mount
5.263s snap-bare-5.mount
5.246s thermald.service
5.241s wpa_supplicant.service
5.236s systemd-logind.service
5.122s snap-canonical\x2dlivepatch-246.mount
5.088s snap-chromium-2695.mount
5.006s dev-loop3.device
4.926s snap-chromium-2704.mount
4.874s snap-code-145.mount
4.858s snap-code-146.mount
4.814s snap-core-16202.mount
4.793s [email protected]
4.768s snap-core18-2790.mount
4.760s snap-core18-2796.mount
4.754s snap-core20-1974.mount
4.747s snap-core20-2015.mount
4.736s snap-core22-858.mount
4.729s snap-core22-864.mount
4.708s snap-cups-980.mount
4.640s snapd.apparmor.service
4.507s snap-discord-169.mount
4.377s dev-loop1.device
4.255s snap-discord-170.mount
4.179s dev-loop7.device
4.068s snap-firefox-3358.mount
4.060s snap-firefox-3504.mount
4.035s snap-gnome\x2d3\x2d28\x2d1804-198.mount
3.986s snap-gnome\x2d3\x2d38\x2d2004-143.mount
3.975s dev-loop6.device
3.943s snap-gnome\x2d42\x2d2204-132.mount
3.651s systemd-resolved.service
3.612s snap-gnome\x2d42\x2d2204-141.mount
3.543s dev-loop4.device
3.428s apport.service
3.022s dev-loop0.device
2.727s rsyslog.service
2.703s ssh.service
2.616s gdm.service
2.144s snap-gtk\x2dcommon\x2dthemes-1535.mount
2.128s apparmor.service
1.931s lm-sensors.service
1.860s snap-gtk\x2dtheme\x2dorchis-3.mount
1.776s systemd-udevd.service
1.769s packagekit.service
1.644s snap-ms\x2d365\x2delectron-4.mount
1.624s snap-qt515\x2dcore20-28.mount
1.611s snap-snapd-20092.mount
1.605s snap-snapd-20290.mount
1.587s snap-snapd\x2ddesktop\x2dintegration-83.mount
1.574s snap-ubuntu\x2dbudgie\x2dwelcome-480.mount
1.369s systemd-fsck@dev-disk-by\x2duuid-69AE\x2d394C.service
1.325s systemd-sysusers.service
1.124s systemd-modules-load.service
1.043s colord.service
932ms systemd-tmpfiles-setup.service
783ms systemd-oomd.service
648ms systemd-random-seed.service
623ms keyboard-setup.service
557ms alsa-restore.service
549ms systemd-udev-trigger.service
541ms systemd-tmpfiles-setup-dev.service
529ms snapd.seeded.service
521ms systemd-journald.service
512ms update-notifier-download.service
500ms swapfile.swap
491ms plymouth-start.service
472ms systemd-user-sessions.service
441ms snap-ubuntu\x2dbudgie\x2dwelcome-482.mount
437ms kerneloops.service
434ms [email protected]
423ms ua-timer.service
412ms openvpn.service
401ms grub-common.service
350ms dev-hugepages.mount
347ms dev-mqueue.mount
343ms sys-kernel-debug.mount
339ms sys-kernel-tracing.mount
334ms upower.service
323ms [email protected]
309ms kmod-static-nodes.service
309ms [email protected]
309ms [email protected]
307ms systemd-binfmt.service
269ms resolvconf-pull-resolved.service
259ms grub-initrd-fallback.service
242ms systemd-timesyncd.service
225ms phpsessionclean.service
219ms systemd-remount-fs.service
213ms console-setup.service
212ms geoclue.service
176ms ufw.service
161ms systemd-update-utmp.service
156ms boot-efi.mount
151ms plymouth-read-write.service
138ms systemd-tmpfiles-clean.service
133ms rtkit-daemon.service
125ms systemd-rfkill.service
98ms setvtrgb.service
93ms var-snap-firefox-common-host\x2dhunspell.mount
87ms proc-sys-fs-binfmt_misc.mount
36ms snapd.socket
30ms [email protected]
26ms motd-news.service
20ms [email protected]
8ms modprobe@efi_pstore.service
7ms sys-fs-fuse-connections.mount
6ms systemd-update-utmp-runlevel.service
6ms lightdm.service
6ms sys-kernel-config.mount
查看您的 systemd-analysis 输出,加载大多数服务确实需要几分钟的时间。
plymouth-quit-wait.service应该与所有其他服务并行运行,所以这不是时间所在。它负责你的开机动画画面。由于 plymouth-quit-wait.service + ubuntu 18.04 导致启动缓慢的问题
您似乎有mysql.service,您是否将它用于任何用途,即托管数据库?
systemd-journal-flush.service负责记录启动任务,禁用它会阻止您调试任何启动问题。systemd-journal-flush.service 有什么用?
snapd.service是一个包管理器,负责与其一起安装的所有包。考虑跑步
snap list
。清理 snap(或删除它或禁用其服务)也可以摆脱一些开发循环设备。请注意,软件包可能依赖于它。https://askubuntu.com/a/1056841/1749107e2scrub_reap.service负责一些存储驱动器操作。在这里阅读更多相关信息https://manpages.debian.org/testing/e2fsprogs/e2scrub.8.en.html。我不建议禁用它。
system-analyse --blame
这是我的工作站服务器的示例输出,供您参考。这是一款配备 2018 年常规 i7 intel CPU 和 SSD 的笔记本电脑。