Ubuntu 20.04 启动大约需要 2.5 分钟

Ubuntu 20.04 启动大约需要 2.5 分钟

以下是该命令的结果systemd-analyze

Startup finished in 5.359s (kernel) + 1min 55.199s (userspace) = 2min 559ms
graphical.target reached after 1min 53.510s in userspace

请告诉我如何减少这个时间。我最近(一周前)安装了 ubuntu 20.04 并从 Windows 转移到了 Linux。

的输出systemd-analyze blame

1min 15.371s plymouth-quit-wait.service
     21.162s dev-sda5.device
     20.968s snapd.service
     18.507s networkd-dispatcher.service
     16.409s NetworkManager-wait-online.service
     14.704s udisks2.service
     14.419s systemd-journal-flush.service
     13.434s dev-loop15.device
     13.030s dev-loop13.device
     13.015s dev-loop14.device
     12.317s dev-loop4.device
     12.310s dev-loop10.device
     11.607s dev-loop11.device
     11.528s dev-loop12.device
     11.273s dev-loop8.device
     11.231s dev-loop9.device
     10.697s dev-loop7.device
     10.413s accounts-daemon.service
      9.316s dev-loop2.device
      9.212s dev-loop1.device
      8.789s dev-loop6.device
      8.433s dev-loop5.device
      8.088s dev-loop3.device
      7.922s dev-loop0.device
      7.854s avahi-daemon.service
      7.841s bluetooth.service
      7.798s NetworkManager.service
      7.439s polkit.service
      7.152s systemd-resolved.service
      6.830s switcheroo-control.service
      6.797s thermald.service
      6.770s systemd-logind.service
      6.769s wpa_supplicant.service
      6.123s apport-autoreport.service
      4.622s ModemManager.service
      4.310s fwupd.service
      4.028s apport.service
      3.938s gpu-manager.service
      3.834s grub-common.service
      3.408s rsyslog.service
      3.040s systemd-udevd.service
      2.802s e2scrub_reap.service
      2.794s upower.service
      2.506s systemd-journald.service
      2.329s gdm.service
      1.977s systemd-timesyncd.service
      1.685s apparmor.service
      1.652s tlp.service
      1.646s grub-initrd-fallback.service
      1.309s systemd-sysctl.service
      1.153s systemd-tmpfiles-setup.service
       935ms systemd-modules-load.service
       931ms snapd.apparmor.service
       918ms lm-sensors.service
       834ms systemd-random-seed.service
       814ms geoclue.service
       803ms snap-canonical\x2dlivepatch-95.mount
       798ms snap-core-9436.mount
       795ms snap-core18-1705.mount
       761ms systemd-udev-trigger.service
       758ms snap-core18-1754.mount
       680ms snap-gnome\x2d3\x2d28\x2d1804-128.mount
       656ms [email protected]
       649ms swapfile.swap
       642ms pppd-dns.service
       612ms snap-gnome\x2d3\x2d34\x2d1804-24.mount
       604ms keyboard-setup.service
       560ms snap-gnome\x2d3\x2d34\x2d1804-36.mount
       557ms systemd-sysusers.service
       518ms snap-gtk\x2dcommon\x2dthemes-1506.mount
       471ms snap-mpg123\x2dcm-21.mount
       459ms systemd-tmpfiles-setup-dev.service
       452ms snap-snap\x2dstore-433.mount
       427ms snap-snap\x2dstore-467.mount
       417ms plymouth-start.service
       381ms [email protected]
       381ms kerneloops.service
       376ms snap-snapd-7264.mount
       365ms hddtemp.service
       361ms snap-snapd-8140.mount
       315ms colord.service
       291ms dev-hugepages.mount
       288ms dev-mqueue.mount
       288ms systemd-tmpfiles-clean.service
       284ms sys-kernel-debug.mount
       281ms sys-kernel-tracing.mount
       277ms ufw.service
       265ms snapd.seeded.service
       264ms kmod-static-nodes.service
       238ms openvpn.service
       237ms snap-vlc-1700.mount
       233ms console-setup.service
       230ms snap-standard\x2dnotes-10.mount
       195ms systemd-user-sessions.service
       182ms systemd-backlight@backlight:radeon_bl0.service
       176ms snap-stellarium\x2ddaily-152.mount
       159ms systemd-fsck@dev-disk-by\x2duuid-016D\x2d2379.service
       158ms systemd-remount-fs.service
       134ms plymouth-read-write.service
       116ms [email protected]
       114ms systemd-backlight@backlight:acpi_video0.service
       110ms systemd-update-utmp.service
        77ms setvtrgb.service
        68ms rtkit-daemon.service
        65ms boot-efi.mount
        45ms systemd-update-utmp-runlevel.service
        43ms alsa-restore.service
        25ms sys-fs-fuse-connections.mount
        14ms sys-kernel-config.mount
         6ms snapd.socket

这些是该命令的图像systemd-analyze plot > ~/SystemdAnalyzePlot.svg

https://i.stack.imgur.com/EXcC1.png

https://i.stack.imgur.com/ZnUKY.png

的结果systemd-analyze critical-chain

graphical.target @1min 22.613s
└─multi-user.target @1min 22.611s
  └─snapd.seeded.service @49.338s +210ms
    └─snapd.service @27.294s +22.036s
      └─basic.target @26.230s
        └─sockets.target @26.230s
          └─snapd.socket @26.219s +10ms
            └─sysinit.target @25.902s
              └─systemd-timesyncd.service @23.836s +2.065s
                └─systemd-tmpfiles-setup.service @23.116s +660ms
                  └─local-fs.target @23.087s
                    └─run-snapd-ns-canonical\x2dlivepatch.mnt.mount @43.350s
                      └─run-snapd-ns.mount @39.627s
                        └─local-fs-pre.target @5.484s
                          └─systemd-tmpfiles-setup-dev.service @5.120s +363ms
                            └─systemd-sysusers.service @4.604s +513ms
                              └─systemd-remount-fs.service @4.137s +191ms
                                └─systemd-journald.socket @3.897s
                                  └─-.mount @3.866s
                                    └─system.slice @3.866s
                                      └─-.slice @3.866s

答案1

  1. sudo nano /etc/default/grub
  2. 找到此行 GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
  3. 更改为 GRUB_CMDLINE_LINUX_DEFAULT="quiet"
  4. sudo update-grub

重启

答案2

让我们首先检查您的文件系统是否有错误。

要检查 Ubuntu 分区上的文件系统...启动到 GRUB 菜单 > 选择高级选项 > 选择恢复模式 > 选择 Root 访问权限和fsck -f /dev/sda5

如果有错误,请重复 fsck 命令 > 输入 reboot

答案3

尝试运行启动修复,这会自动修复大多数启动问题,以下是如何安装它以及它的作用的链接https://help.ubuntu.com/community/Boot-Repair

相关内容