我的笔记本电脑是戴尔 G3 3500,配备 i5 第 10 代处理器和 120Hz 显示屏。内存为 8 GB,配备 256GB SSD + 1TB HDD 内存。B预装 Windows 10 Home(在 SSD 中)的 oot 时间约为 10 秒。 I dual boot my laptop with Ubuntu 20.04 Focal Release LTS (in HDD) and
bootime is 4sec (kernel) + 2min 24sec (userspace)
。
如何减少启动时间?我不确定如何配置。请指导一下。
终端输出如下:
ankur@ankur-G3-3500:~$ 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 @2min 23.008s
└─multi-user.target @2min 23.007s
└─php7.4-fpm.service @1min 43.177s +15.531s
└─network.target @1min 43.168s
└─NetworkManager.service @1min 35.788s +7.379s
└─dbus.service @1min 35.785s
└─basic.target @1min 35.580s
└─sockets.target @1min 35.580s
└─snapd.socket @1min 35.579s +591us
└─sysinit.target @1min 35.147s
└─systemd-timesyncd.service @1min 34.975s +171ms
└─systemd-tmpfiles-setup.service @1min 32.819s +1.901s
└─systemd-journal-flush.service @3.054s +19.738s
└─systemd-journald.service @2.708s +344ms
└─systemd-journald.socket @2.705s
└─-.mount @2.703s
└─system.slice @2.703s
└─-.slice @2.703s
ankur@ankur-G3-3500:~$ systemd-analyze
Startup finished in 3.688s (kernel) + 2min 23.534s (userspace) = 2min 27.222s
graphical.target reached after 2min 23.008s in userspace
ankur@ankur-G3-3500:~$ journalctl --disk-usage
Archived and active journals take up 4.0G in the file system.
ankur@ankur-G3-3500:~$ journalctl -b --unit systemd-journald
-- Logs begin at Tue 2020-12-15 18:31:38 IST, end at Tue 2021-01-12 17:01:18 IST. --
ankur-G3-3500 systemd-journald[312]: Journal started
ankur-G3-3500 systemd-journald[312]: Runtime Journal (/run/log/journal/09b452451b264a75a304b6a00a2c4733) is 8.0M, max 77.5M, 69.5M free.
ankur-G3-3500 systemd-journald[312]: Time spent on flushing to /var/log/journal/09b452451b264a75a304b6a00a2c4733 is 13.611366s for 934 entries.
ankur-G3-3500 systemd-journald[312]: System Journal (/var/log/journal/09b452451b264a75a304b6a00a2c4733) is 4.0G, max 4.0G, 0B free.
此外,终端输出systemd-analyze blame
如下:
ankur@ankur-G3-3500:~$ systemd-analyze blame
36.940s plymouth-quit-wait.service
21.963s php7.4-fpm.service
20.975s snapd.service
17.905s systemd-journal-flush.service
16.579s networkd-dispatcher.service
14.735s dev-sda4.device
13.926s NetworkManager-wait-online.service
13.925s udisks2.service
10.719s apport-autoreport.service
10.663s accounts-daemon.service
9.820s snapd.seeded.service
9.080s NetworkManager.service
8.595s polkit.service
7.795s bluetooth.service
7.795s avahi-daemon.service
7.697s dev-loop10.device
7.291s fwupd.service
7.250s dev-loop9.device
7.185s smartmontools.service
7.145s dev-loop14.device
7.012s switcheroo-control.service
6.971s thermald.service
6.969s wpa_supplicant.service
6.963s systemd-logind.service
6.925s dev-loop12.device
6.515s dev-loop17.device
6.466s dev-loop19.device
6.437s dev-loop5.device
6.029s dev-loop2.device
5.860s gdm.service
5.849s dev-loop0.device
5.816s dev-loop7.device
5.801s dev-loop13.device
5.435s dev-loop16.device
5.391s bolt.service
5.323s ModemManager.service
5.179s dev-loop11.device
5.013s dev-loop4.device
4.949s dev-loop15.device
4.910s dev-loop6.device
4.622s dev-loop18.device
4.243s dev-loop8.device
4.159s gpu-manager.service
4.125s grub-initrd-fallback.service
3.970s grub-common.service
3.575s dev-loop1.device
3.387s secureboot-db.service
3.364s dev-loop3.device
2.225s systemd-tmpfiles-setup.service
2.209s preload.service
2.186s rsyslog.service
1.903s systemd-fsck@dev-disk-by\x2duuid-0477ac9e\x2d193b\x2d4e88\x2dacf2\x2d1f7d62755a79.service
1.593s apport.service
1.430s lm-sensors.service
1.422s colord.service
1.216s systemd-udevd.service
1.194s upower.service
1.180s systemd-backlight@leds:dell::kbd_backlight.service
1.136s snapd.apparmor.service
1.047s apparmor.service
937ms systemd-random-seed.service
926ms snap-anbox-186.mount
919ms xfstt.service
820ms e2scrub_reap.service
743ms kerneloops.service
714ms snap-core-10577.mount
703ms plymouth-start.service
640ms pppd-dns.service
628ms systemd-tmpfiles-setup-dev.service
606ms snap-snapd-10707.mount
600ms snap-core-10583.mount
568ms systemd-sysctl.service
562ms snap-zoom\x2dclient-125.mount
544ms snap-zoom\x2dclient-124.mount
542ms snap-core18-1932.mount
538ms snap-core18-1944.mount
534ms tlp.service
533ms snap-snapd-10492.mount
528ms systemd-journald.service
522ms systemd-modules-load.service
499ms systemd-resolved.service
461ms keyboard-setup.service
460ms snap-snap\x2dstore-498.mount
452ms [email protected]
416ms systemd-tmpfiles-clean.service
373ms snap-jabref-903.mount
366ms snap-gnome\x2d3\x2d34\x2d1804-60.mount
365ms plymouth-read-write.service
353ms console-setup.service
310ms systemd-sysusers.service
295ms snap-gnome\x2d3\x2d28\x2d1804-145.mount
293ms snap-gnome\x2d3\x2d34\x2d1804-66.mount
292ms snap-gtk2\x2dcommon\x2dthemes-13.mount
291ms snap-gtk\x2dcommon\x2dthemes-1506.mount
272ms snap-shutter-27.mount
255ms snap-snap\x2dstore-518.mount
249ms systemd-timesyncd.service
244ms systemd-backlight@backlight:intel_backlight.service
231ms snap-gtk\x2dcommon\x2dthemes-1514.mount
220ms [email protected]
212ms phpsessionclean.service
205ms snap-jabref-814.mount
205ms systemd-udev-trigger.service
187ms dev-disk-by\x2duuid-74810b28\x2d0379\x2d406f\x2d99d1\x2dd49dc53c3148.swap
167ms openvpn.service
165ms sysstat.service
158ms home.mount
153ms systemd-remount-fs.service
126ms ufw.service
114ms dev-hugepages.mount
114ms dev-mqueue.mount
113ms sys-kernel-debug.mount
113ms sys-kernel-tracing.mount
111ms kmod-static-nodes.service
104ms systemd-user-sessions.service
58ms systemd-update-utmp.service
44ms [email protected]
40ms setvtrgb.service
31ms alsa-restore.service
24ms systemd-update-utmp-runlevel.service
8ms rtkit-daemon.service
2ms sys-fs-fuse-connections.mount
1ms sys-kernel-config.mount
906us snapd.socket