今天早上启动我的 Ubuntu 20.04 时,花了 7 分钟多的时间:
systemd-analyze
Startup finished in 6.728s (firmware) + 2min 6.556s (loader) + 18.334s (kernel) + 4min 55.330s (userspace) = 7min 26.950s
graphical.target reached after 4min 51.146s in userspace
有时,我的系统启动速度会很慢。结果如下:
systemd-analyze blame:\
2min 25.524s plymouth-quit-wait.service
1min 25.990s systemd-journal-flush.service
1min 25.347s [email protected]
1min 16.195s upower.service
1min 422ms snapd.service
57.070s udisks2.service
37.890s dev-sda8.device
32.713s NetworkManager-wait-online.service
20.485s apache2.service
18.973s networkd-dispatcher.service
18.200s dev-loop27.device
17.939s dev-loop24.device
17.630s phpsessionclean.service
16.869s dev-loop23.device
16.844s dev-loop15.device
16.330s dev-loop14.device
16.210s dev-loop18.device
16.180s dev-loop11.device
16.162s dev-loop21.device
16.004s dev-loop26.device
15.943s dev-loop22.device
15.939s dev-loop25.device
15.652s dev-loop12.device
15.624s dev-loop20.device
15.604s dev-loop17.device
15.547s dev-loop13.device
15.433s dev-loop7.device
15.368s dev-loop19.device
14.728s systemd-random-seed.service
14.649s accounts-daemon.service
14.362s dev-loop0.device
14.009s dev-loop16.device
13.942s fwupd.service
13.763s dev-loop10.device
11.919s dev-loop4.device
11.908s polkit.service
11.754s dev-loop1.device
11.351s NetworkManager.service
11.309s dev-loop9.device
11.153s dev-loop8.device
10.945s dev-loop2.device
10.884s avahi-daemon.service
10.878s bluetooth.service
10.735s switcheroo-control.service
10.734s dev-loop5.device
10.719s thermald.service
10.717s systemd-logind.service
10.702s wpa_supplicant.service
10.455s dev-loop6.device
10.376s dev-loop3.device
10.143s [email protected]
8.581s systemd-tmpfiles-setup.service
8.334s gpu-manager.service
8.331s grub-common.service
7.101s grub-initrd-fallback.service
6.306s systemd-tmpfiles-clean.service
5.839s snap-android\x2dstudio-100.mount
5.733s systemd-udevd.service
5.712s snap-android\x2dstudio-99.mount
5.707s snap-bitwarden-40.mount
5.703s bolt.service
5.158s teamviewerd.service
4.970s tlp.service
4.626s systemd-fsck@dev-disk-by\x2duuid-9ec8f356\x2dc2e1\x2d4a3d\x2d835a\x2dc6ed3326ca8f.service
4.365s snap-core-10583.mount
4.360s snap-core-10823.mount
4.105s apport.service
4.008s ModemManager.service
3.959s systemd-tmpfiles-setup-dev.service
3.843s apparmor.service
3.797s snap-core18-1944.mount
3.737s secureboot-db.service
3.654s gdm.service
3.155s systemd-fsck@dev-disk-by\x2duuid-32D7\x2d94B3.service
2.841s snap-core18-1988.mount
2.745s snapd.seeded.service
2.741s snap-core20-875.mount
2.717s snap-core20-904.mount
2.716s snap-discord-120.mount
2.711s systemd-resolved.service
2.699s snap-discord-121.mount
2.655s snap-gnome\x2d3\x2d28\x2d1804-145.mount
2.608s snap-gnome\x2d3\x2d34\x2d1804-60.mount
2.578s snap-gnome\x2d3\x2d34\x2d1804-66.mount
2.561s snap-gtk\x2dcommon\x2dthemes-1513.mount
2.514s snap-gtk\x2dcommon\x2dthemes-1514.mount
2.500s snap-intellij\x2didea\x2dultimate-266.mount
2.434s snap-intellij\x2didea\x2dultimate-269.mount
2.397s snap-kde\x2dframeworks\x2d5\x2dqt\x2d5\x2d14\x2dcore18-4.mount
2.392s snap-netbeans-35.mount
2.386s snap-netbeans-41.mount
2.380s snap-postman-132.mount
2.375s snap-postman-133.mount
2.296s snap-snap\x2dstore-498.mount
1.883s e2scrub_reap.service
1.756s rtkit-daemon.service
1.747s rsyslog.service
1.697s systemd-sysctl.service
1.679s home.mount
1.543s systemd-remount-fs.service
1.440s snapd.apparmor.service
1.237s colord.service
1.159s plymouth-read-write.service
1.064s [email protected]
918ms systemd-user-sessions.service
887ms vboxweb.service
617ms systemd-backlight@backlight:intel_backlight.service
572ms systemd-journald.service
545ms systemd-sysusers.service
539ms keyboard-setup.service
465ms snap-snap\x2dstore-518.mount
461ms virtualbox.service
442ms plymouth-start.service
406ms pppd-dns.service
401ms setvtrgb.service
335ms systemd-udev-trigger.service
291ms [email protected]
270ms systemd-modules-load.service
260ms systemd-timesyncd.service
239ms snap-snapd-11036.mount
198ms dev-hugepages.mount
196ms dev-mqueue.mount
193ms sys-kernel-debug.mount
191ms sys-kernel-tracing.mount
186ms kmod-static-nodes.service
170ms snap-snapd-10707.mount
148ms [email protected]
145ms ufw.service
131ms snap-webstorm-189.mount
90ms console-setup.service
88ms [email protected]
81ms dev-disk-by\x2duuid-b2c295e5\x2deb17\x2d49a4\x2d95f3\x2d4322f4b6d092.swap
78ms systemd-update-utmp.service
73ms kerneloops.service
68ms boot-efi.mount
35ms systemd-update-utmp-runlevel.service
21ms openvpn.service
18ms tor.service
8ms nordvpnd.socket
6ms alsa-restore.service
5ms snapd.socket
5ms sys-fs-fuse-connections.mount
4ms sys-kernel-config.mount
关键链的结果
systemd-analyze critical-chaine
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 @4min 51.146s
└─multi-user.target @4min 40.998s
└─snapd.seeded.service @3min 3.716s +2.745s
└─snapd.service @2min 3.288s +1min 422ms
└─basic.target @2min 2.927s
└─sockets.target @2min 2.927s
└─snapd.socket @2min 2.919s +5ms
└─sysinit.target @2min 2.696s
└─systemd-timesyncd.service @2min 2.435s +260ms
└─systemd-tmpfiles-setup.service @1min 53.662s +8.581s
└─systemd-journal-flush.service @27.668s +1min 25.990s
└─systemd-remount-fs.service @26.117s +1.543s
└─systemd-journald.socket @25.929s
└─system.slice @25.915s
└─-.slice @25.915s
我怀疑这背后有漏洞。现在我的机器非常慢,打开应用程序也需要好几次。我还发现了一些从未在我的文件资源管理器上显示的已安装分区(efi、文件系统、主页)
:(https://postimg.cc/YvzjWZW9)
另外,昨天关闭我的机器时,也花了几分钟。我不明白这种行为,我没有安装/卸载任何东西,有时它运行完美且快速,但有时我会遇到这个问题。
这是我的配置:
- I5 7200U
- 8 颗 DDR4
- 硬盘
- 英特尔显卡 + Geforce 920MX(我使用的是英特尔)我的系统是与 Windows 10 双启动的。
有什么想法吗?谢谢。
编辑:我刚刚发现我的其他分区(C(Windows)、D、E)在“其他位置”上不可见。
答案1
编辑sudo nano /etc/default/grub
文件,之后“quiet splash”行应为“”,然后sudo update-grub
运行命令。现在您将看到启动消息以及启动过程的每个步骤中失败的位置。在如此长的启动时间内,您肯定会看到每个步骤中的延迟。如果您看到已提到的 i/o 错误,则驱动器准备死机。排序后再次编辑以替换已编辑的设置,然后更新以恢复图形屏幕。