Ubuntu 16.04 启动非常慢

Ubuntu 16.04 启动非常慢

我全新安装了 Ubuntu 16.04 和 Windows 10,并采用 UEFI 模式。安装时启动时间正常。安装后apt 升级,启动时间增加了。

输出systemd-analyze 责备

     24.771s dev-sda6.device
     12.795s systemd-udevd.service
      7.089s gpu-manager.service
      7.023s NetworkManager-wait-online.service
      6.925s systemd-tmpfiles-setup-dev.service
      4.919s systemd-sysctl.service
      3.829s snapd.service
      3.216s NetworkManager.service
      3.065s accounts-daemon.service
      2.955s ModemManager.service
      2.498s thermald.service
      2.008s udisks2.service
      1.954s systemd-modules-load.service
      1.863s keyboard-setup.service
      1.512s tlp.service
      1.325s grub-common.service
      1.030s systemd-journald.service
       909ms dev-hugepages.mount
       907ms dev-mqueue.mount
       906ms sys-kernel-debug.mount
       716ms systemd-fsck@dev-disk-by\x2duuid-445B\x2d8843.service
       700ms apparmor.service
       657ms ufw.service
       600ms console-setup.service
       570ms upower.service
       546ms systemd-tmpfiles-setup.service
       461ms rsyslog.service
       439ms kmod-static-nodes.service
       415ms irqbalance.service
       414ms wpa_supplicant.service
       349ms bluetooth.service
       316ms polkitd.service
       278ms colord.service
       215ms avahi-daemon.service
       201ms apport.service
       166ms snapd.socket
       159ms lightdm.service
       141ms plymouth-read-write.service
       135ms systemd-update-utmp.service
       132ms systemd-remount-fs.service
       111ms [email protected]
        91ms setvtrgb.service
        80ms boot-efi.mount
        80ms systemd-hostnamed.service
        78ms systemd-udev-trigger.service
        63ms networking.service
        62ms systemd-timesyncd.service
        47ms systemd-journal-flush.service
        36ms systemd-logind.service
        33ms ondemand.service
        28ms systemd-random-seed.service
        27ms speech-dispatcher.service
        15ms systemd-user-sessions.service
        14ms plymouth-start.service
        11ms alsa-restore.service
        10ms snapd.autoimport.service
        10ms pppd-dns.service
         6ms dns-clean.service
         4ms rtkit-daemon.service
         4ms ureadahead-stop.service
         4ms systemd-update-utmp-runlevel.service
         4ms resolvconf.service
         3ms sys-fs-fuse-connections.mount
         2ms rc-local.service
         1ms systemd-backlight@backlight:intel_backlight.service
         1ms plymouth-quit-wait.service
         1ms nvidia-persistenced.service

systemd-analyze 时间的输出:

Startup finished in 3.498s (firmware) + 3.332s (loader) + 6.081s (kernel) 
+ 3min 3.648s (userspace) = 3min 16.561s

系统信息:

Laptop
Memory: 8 GB
Processor: Intel® Core™ i5-8250U CPU @ 1.60GHz × 8
Graphic: Intel® Kabylake GT1.5 and NVIDIA MX150(disabled)

/etc/fstab 的内容

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5). 
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda6 during installation
# /boot/efi was on /dev/sda1 during installation
UUID=445B-8843  /boot/efi       vfat    umask=0077      0       1
# swap was on /dev/sda7 during installation
# UUID=96ded05b-556c-4459-9bcc-184ac5c21c2f none            swap    sw                  0       0
/dev/mapper/cryptswap1 none swap sw 0 0
UUID=8534b107-3576-4f00-9150-2081f1e2f430 / ext4 rw,relatime,data=ordered 0 1

答案1

呵呵,非常奇怪。

启动用时 3.498 秒(固件)+ 3.332 秒(加载器)+ 6.081 秒(内核)+ 3 分 3.648 秒(用户空间)= 3 分 16.561 秒

用户空间中什么花了 3 分钟?

还有这两个:

 24.771s dev-sda6.device
 12.795s systemd-udevd.service

我觉得启动磁盘驱动器时出了问题。磁盘出问题了吗?你在做什么不寻常的事吗etc/fstab?磁盘加密?

我首先要研究一下你的驱动器是如何安装的。

此外,微软花费了额外的时间和精力来搞乱多操作系统的安装。出于这个原因,我在笔记本电脑上只使用 Linux - 我有一台装有 Windows 的廉价台式机,用于兼容性测试。

UEFI 几乎就是{插入咆哮}。微软喜欢这个,因为它有很多好处。在 BIOS 中关闭 UEFI 可能会有帮助(但 Windows 可能会抱怨)。

相关内容