Ubuntu 16.04 启动速度非常慢且元素损坏

Ubuntu 16.04 启动速度非常慢且元素损坏

以下是输出的前几项system-analyze blame,这是在内核更新后出现的,我认为这是一个漏洞systemd-udev-settle启动需要花费很多时间,但我使用 LVM 并且无法禁用该服务:

1min 29.939s systemd-udev-settle.service
         13.102s NetworkManager-wait-online.service
          4.053s apt-daily.service
          3.121s upower.service
          2.812s apt-daily-upgrade.service
           733ms nmbd.service
           700ms media-I.mount
           647ms media-F.mount
           617ms dictd.service
           616ms irqbalance.service
           610ms ondemand.service
           610ms grub-common.service
           606ms plymouth-start.service
           599ms sysfsutils.service
           597ms apport.service
           592ms speech-dispatcher.service
           473ms dev-mapper-ubuntuvg\x2droot.device
           445ms lvm2-activation-early.service
           385ms lvm2-activation.service
           379ms vboxdrv.service
           274ms lvm2-activation-net.service
           230ms ModemManager.service
           187ms accounts-daemon.service

显然,有些地方出了问题。它启动到维护模式的一半,我必须按ctrl+D才能继续完成启动过程。一些错误消息来自这里journalctl -xb(完整记录可以找到这里):

-- The start-up result is done.
Nov 04 20:25:48 QC5-ubuntu kernel: Intel(R) Wireless WiFi driver for Linux
Nov 04 20:25:48 QC5-ubuntu kernel: Copyright(c) 2003- 2015 Intel Corporation
Nov 04 20:25:48 QC5-ubuntu kernel: iwlwifi 0000:04:00.0: enabling device (0000 -> 0002)
Nov 04 20:25:48 QC5-ubuntu kernel: iwlwifi 0000:04:00.0: Direct firmware load for iwlwifi-8000C-26.ucode failed with error -2
Nov 04 20:25:48 QC5-ubuntu kernel: iwlwifi 0000:04:00.0: Direct firmware load for iwlwifi-8000C-25.ucode failed with error -2
Nov 04 20:25:48 QC5-ubuntu kernel: iwlwifi 0000:04:00.0: Direct firmware load for iwlwifi-8000C-24.ucode failed with error -2
Nov 04 20:25:48 QC5-ubuntu kernel: iwlwifi 0000:04:00.0: Direct firmware load for iwlwifi-8000C-23.ucode failed with error -2
Nov 04 20:25:48 QC5-ubuntu kernel: iwlwifi 0000:04:00.0: Direct firmware load for iwlwifi-8000C-22.ucode failed with error -2
Nov 04 20:25:48 QC5-ubuntu systemd-udevd[588]: failed to execute '/lib/udev/usb-db' 'usb-db /devices/pci0000:00/0000:00:14.0/usb1/1-13': No such file or directory
Nov 04 20:25:48 QC5-ubuntu kernel: iwlwifi 0000:04:00.0: loaded firmware version 21.302800.0 op_mode iwlmvm
Nov 04 20:25:48 QC5-ubuntu kernel: nvidia-uvm: Loaded the UVM driver in 8 mode, major device number 241
Nov 04 20:25:48 QC5-ubuntu mtp-probe[575]: checking bus 1, device 7: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-10"
Nov 04 20:25:48 QC5-ubuntu mtp-probe[589]: checking bus 1, device 9: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-11"
Nov 04 20:25:48 QC5-ubuntu mtp-probe[575]: bus: 1, device: 7 was not an MTP device
Nov 04 20:25:48 QC5-ubuntu kernel: wmi: Mapper loaded
Nov 04 20:25:48 QC5-ubuntu mtp-probe[589]: bus: 1, device: 9 was not an MTP device
Nov 04 20:25:48 QC5-ubuntu mtp-probe[615]: checking bus 1, device 5: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-9"
Nov 04 20:25:48 QC5-ubuntu mtp-probe[612]: checking bus 1, device 3: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-8"
Nov 04 20:25:48 QC5-ubuntu mtp-probe[615]: bus: 1, device: 5 was not an MTP device
Nov 04 20:25:48 QC5-ubuntu mtp-probe[612]: bus: 1, device: 3 was not an MTP device
Nov 04 20:25:48 QC5-ubuntu kernel: Non-volatile memory driver v1.3
Nov 04 20:25:48 QC5-ubuntu kernel: thinkpad_acpi: ThinkPad ACPI Extras v0.25
Nov 04 20:25:48 QC5-ubuntu kernel: thinkpad_acpi: http://ibm-acpi.sf.net/
Nov 04 20:25:48 QC5-ubuntu kernel: thinkpad_acpi: ThinkPad BIOS N1EET73W (1.46 ), EC unknown
Nov 04 20:25:48 QC5-ubuntu kernel: thinkpad_acpi: Lenovo ThinkPad P50, model 20ENCTO1WW
Nov 04 20:25:48 QC5-ubuntu kernel: thinkpad_hwmon thinkpad_hwmon: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
Nov 04 20:25:48 QC5-ubuntu kernel: thinkpad_acpi: radio switch found; radios are enabled
Nov 04 20:25:48 QC5-ubuntu kernel: random: crng init done
Nov 04 20:25:48 QC5-ubuntu kernel: thinkpad_acpi: This ThinkPad has standard ACPI backlight brightness control, supported by the ACPI video driver
Nov 04 20:25:48 QC5-ubuntu kernel: thinkpad_acpi: Disabling thinkpad-acpi brightness events by default...
Nov 04 20:25:48 QC5-ubuntu kernel: thinkpad_acpi: rfkill switch tpacpi_bluetooth_sw: radio is unblocked

