![为什么 lubuntu (和 Ubuntu) 18.04 启动很慢?](https://linux22.com/image/1011684/%E4%B8%BA%E4%BB%80%E4%B9%88%20lubuntu%20(%E5%92%8C%20Ubuntu)%2018.04%20%E5%90%AF%E5%8A%A8%E5%BE%88%E6%85%A2%EF%BC%9F.png)
全新安装(32 位,3GB RAM)的 Lubuntu 18.04:启动后运行效果非常好,速度很快(安装了所有需要的应用程序,如 LibreOffice 等),但是:
启动时:屏幕上显示大约 50 个错误,结尾为...翻转完成超时...
选择操作系统屏幕-我选择Ubuntu
黑屏:50 年代什么都没有
黑屏:间歇性磁盘活动 4分钟
显示的登录屏幕:登录非常快(大约 7 秒)。
进入锁定屏幕时也会出现这些长时间的延迟。
也许重复尝试超时会使速度变慢?
输出systemd-analyze blame
:
$ sudo systemd-analyze blame
1min 20.648s plymouth-start.service
8.853s keyboard-setup.service
8.079s systemd-journal-flush.service
7.440s dev-sda5.device
6.897s NetworkManager-wait-online.service
6.345s apt-daily-upgrade.service
5.244s systemd-udevd.service
5.193s systemd-sysctl.service
3.782s udisks2.service
3.415s NetworkManager.service
2.718s ModemManager.service
2.642s accounts-daemon.service
2.542s upower.service
2.415s grub-common.service
2.353s gpu-manager.service
2.321s networkd-dispatcher.service
1.819s systemd-random-seed.service
1.681s avahi-daemon.service
1.066s systemd-modules-load.service
798ms apparmor.service
718ms systemd-tmpfiles-setup-dev.service
687ms sys-kernel-debug.mount
683ms dev-hugepages.mount
682ms dev-mqueue.mount
681ms systemd-remount-fs.service
625ms polkit.service
558ms swapfile.swap
485ms systemd-resolved.service
479ms systemd-timesyncd.service
460ms apport.service
434ms pppd-dns.service
421ms lightdm.service
415ms rsyslog.service
413ms plymouth-quit-wait.service
405ms systemd-journald.service
400ms alsa-restore.service
399ms plymouth-read-write.service
383ms systemd-logind.service
358ms systemd-rfkill.service
329ms wpa_supplicant.service
325ms ufw.service
289ms kmod-static-nodes.service
148ms systemd-update-utmp.service
148ms [email protected]
同样使用systemd-analyze
时间:
Startup finished in 35.963s (kernel) + 1min 43.082s (userspace) = 2min 19.046s
graphical.target reached after 1min 43.069s in userspace
另外,内核循环和两个网络管理器行在以下内容中以红色显示:
$ sudo systemd-analyze critical-chain
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.
graphical.target @1min 43.069s
└─multi-user.target @1min 43.069s
└─kerneloops.service @1min 43.030s +36ms
└─network-online.target @1min 43.027s
└─NetworkManager-wait-online.service @1min 36.128s +6.897s
└─NetworkManager.service @1min 32.710s +3.415s
└─dbus.service @1min 32.333s
└─basic.target @1min 32.285s
└─paths.target @1min 32.285s
└─cups.path @1min 32.284s
└─sysinit.target @1min 32.247s
└─cryptsetup.target @1min 32.247s
└─systemd-ask-password-wall.path @2.743s
└─-.mount @2.650s
└─system.slice @2.677s
└─-.slice @2.650s
这现在是双启动机器:即 Lubuntu 18.04 32 位与之前的 Ubuntu 16.04 一起安装。我有点担心 Lubuntu 还没有创建自己的交换分区,无法访问 16.04 的交换分区?
$ sudo lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 5.6G 0 part
├─sda2 8:2 0 366.2G 0 part
├─sda3 8:3 0 1K 0 part
└─sda5 8:5 0 94G 0 part /
sr0 11:0 1 1024M 0 rom
答案1
该机器是 Dell Latitude D530 32 位,配备 Intel Mobile GM965/GL960 集成显卡。这个问题似乎相当普遍(原来是 Ubuntu 18.04 中的一个错误:错误 #1767808 - 启动板)
内核:4.15.0-43
首先我用它来检查延迟——在命令输出上用红色非常清楚地突出显示:
dmesg
然后我在网上搜索,找到了这个LM19 的启动时间非常长,而且出现错误信息 - Linux Mint 论坛
这解决了问题:编辑此文件:/etc/default/grub
将该行改为GRUB_CMDLINE_LINUX_DEFAULT=
:
GRUB_CMDLINE_LINUX_DEFAULT="video=SVIDEO-1:d quiet splash"
然后:
sudo update-grub
然后重启。现在一切都进行得非常快!