我注意到我的设备在启动时变得越来越慢,即使我有 SSD,所以我试图挖掘它。
首先,我看到文件 resume 中有一个错误,将其更改为 resume=none。我看到了一点推动力。
在更改简历文件(一开始不存在)之前,加载时间为 5 37 秒,这很糟糕。
现在:用户空间 3 分钟 14.290 秒。
systemd-analyze time 892 11:00:03
Startup finished in 7.298s (firmware) + 3.630s (loader) + 2.673s (kernel) + 3min 688ms (userspace) = 3min 14.290s
graphical.target reached after 1min 38.373s in userspace
我试图看看它有什么问题,然后我看到了 dev-loop 设备。我不知道如何处理它,如果我能阻止它们,它是否会影响我的笔记本电脑)
systemd-analyze blame 893 11:00:10
7.517s plymouth-quit-wait.service
6.558s NetworkManager-wait-online.service
2.220s dev-sda6.device
2.053s snapd.service
891ms networkd-dispatcher.service
658ms dev-loop8.device
639ms dev-loop9.device
631ms dev-loop11.device
630ms dev-loop13.device
629ms dev-loop12.device
591ms dev-loop16.device
590ms dev-loop15.device
584ms dev-loop10.device
579ms dev-loop14.device
579ms dev-loop1.device
575ms dev-loop4.device
570ms dev-loop5.device
565ms dev-loop2.device
564ms dev-loop3.device
560ms dev-loop0.device
543ms snap-core18-1705.mount
541ms snap-vlc-1397.mount
540ms snap-heroku-3881.mount
528ms dev-loop7.device
526ms snap-gnome\x2dcharacters-399.mount
522ms systemd-backlight@backlight:intel_backlight.service
518ms dev-loop6.device
493ms dev-loop22.device
491ms dev-loop19.device
490ms dev-loop20.device
475ms dev-loop17.device
462ms dev-loop21.device
461ms snap-gtk\x2dcommon\x2dthemes-1440.mount
459ms dev-loop18.device
455ms systemd-logind.service
445ms snap-postman-102.mount
435ms udisks2.service
402ms snap-gnome\x2dcalculator-544.mount
393ms systemd-rfkill.service
389ms apparmor.service
351ms ModemManager.service
328ms snap-skype-115.mount
318ms upower.service
303ms accounts-daemon.service
293ms snap-core18-1668.mount
291ms systemd-journal-flush.service
287ms keyboard-setup.service
278ms NetworkManager.service
270ms snap-gnome\x2dcalculator-704.mount
263ms snap-musixmatch-18.mount
255ms snap-postman-103.mount
247ms snap-gnome\x2dlogs-81.mount
243ms grub-common.service
241ms snap-gnome\x2dsystem\x2dmonitor-127.mount
237ms snap-core-8689.mount
236ms systemd-udev-trigger.service
231ms plymouth-read-write.service
208ms snap-skype-118.mount
207ms fwupd.service
203ms [email protected]
201ms speech-dispatcher.service
186ms bluetooth.service
184ms snap-hello\x2dworld-29.mount
175ms snap-gtk\x2dcommon\x2dthemes-1474.mount
171ms systemd-journald.service
171ms apport.service
171ms gpu-manager.service
168ms snap-gnome\x2d3\x2d28\x2d1804-116.mount
156ms snap-core-8935.mount
155ms snap-gnome\x2dcharacters-495.mount
150ms wpa_supplicant.service
141ms snap-gnome\x2dlogs-93.mount
137ms snap-gnome\x2dsystem\x2dmonitor-135.mount
117ms avahi-daemon.service
114ms thermald.service
102ms systemd-resolved.service
99ms packagekit.service
92ms systemd-udevd.service
86ms systemd-timesyncd.service
84ms [email protected]
80ms systemd-backlight@leds:dell::kbd_backlight.service
77ms rsyslog.service
76ms bolt.service
74ms snapd.seeded.service
73ms polkit.service
73ms alsa-restore.service
49ms systemd-modules-load.service
49ms plymouth-start.service
48ms gdm.service
43ms systemd-fsck@dev-disk-by\x2duuid-105D\x2d71B7.service
41ms networking.service
40ms systemd-sysctl.service
35ms colord.service
35ms pppd-dns.service
33ms dns-clean.service
32ms systemd-tmpfiles-setup.service
27ms dev-disk-by\x2duuid-606cd432\x2d01a6\x2d4c87\x2dbdcf\x2d22c1d60
25ms dev-mqueue.mount
24ms systemd-tmpfiles-setup-dev.service
24ms systemd-remount-fs.service
24ms kerneloops.service
22ms kmod-static-nodes.service
21ms ufw.service
14ms boot-efi.mount
14ms sys-fs-fuse-connections.mount
13ms ureadahead-stop.service
12ms sys-kernel-config.mount
11ms systemd-update-utmp-runlevel.service
11ms systemd-update-utmp.service
9ms sys-kernel-debug.mount
8ms dev-hugepages.mount
8ms systemd-user-sessions.service
8ms rtkit-daemon.service
7ms console-setup.service
7ms systemd-random-seed.service
5ms setvtrgb.service
2ms snapd.socket
lines 95-117/117 (END)
我从 ubuntu 中删除了 snap 以查看对启动的影响。
systemd-analyze blame 973 09:42:30
29.641s apt-daily.service
8.675s plymouth-quit-wait.service
7.869s fstrim.service
6.578s NetworkManager-wait-online.service
6.166s apt-daily-upgrade.service
2.297s dev-sda6.device
919ms motd-news.service
722ms systemd-journal-flush.service
711ms systemd-backlight@backlight:intel_backlight.service
485ms upower.service
478ms apparmor.service
469ms networkd-dispatcher.service
426ms packagekit.service
409ms udisks2.service
394ms systemd-logind.service
380ms apport.service
379ms plymouth-read-write.service
348ms grub-common.service
316ms systemd-udevd.service
298ms systemd-rfkill.service
287ms speech-dispatcher.service
265ms ModemManager.service
252ms NetworkManager.service
245ms keyboard-setup.service
212ms fwupd.service
202ms systemd-udev-trigger.service
200ms [email protected]
191ms bluetooth.service
157ms systemd-journald.service
143ms avahi-daemon.service
137ms thermald.service
133ms alsa-restore.service
127ms bolt.service
118ms rng-tools.service
118ms accounts-daemon.service
105ms gpu-manager.service
100ms gdm.service
95ms pppd-dns.service
92ms plymouth-start.service
89ms systemd-timesyncd.service
85ms [email protected]
81ms wpa_supplicant.service
67ms systemd-resolved.service
66ms colord.service
59ms systemd-modules-load.service
55ms systemd-tmpfiles-setup-dev.service
54ms kerneloops.service
48ms systemd-fsck@dev-disk-by\x2duuid-105D\x2d71B7.service
48ms systemd-backlight@leds:dell::kbd_backlight.service
45ms dns-clean.service
44ms rsyslog.service
40ms networking.service
38ms dev-disk-by\x2duuid-606cd432\x2d01a6\x2d4c87\x2dbdcf\x2d22c1d60
35ms systemd-random-seed.service
34ms polkit.service
28ms systemd-remount-fs.service
26ms systemd-sysctl.service
26ms systemd-tmpfiles-setup.service
20ms systemd-user-sessions.service
20ms dev-mqueue.mount
19ms kmod-static-nodes.service
18ms ufw.service
17ms systemd-update-utmp.service
16ms dev-hugepages.mount
16ms ureadahead-stop.service
13ms sys-kernel-debug.mount
13ms sys-fs-fuse-connections.mount
12ms systemd-update-utmp-runlevel.service
11ms boot-efi.mount
9ms sys-kernel-config.mount
7ms console-setup.service
5ms rtkit-daemon.service
4ms setvtrgb.service
systemd-analyze critical-chain 975 09:44:43
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 39.346s
└─multi-user.target @1min 39.346s
└─kerneloops.service @1min 37.195s +54ms
└─network-online.target @1min 37.193s
└─NetworkManager-wait-online.service @1min 30.614s +6.578s
└─NetworkManager.service @1min 30.354s +252ms
└─dbus.service @1min 30.310s
└─basic.target @1min 30.238s
└─sockets.target @1min 30.238s
└─dbus.socket @1min 30.235s
└─sysinit.target @1min 30.229s
└─apparmor.service @2.594s +478ms
└─local-fs.target @2.585s
└─run-user-1000-gvfs.mount @1min 56.316s
└─run-user-1000.mount @1min 55.465s
└─local-fs-pre.target @454ms
└─keyboard-setup.service @209ms +245ms
└─systemd-journald.socket @196ms
└─system.slice @195ms
└─-.slice @192ms