我最近在 VIAO 笔记本电脑型号 VGN-NW270F 的硬盘上安装了 Ubuntu 20.04,与 Windows 10 实现双启动。一开始运行正常,但与 Win 10 PC 共享文件时遇到了很多麻烦。在此过程中,Ubuntu 开始需要很长时间才能启动 - 2-3 分钟。
我运行了 systemd-analyze 时间,结果如下:
Startup finished in 39.111s (kernel) + 2min 28.126s (userspace) = 3min 7.237s
graphical.target reached after 2min 28.047s in userspace
我运行了 systemd-analyze blame ,结果如下:
27.601s plymouth-quit-wait.service
16.406s dev-sda5.device
16.137s snapd.service
15.810s networkd-dispatcher.service
15.519s NetworkManager-wait-online.service
11.848s udisks2.service
10.759s accounts-daemon.service
10.315s dev-loop16.device
10.080s dev-loop10.device
9.854s dev-loop14.device
9.409s dev-loop13.device
9.199s dev-loop11.device
9.147s dev-loop17.device
9.098s dev-loop15.device
9.064s dev-loop12.device
8.803s dev-loop2.device
8.795s dev-loop9.device
7.894s dev-loop8.device
7.545s NetworkManager.service
7.467s dev-loop5.device
7.405s dev-loop6.device
6.757s avahi-daemon.service
6.653s dev-loop1.device
6.650s dev-loop3.device
6.649s dev-loop0.device
6.648s dev-loop4.device
6.644s dev-loop7.device
6.378s polkit.service
5.909s switcheroo-control.service
5.816s systemd-journal-flush.service
5.723s thermald.service
5.719s systemd-logind.service
5.713s wpa_supplicant.service
5.655s systemd-resolved.service
4.796s ModemManager.service
4.605s grub-common.service
4.233s rsyslog.service
4.064s gpu-manager.service
3.412s nmbd.service
2.913s systemd-udevd.service
2.633s e2scrub_reap.service
1.794s grub-initrd-fallback.service
1.739s smbd.service
1.484s colord.service
1.452s snap-chromium-1182.mount
1.372s snap-chromium-1192.mount
1.293s snap-core18-1705.mount
1.281s systemd-rfkill.service
1.276s apparmor.service
1.263s snap-core18-1754.mount
1.231s lm-sensors.service
1.229s snap-gnome\x2d3\x2d34\x2d1804-33.mount
1.214s systemd-tmpfiles-setup.service
1.183s upower.service
1.093s fwupd.service
1.090s home-rpederso-Ubuntu\x2dShare.mount
1.056s systemd-modules-load.service
937ms systemd-timesyncd.service
929ms snap-gnome\x2d3\x2d34\x2d1804-36.mount
881ms systemd-journald.service
843ms snap-gtk\x2dcommon\x2dthemes-1506.mount
823ms pppd-dns.service
715ms keyboard-setup.service
688ms snap-notepad\x2dplus\x2dplus-232.mount
674ms snap-notepad\x2dplus\x2dplus-234.mount
661ms snapd.apparmor.service
660ms snap-snap\x2dstore-433.mount
648ms systemd-tmpfiles-setup-dev.service
630ms swapfile.swap
606ms snap-snap\x2dstore-454.mount
603ms systemd-backlight@backlight:acpi_video0.service
578ms systemd-sysusers.service
558ms systemd-random-seed.service
544ms gdm.service
536ms snap-snapd-7264.mount
476ms systemd-udev-trigger.service
475ms snap-snapd-7777.mount
448ms systemd-sysctl.service
388ms plymouth-start.service
361ms [email protected]
334ms snap-vlc-1620.mount
310ms snap-wine\x2dplatform\x2d5\x2dstable-4.mount
301ms systemd-backlight@backlight:intel_backlight.service
299ms snap-wine\x2dplatform\x2d5\x2dstable-5.mount
296ms ufw.service
295ms openvpn.service
295ms [email protected]
260ms snap-wine\x2dplatform\x2druntime-136.mount
233ms snapd.seeded.service
200ms systemd-remount-fs.service
176ms dev-hugepages.mount
175ms dev-mqueue.mount
172ms sys-kernel-debug.mount
171ms sys-kernel-tracing.mount
167ms kmod-static-nodes.service
158ms snap-wine\x2dplatform\x2druntime-145.mount
134ms apport.service
91ms kerneloops.service
80ms console-setup.service
77ms hddtemp.service
73ms setvtrgb.service
71ms rtkit-daemon.service
65ms systemd-update-utmp.service
60ms systemd-tmpfiles-clean.service
56ms [email protected]
44ms systemd-user-sessions.service
35ms plymouth-read-write.service
28ms systemd-update-utmp-runlevel.service
21ms alsa-restore.service
9ms sys-kernel-config.mount
6ms sys-fs-fuse-connections.mount
1ms snapd.socket
有人能弄清楚发生了什么吗?知道哪些过程耗费了这么多时间吗?
答案1
我一直在网上搜索,偶然发现了这篇文章
http://ubuntuhandbook.org/index.php/2019/05/fix-slow-boot-ubuntu-18-04/
原来是我的交换分区出了问题。为了扩大根分区,我删除了旧的交换分区。旧的启动过程花了 1 分 30 秒寻找旧分区。