我的 Ubuntu 16.04 Xenial 花费了很长时间来初始化,我不知道为什么,但它在一些推荐的更新之后启动了。
这是我的“/etc/default/grub”:
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
系统规格:
Processor: Intel® Core™ i5-3317U CPU @ 1.70GHz × 4
Memory: 7,7 GiB
Graphics: Intel® Ivybridge Mobile
OS type: 64-bit
Disk: 476,2 GB
我还有一个 NVIDIA 740M 视频板,但我没有使用它。
编辑 - -
systemd-分析
Startup finished in 3.767s (kernel) + 42.820s (userspace) = 46.587s
systemd-analyze 责备
9.882s dev-sda6.device
9.612s apparmor.service
9.377s plymouth-read-write.service
8.150s nmbd.service
7.525s samba-ad-dc.service
6.517s NetworkManager-wait-online.service
6.376s teamviewerd.service
2.231s thermald.service
2.219s NetworkManager.service
2.217s accounts-daemon.service
2.135s systemd-modules-load.service
1.807s ModemManager.service
1.799s systemd-udevd.service
1.530s plymouth-start.service
1.479s systemd-fsck@dev-disk-by\x2duuid-69da77aa\x2da78c\x2d4bbb\x2db9
1.394s gpu-manager.service
1.327s systemd-tmpfiles-setup-dev.service
1.222s grub-common.service
1.047s systemd-journald.service
1.027s keyboard-setup.service
1.005s upower.service
933ms dev-loop0.device
907ms console-setup.service
864ms networking.service
857ms lightdm.service
815ms systemd-backlight@backlight:intel_backlight.service
703ms udisks2.service
699ms ufw.service
684ms virtualbox.service
594ms dev-loop2.device
520ms systemd-logind.service
510ms systemd-sysctl.service
450ms home.mount
429ms systemd-rfkill.service
373ms polkitd.service
370ms snapd.autoimport.service
358ms smbd.service
347ms wpa_supplicant.service
347ms systemd-update-utmp.service
340ms iio-sensor-proxy.service
337ms colord.service
301ms sys-kernel-debug.mount
300ms dev-hugepages.mount
279ms systemd-tmpfiles-setup.service
273ms irqbalance.service
272ms dev-mqueue.mount
270ms systemd-journal-flush.service
248ms snap-core-1577.mount
241ms apport.service
230ms ondemand.service
229ms systemd-udev-trigger.service
228ms alsa-restore.service
226ms speech-dispatcher.service
216ms pppd-dns.service
215ms rsyslog.service
214ms systemd-user-sessions.service
198ms bluetooth.service
181ms avahi-daemon.service
166ms systemd-random-seed.service
158ms [email protected]
152ms systemd-remount-fs.service
148ms snap-anbox-15.mount
128ms dev-disk-by\x2duuid-f724534f\x2dff65\x2d42cc\x2da0c1\x2d244c45a
126ms systemd-timesyncd.service
106ms dns-clean.service
101ms setvtrgb.service
100ms snap-anbox\x2dinstaller-10.mount
92ms kmod-static-nodes.service
21ms resolvconf.service
16ms snapd.socket
6ms ureadahead-stop.service
4ms rc-local.service
3ms rtkit-daemon.service
3ms sys-kernel-config.mount
3ms systemd-update-utmp-runlevel.service
2ms sys-fs-fuse-connections.mount
1ms plymouth-quit-wait.service
479us dev-loop1.device
答案1
经过一周的时间查看系统故障,因为我的系统需要 3 分钟才能启动,1 分钟才能关闭,并问我为什么某些进程需要超过 3 秒才能启动,今天我尝试了以下操作:
在恢复中启动,然后选择“恢复启动”
我可以在不到 30 秒的时间内启动一个系统。
我谷歌了一下,发现有些用户因为图形问题不得不以恢复模式启动,然后才能恢复启动。作为解决方法,他们用“quiet splash nomodeset”更新了 GRUB。我照做了,
gksudo gedit /etc/default/grub
并在以下行中添加了“nomodeset”
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"
然后
sudo update-grub
结果是:
systemd-analyze
Startup finished in 7.603s (kernel) + 8.130s (userspace) = 15.734
答案2
这也许不是问题,甚至可能根本就无关,但我就是用这种方法解决的。
您可能在类似文件中包含一些命令,/etc/rc.local
或者在启动时运行 /etc/init .config 文件。
如果您确实在那里遇到了某些问题(并且在您所说的“推荐更新”之前就已经遇到了),那么很可能您需要检查其中的脚本/命令,并确保没有任何东西导致这个“很长时间”。
或者,如果您在尝试配置 grub 时在不同的文件中存在类似以下内容(见下文)或与 grub 的超级用户权限相关的任何内容,这也会导致相当长的启动时间:
set superusers="userA" password_pbkdf2 grub.<insanely long number or just normal password if you left pbkdf2 out>
如果类似的东西与一堆旧版本的文件结合在一起,它会减慢启动速度,我可以保证,因为它发生在我身上。
总之,如果其中一种情况与您的问题相似,那么它就与我的问题类似,唯一的解决方案是从 grub 配置中删除所有不必要的东西(我必须删除旧的 menu.lst 才能更快地启动)或修复启动时运行的文件中的代码。