![Debian 双启动后启动时间过长(现已删除)](https://linux22.com/image/885182/Debian%20%E5%8F%8C%E5%90%AF%E5%8A%A8%E5%90%8E%E5%90%AF%E5%8A%A8%E6%97%B6%E9%97%B4%E8%BF%87%E9%95%BF%EF%BC%88%E7%8E%B0%E5%B7%B2%E5%88%A0%E9%99%A4%EF%BC%89.png)
发行版:Ubuntu 16.04 LTS(最小),以 i3 作为窗口管理器。
输出systemd-analyze
:
Startup finished in 11.412s (kernel) + 3min 2.797s (userspace) = 3min 14.209s
输出systemd-analyze critical-analyze
:
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 37.581s
└─multi-user.target @1min 37.573s
└─getty.target @1min 37.570s
└─[email protected] @1min 37.567s
└─rc-local.service @1min 37.436s +9ms
└─network.target @1min 37.423s
└─wpa_supplicant.service @1min 38.892s +1.846s
└─basic.target @1min 32.554s
└─sockets.target @1min 32.554s
└─dbus.socket @1min 32.553s
└─sysinit.target @1min 32.549s
└─systemd-timesyncd.service @13.304s +272ms
└─systemd-tmpfiles-setup.service @12.526s +591ms
└─local-fs.target @12.458s
└─run-user-1000.mount @1min 50.082s
└─local-fs-pre.target @4.841s
└─systemd-tmpfiles-setup-dev.service @3.032s +1.787s
└─kmod-static-nodes.service @2.644s +219ms
└─system.slice @2.454s
└─-.slice @2.438s
输出systemd-analyze blame
:
9.328s dev-sda5.device
4.698s ufw.service
4.381s NetworkManager.service
3.395s ModemManager.service
3.391s accounts-daemon.service
2.271s systemd-udevd.service
2.086s systemd-rfkill.service
1.846s wpa_supplicant.service
1.787s systemd-tmpfiles-setup-dev.service
1.619s keyboard-setup.service
1.480s networking.service
1.450s systemd-journald.service
1.371s grub-common.service
1.332s console-setup.service
1.307s lightdm.service
1.104s systemd-modules-load.service
1.079s resolvconf.service
1.023s systemd-logind.service
982ms avahi-daemon.service
866ms systemd-remount-fs.service
848ms systemd-udev-trigger.service
820ms dev-mqueue.mount
772ms binfmt-support.service
728ms colord.service
713ms polkitd.service
707ms ondemand.service
705ms plymouth-start.service
660ms dev-hugepages.mount
659ms rsyslog.service
651ms sys-kernel-debug.mount
630ms systemd-sysctl.service
622ms gdomap.service
591ms systemd-tmpfiles-setup.service
563ms systemd-journal-flush.service
524ms systemd-random-seed.service
509ms sysstat.service
445ms systemd-user-sessions.service
436ms pppd-dns.service
371ms systemd-update-utmp.service
347ms home.mount
272ms systemd-timesyncd.service
244ms plymouth-read-write.service
231ms systemd-update-utmp-runlevel.service
219ms kmod-static-nodes.service
208ms systemd-backlight@backlight:intel_backlight.service
146ms [email protected]
126ms systemd-backlight@backlight:eeepc.service
89ms alsa-restore.service
71ms setvtrgb.service
59ms proc-sys-fs-binfmt_misc.mount
54ms rtkit-daemon.service
52ms systemd-tmpfiles-clean.service
36ms sys-fs-fuse-connections.mount
33ms ureadahead-stop.service
15ms plymouth-quit-wait.service
9ms rc-local.service
(可能的)负责任的候选人:
sysinit.target @1min 32.549s
run-user-1000.mount @1min 50.082s
问题:
对于如何减少上述候选人的时间,有什么想法吗?
此外,如果我的解释有误,请有人纠正我。
答案1
发现问题了。
由于启动时间太长,我想检查一下幕后发生了什么。因此,我将文件中的以下行/etc/default/grub
从:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
到
GRUB_CMDLINE_LINUX_DEFAULT=
下次重新启动时,发现启动过程卡在:
[* ] 启动作业正在... 设备... 磁盘... 上运行
因此,重启后,我打开了文件/etc/fstab
并运行了命令sudo blkid
。结果发现,在安装 Debian 期间,我的交换分区被格式化了,因此它的 UUID 也发生了变化。
我将UUID
中的值更改/etc/fstab
为从中获得的当前值sudo blkid
,现在我的系统可以正常启动。