SSD 上的 18.04 启动缓慢

SSD 上的 18.04 启动缓慢

最近我在启动时间方面遇到了很多麻烦。我正在运行 Kubuntu 18.04,在 SSD 上启动总是需要一分钟以上的时间。

我设置了一个要使用的交换文件,它在运行时显示出来

sudo swapon --show

我有在这里指责输出

systemd-analyze blame
     34.052s systemd-timesyncd.service
     33.978s systemd-resolved.service
      2.518s NetworkManager-wait-online.service
       676ms dev-sda5.device
       585ms systemd-logind.service
       364ms udisks2.service
       347ms nvidia-persistenced.service
       312ms swapfile.swap
       300ms mpd.service
       223ms upower.service
       188ms NetworkManager.service
       133ms systemd-journal-flush.service
       120ms systemd-modules-load.service
       119ms snapd.service
       107ms systemd-hostnamed.service
        94ms networkd-dispatcher.service
        70ms keyboard-setup.service
        67ms systemd-fsck@dev-disk-by\x2duuid-D653\x2dC926.service
        61ms systemd-udev-trigger.service
        55ms accounts-daemon.service
        47ms apport.service
        47ms grub-common.service
        42ms systemd-udevd.service
        39ms systemd-journald.service
        39ms ModemManager.service
        36ms systemd-tmpfiles-setup-dev.service
        35ms thermald.service

之前安装我的硬盘需要 30 秒,但后来我将其从 fstab 中删除了。

现在是启动时间

systemd-analyze time 
Startup finished in 7.746s (firmware) + 4.859s (loader) + 35.728s (kernel) + 37.950s (userspace) = 1min 26.285s
graphical.target reached after 37.946s in userspace    

知道我应该做什么吗?

小更新:我又重启了,以下是我的新责任和时间

systemd-analyze blame
      2.510s NetworkManager-wait-online.service
       961ms dev-sda5.device
       619ms systemd-logind.service
       358ms nvidia-persistenced.service
       348ms swapfile.swap
       262ms udisks2.service
       254ms NetworkManager.service
       223ms upower.service
       185ms mpd.service
       184ms systemd-fsck@dev-disk-by\x2duuid-D653\x2dC926.service
       167ms systemd-timesyncd.service
       154ms systemd-resolved.service
       144ms snapd.service
       128ms systemd-journal-flush.service
       127ms systemd-modules-load.service
       124ms networkd-dispatcher.service
       103ms apparmor.service
        80ms systemd-tmpfiles-setup.service
        76ms systemd-udev-trigger.service
        74ms grub-common.service
        65ms keyboard-setup.service
        47ms ModemManager.service
        46ms apport.service
        42ms systemd-journald.service
        42ms accounts-daemon.service
        41ms wpa_supplicant.service
        37ms systemd-udevd.service

systemd-analyze time
Startup finished in 10.518s (firmware) + 4.899s (loader) + 35.676s (kernel) + 38.337s (userspace) = 1min 29.432s
graphical.target reached after 38.333s in userspace

好的,我将 grub 设置为noresume,这是重启时的新数字。

systemd-analyze blame    
     33.853s systemd-fsck@dev-disk-by\x2duuid-D653\x2dC926.service
      2.543s NetworkManager-wait-online.service
      1.157s dev-sda5.device
       606ms systemd-logind.service
       542ms snapd.service
       385ms dev-loop0.device
       358ms udisks2.service
       358ms nvidia-persistenced.service
       343ms dev-loop1.device
       318ms swapfile.swap
       298ms mpd.service
       286ms systemd-journal-flush.service
       226ms upower.service
       195ms NetworkManager.service
       189ms systemd-resolved.service
       144ms systemd-timesyncd.service
       118ms systemd-modules-load.service
       107ms media-ku\x2dgames.mount
        82ms networkd-dispatcher.service
        72ms systemd-udevd.service
        68ms snap-discord-79.mount
        65ms keyboard-setup.service
        58ms grub-common.service
        54ms ModemManager.service
        52ms systemd-udev-trigger.service
        44ms accounts-daemon.service
        39ms apparmor.service

systemd-analyze time
Startup finished in 10.680s (firmware) + 3.405s (loader) + 3.226s (kernel) + 38.169s (userspace) = 55.482s
graphical.target reached after 38.165s in userspace

答案1

问题出在我的 nvidia 驱动程序上,我删除了我的 nvidia 驱动程序,然后我又将它们添加回来,但使用 nvidia 的 .run,现在已修复。

答案2

我想说的是,这个错误一开始很令人沮丧,因为我不知道这是一个真正的错误,我以为快速启动是“windows 的事情”,幸运的是好奇心战胜了我

您似乎受到了这个错误的影响:https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1763611

修复

为了修复它,您必须修改位于此处:/etc/initramfs-tools/conf.d/resume并确保值如下:RESUME=none

确保您应用了设置sudo update-initramfs -u

修复改进后

systemd-analyze time
Startup finished in 2.195s (kernel) + 11.663s (userspace) = 13.858s
graphical.target reached after 11.649s in userspace

之前大概是 50 年代

参考

该答案也位于错误页面上,但它也位于此处:

相关内容