...

- The start-up result is done.
Nov 04 20:25:48 QC5-ubuntu kernel: ACPI Warning: \_SB.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20160930/nsarguments-95)
Nov 04 20:25:48 QC5-ubuntu systemd-udevd[697]: failed to execute '/lib/udev/usb-db' 'usb-db /devices/pci0000:00/0000:00:14.0/usb1/1-13/1-13:1.0': No such file or directory
Nov 04 20:25:48 QC5-ubuntu kernel: RAPL PMU: API unit is 2^-32 Joules, 5 fixed counters, 655360 ms ovfl timer
Nov 04 20:25:48 QC5-ubuntu kernel: RAPL PMU: hw unit of domain pp0-core 2^-14 Joules
Nov 04 20:25:48 QC5-ubuntu kernel: RAPL PMU: hw unit of domain package 2^-14 Joules
Nov 04 20:25:48 QC5-ubuntu kernel: RAPL PMU: hw unit of domain dram 2^-14 Joules
Nov 04 20:25:48 QC5-ubuntu kernel: RAPL PMU: hw unit of domain pp1-gpu 2^-14 Joules
Nov 04 20:25:48 QC5-ubuntu kernel: RAPL PMU: hw unit of domain psys 2^-14 Joules
Nov 04 20:25:48 QC5-ubuntu kernel: media: Linux media interface: v0.10

...

-- Unit systemd-rfkill.service has begun starting up.
Nov 04 20:25:49 QC5-ubuntu kernel: ieee80211 phy0: Selected rate control algorithm 'iwl-mvm-rs'
Nov 04 20:25:49 QC5-ubuntu kernel: (NULL device *): hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
Nov 04 20:25:49 QC5-ubuntu kernel: thermal thermal_zone3: failed to read out thermal zone (-5)
Nov 04 20:25:49 QC5-ubuntu systemd[1]: Found device PNY_CS1311_480GB_SSD EFI\x20system\x20partition.
-- Subject: Unit dev-disk-by\x2duuid-6226\x2d94B9.device has finished start-up
-- Defined-By: systemd

...

Nov 04 20:25:50 QC5-ubuntu systemd[1]: Failed to start Braille Device Support.
-- Subject: Unit brltty.service has failed

...

-- Subject: Unit dev-mapper-ubuntuvg\x2dhome.device has failed

...

-- Unit dev-mapper-ubuntuvg\x2dhome.device has failed.
-- Unit home.mount has failed.
-- The result is dependency.
Nov 04 20:27:18 QC5-ubuntu systemd[1]: Dependency failed for Local File Systems.
-- Subject: Unit local-fs.target has failed
-- Defined-By: systemd

...

set_control:1461: Cannot write control '2:0:0:Clock Source 10 Validity:0' : Operation not permitted
Nov 04 20:28:48 QC5-ubuntu systemd[1]: [email protected]: Control process exited, code=exited status=1
Nov 04 20:28:48 QC5-ubuntu systemd[1]: Failed to start Anonymizing overlay network for TCP.
-- Subject: Unit [email protected] has failed

...

-- Subject: Unit [email protected] has failed
-- Unit [email protected] has failed.
Nov 04 20:28:48 QC5-ubuntu systemd[1]: Failed to start LSB: start Samba NetBIOS nameserver (nmbd).
-- Subject: Unit nmbd.service has failed
-- Unit nmbd.service has failed.

...

USB 端口出现故障(我使用的是 DisplayLink USB 3.0 底座,似乎与此有关)、Tor 网络(如何在启动时禁用它?)、蓝牙和 Samba NetBIOS……第一个错误可能与我曾经在启动时将平板电脑连接到底座有关,而现在我不再插入它了。我不知道是否可以重新配置启动设置并让机器自动找到工作端口?网络管理器也存在问题。网络管理器需要很长时间才能启动,但真的吗?它需要互联网才能启动?所以,我检查哪些服务使用它:

$ systemctl show network-online.target | grep -E 'WantedBy|Before'
WantedBy=whoopsie.service samba-ad-dc.service nmbd.service apt-daily.timer smbd.service
Before=whoopsie.service nmbd.service smbd.service rc-local.service apt-daily.timer samba-ad-dc.service snapd.refresh.service

我的电脑是 Thinkpad P50。操作系统是 Ubuntu 16.04.3,内核为 4.10.0-38。我也有一些日志输出Reddit供你参考。

谢谢!

答案1

尝试屏蔽该systemd-udev-settle服务:

sudo systemctl mask systemd-udev-settle.service

相关内容