我有一台华硕笔记本电脑(i7 5500U、8 GB RAM、1 TB HDD),启动 Ubuntu 16.04 需要很长时间(+30 秒)。我使用 Windows 10 进行双启动,这是购买时预装的。最近,我在另一台类似设置的笔记本电脑上安装了 16.04,我也有同样的感觉,它花费的时间比应有的时间要长。我有一台旧台式电脑,启动 ubuntu 16.04 所需的时间较短。
输出systemd-analyze blame
如下(只看前五个条目):
9.152s dev-sda6.device
5.908s systemd-fsck@dev-disk-by\x2duuid-feee34bb\x2df3a8\x2d4ce6\x2d93d5\x2df22a01f95edf.service
5.904s systemd-fsck@dev-disk-by\x2duuid-7876ae4d\x2da1e6\x2d413f\x2da917\x2d6f01418c255e.service
4.424s click-system-hooks.service
4.060s systemd-fsck@dev-disk-by\x2duuid-587F\x2d9A36.service
3.350s boot-efi.mount
2.845s NetworkManager.service
2.552s gpu-manager.service
2.314s thermald.service
2.238s ModemManager.service
2.225s accounts-daemon.service
1.999s systemd-udevd.service
1.251s keyboard-setup.service
999ms rsyslog.service
988ms systemd-tmpfiles-setup-dev.service
953ms grub-common.service
842ms udisks2.service
832ms polkitd.service
692ms irqbalance.service
677ms systemd-modules-load.service
637ms systemd-journald.service
612ms systemd-backlight@backlight:intel_backlight.service
568ms apparmor.service
564ms dev-sda7.swap
505ms systemd-rfkill.service
454ms rc-local.service
370ms dev-hugepages.mount
370ms colord.service
366ms systemd-tmpfiles-clean.service
363ms systemd-udev-trigger.service
348ms [email protected]
348ms systemd-sysctl.service
321ms apport.service
291ms home.mount
290ms networking.service
286ms ufw.service
258ms systemd-random-seed.service
242ms ondemand.service
240ms speech-dispatcher.service
235ms console-setup.service
228ms lightdm.service
226ms pppd-dns.service
222ms snapd.autoimport.service
221ms systemd-remount-fs.service
206ms upower.service
201ms systemd-update-utmp.service
196ms wpa_supplicant.service
185ms sys-kernel-debug.mount
185ms dev-mqueue.mount
174ms systemd-journal-flush.service
166ms kmod-static-nodes.service
154ms avahi-daemon.service
123ms systemd-logind.service
122ms systemd-timesyncd.service
110ms systemd-tmpfiles-setup.service
106ms setvtrgb.service
97ms opt.mount
51ms snapd.socket
12ms alsa-restore.service
7ms systemd-update-utmp-runlevel.service
6ms ureadahead-stop.service
4ms dns-clean.service
3ms resolvconf.service
3ms systemd-user-sessions.service
3ms rtkit-daemon.service
2ms plymouth-quit-wait.service
1ms sys-fs-fuse-connections.mount
/dev/sda6
是安装 Ubuntu 的位置(100 GB,已使用 10%)。第一次fsck
安装到 600 GB 分区(已使用 8%),第二次安装到另一个 100 GB 分区(已使用 26%),第三次安装到/boot/efi
100 MB 分区。硬盘大部分是空的,尽管安装和检查似乎占用了大部分启动时间。
我想我可以fsck
在启动时禁用完成,这是个好主意吗?这是文件/etc/fstab
:
`UUID=485c2bb5-53b5-421c-b826-284ce877b7ac / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=587F-9A36 /boot/efi vfat umask=0077 0 1
# /home was on /dev/sda9 during installation
UUID=feee34bb-f3a8-4ce6-93d5-f22a01f95edf /home ext4 defaults 0 2
# /opt was on /dev/sda8 during installation
UUID=7876ae4d-a1e6-413f-a917-6f01418c255e /opt ext4 defaults 0 2
# swap was on /dev/sda7 during installation
UUID=cc97a441-f71a-4cdd-99cb-a0f876b95f4d none swap sw 0 0`
我可以做些什么来缩短启动时间?以下是输出dmesg
:
...
[ 1.946809] usb 1-8: Product: USB2.0-CRW
[ 1.946810] usb 1-8: Manufacturer: Generic
[ 1.946812] usb 1-8: SerialNumber: 20100201396000000
[ 1.950312] usbcore: registered new interface driver rtsx_usb
[ 2.638502] clocksource: Switched to clocksource tsc
[ 2.880758] random: nonblocking pool is initialized
[ 3.096061] EXT4-fs (sda6): mounted filesystem with ordered data mode. Opts: (null)
[ 4.126998] systemd[1]: systemd 229 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN)
[ 4.127091] systemd[1]: Detected architecture x86-64.
[ 4.136656] systemd[1]: Set hostname to <FT-PC>.
[ 5.935687] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[ 5.935760] systemd[1]: Listening on udev Control Socket.
[ 5.935780] systemd[1]: Listening on Syslog Socket.
[ 5.935833] systemd[1]: Listening on Journal Audit Socket.
[ 5.935968] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[ 5.935985] systemd[1]: Listening on udev Kernel Socket.
[ 5.936011] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[ 5.936028] systemd[1]: Listening on Journal Socket (/dev/log).
[ 5.936089] systemd[1]: Created slice System Slice.
[ 5.936142] systemd[1]: Created slice system-systemd\x2dfsck.slice.
[ 5.936177] systemd[1]: Created slice User and Session Slice.
[ 5.936182] systemd[1]: Reached target Slices.
[ 5.936188] systemd[1]: Reached target User and Group Name Lookups.
[ 5.936211] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[ 5.936225] systemd[1]: Listening on fsck to fsckd communication Socket.
[ 5.936230] systemd[1]: Reached target Remote File Systems (Pre).
[ 5.936235] systemd[1]: Reached target Remote File Systems.
[ 5.936256] systemd[1]: Listening on Journal Socket.
[ 5.950620] systemd[1]: Starting Uncomplicated firewall...
[ 5.951033] systemd[1]: Starting Set console keymap...
[ 6.050548] systemd[1]: Starting Load Kernel Modules...
[ 6.050895] systemd[1]: Mounting Huge Pages File System...
[ 6.051218] systemd[1]: Started Read required files in advance.
[ 6.052129] systemd[1]: Started Braille Device Support.
[ 6.234547] systemd[1]: Starting Journal Service...
[ 6.235101] systemd[1]: Starting Create list of required static device nodes for the current kernel...
[ 6.235605] systemd[1]: Mounting Debug File System...
[ 6.235637] systemd[1]: Reached target Encrypted Volumes.
[ 6.236000] systemd[1]: Mounting POSIX Message Queue File System...
[ 6.237251] systemd[1]: Started Uncomplicated firewall.
[ 6.401312] systemd[1]: Started Create list of required static device nodes for the current kernel.
[ 6.410560] systemd[1]: Starting Create Static Device Nodes in /dev...
[ 6.421407] systemd[1]: Mounted POSIX Message Queue File System.
[ 6.421438] systemd[1]: Mounted Huge Pages File System.
[ 6.421454] systemd[1]: Mounted Debug File System.
[ 6.635911] lp: driver loaded but no devices found
[ 6.659893] ppdev: user-space parallel port driver
[ 6.728224] systemd[1]: Started Load Kernel Modules.
[ 6.738614] systemd[1]: Starting Apply Kernel Variables...
[ 6.739163] systemd[1]: Mounting FUSE Control File System...
[ 6.740821] systemd[1]: Mounted FUSE Control File System.
[ 6.871636] systemd[1]: Started Journal Service.
[ 9.638949] EXT4-fs (sda6): re-mounted. Opts: errors=remount-ro
[ 9.730314] systemd-journald[239]: Received request to flush runtime journal from PID 1
[ 10.170525] wmi: Mapper loaded
[ 10.380540] shpchp: Standard Hot Plug PCI Controller Driver version: 0.4
[ 11.252286] nvidia: module license 'NVIDIA' taints kernel.
[ 11.252289] Disabling lock debugging due to kernel taint
[ 11.255367] nvidia: module verification failed: signature and/or required key missing - tainting kernel
[ 11.258999] [drm] Initialized nvidia-drm 0.0.0 20150116 for 0000:04:00.0 on minor 1
[ 11.259003] NVRM: loading NVIDIA UNIX x86_64 Kernel Module 340.98 Mon Sep 19 17:31:03 PDT 2016
[ 11.334758] snd_hda_intel 0000:00:03.0: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[ 11.365793] snd_hda_codec_realtek hdaudioC1D0: autoconfig for ALC3236: line_outs=1 (0x14/0x0/0x0/0x0/0x0) type:speaker
[ 11.365797] snd_hda_codec_realtek hdaudioC1D0: speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[ 11.365799] snd_hda_codec_realtek hdaudioC1D0: hp_outs=1 (0x21/0x0/0x0/0x0/0x0)
[ 11.365801] snd_hda_codec_realtek hdaudioC1D0: mono: mono_out=0x0
[ 11.365803] snd_hda_codec_realtek hdaudioC1D0: inputs:
[ 11.365805] snd_hda_codec_realtek hdaudioC1D0: Mic=0x1b
[ 11.411000] input: HDA Intel PCH Headphone as /devices/pci0000:00/0000:00:1b.0/sound/card1/input14
[ 11.469965] input: HDA Intel HDMI HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:03.0/sound/card0/input15
[ 11.470031] input: HDA Intel HDMI HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:03.0/sound/card0/input16
[ 11.470091] input: HDA Intel HDMI HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:03.0/sound/card0/input17
[ 11.491363] AVX2 version of gcm_enc/dec engaged.
[ 11.491365] AES CTR mode by8 optimization enabled
[ 11.557015] wlan0: Broadcom BCM4365 802.11 Hybrid Wireless Controller 6.30.223.248 (r487574)
[ 11.953441] intel_rapl: Found RAPL domain package
[ 11.953444] intel_rapl: Found RAPL domain core
[ 11.953446] intel_rapl: Found RAPL domain uncore
[ 11.953448] intel_rapl: Found RAPL domain dram
[ 11.953451] intel_rapl: RAPL package 0 domain package locked by BIOS
[ 11.953455] intel_rapl: RAPL package 0 domain dram locked by BIOS
[ 13.149867] media: Linux media interface: v0.10
[ 13.176251] Linux video capture interface: v2.00
[ 13.366720] uvcvideo: Found UVC 1.00 device USB2.0 VGA UVC WebCam (04f2:b483)
[ 13.409704] input: USB2.0 VGA UVC WebCam as /devices/pci0000:00/0000:00:14.0/usb1/1-5/1-5:1.0/input/input18
[ 13.409764] usbcore: registered new interface driver uvcvideo
[ 13.409765] USB Video Class driver (1.1.1)
[ 13.641649] nvidia_uvm: Loaded the UVM driver, major device number 244
[ 13.663023] asus_wmi: ASUS WMI generic driver loaded
[ 13.682655] asus_wmi: Initialization: 0x1
[ 13.682682] asus_wmi: BIOS WMI version: 7.9
[ 13.682708] asus_wmi: SFUN value: 0xa0077
[ 13.683322] input: Asus WMI hotkeys as /devices/platform/asus-nb-wmi/input/input19
[ 13.684809] asus_wmi: Number of fans: 1
[ 14.002442] wl 0000:03:00.0 wlp3s0: renamed from wlan0
[ 14.424638] cfg80211: World regulatory domain updated:
[ 14.424640] cfg80211: DFS Master region: unset
[ 14.424641] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[ 14.424643] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[ 14.424645] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[ 14.424646] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
[ 14.424647] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
[ 14.424649] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
[ 14.424650] cfg80211: (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[ 14.424651] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[ 14.424652] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
[ 16.581361] Adding 15932412k swap on /dev/sda7. Priority:-1 extents:1 across:15932412k FS
[ 22.928982] EXT4-fs (sda9): mounted filesystem with ordered data mode. Opts: (null)
[ 23.295728] EXT4-fs (sda8): mounted filesystem with ordered data mode. Opts: (null)
[ 23.857502] audit: type=1400 audit(1482223027.611:2): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/sbin/dhclient" pid=878 comm="apparmor_parser"
[ 23.857510] audit: type=1400 audit(1482223027.611:3): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=878 comm="apparmor_parser"
[ 23.857515] audit: type=1400 audit(1482223027.611:4): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=878 comm="apparmor_parser"
[ 23.857520] audit: type=1400 audit(1482223027.611:5): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/connman/scripts/dhclient-script" pid=878 comm="apparmor_parser"
[ 23.857815] audit: type=1400 audit(1482223027.611:6): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/lightdm/lightdm-guest-session" pid=877 comm="apparmor_parser"
[ 23.857822] audit: type=1400 audit(1482223027.611:7): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/lightdm/lightdm-guest-session//chromium" pid=877 comm="apparmor_parser"
[ 23.858875] audit: type=1400 audit(1482223027.615:8): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/sbin/cups-browsed" pid=883 comm="apparmor_parser"
[ 23.859020] audit: type=1400 audit(1482223027.615:9): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/snapd/snap-confine" pid=882 comm="apparmor_parser"
[ 23.859029] audit: type=1400 audit(1482223027.615:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/snapd/snap-confine//mount-namespace-capture-helper" pid=882 comm="apparmor_parser"
[ 23.859974] audit: type=1400 audit(1482223027.615:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/sbin/ippusbxd" pid=885 comm="apparmor_parser"
[ 25.519197] bbswitch: version 0.8
[ 25.519203] bbswitch: Found integrated VGA device 0000:00:02.0: \_SB_.PCI0.GFX0
[ 25.519207] bbswitch: Found discrete VGA device 0000:04:00.0: \_SB_.PCI0.RP05.PEGP
[ 25.519214] ACPI Warning: \_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[ 25.519278] bbswitch: detected an Optimus _DSM function
[ 25.519286] bbswitch: Succesfully loaded. Discrete card 0000:04:00.0 is on
[ 26.126644] ACPI Warning: \_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[ 26.126684] ACPI Warning: \_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[ 26.126706] ACPI Warning: \_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[ 26.126726] ACPI Warning: \_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[ 26.126744] ACPI Warning: \_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[ 26.126763] ACPI Warning: \_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[ 26.126794] ACPI Warning: \_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[ 26.126813] ACPI Warning: \_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[ 26.142376] ACPI Warning: \_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[ 26.313515] ACPI Warning: \_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[ 26.316180] nvidia_uvm: Unregistered the UVM driver
[ 26.337260] [drm] Module unloaded
[ 26.355304] bbswitch: disabling discrete graphics
[ 26.355314] ACPI Warning: \_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[ 28.626111] Non-volatile memory driver v1.3
[ 28.866165] IPv6: ADDRCONF(NETDEV_UP): wlp3s0: link is not ready
[ 28.869189] IPv6: ADDRCONF(NETDEV_UP): enp2s0: link is not ready
[ 29.044820] r8169 0000:02:00.0 enp2s0: link down
[ 29.044882] IPv6: ADDRCONF(NETDEV_UP): enp2s0: link is not ready