最近将我的电脑从 Win10 换成了 Pop OS。注意到进入登录屏幕的时间明显变长了:之前感觉几乎是即时的,现在却需要 1 分钟以上。它从快速的 NVME M.2 启动,并配有 Ryzen 7-5800h,所以我知道这不是硬件限制。
在终端中进行了一些挖掘,这就是我发现的:
jianzen@dragon-7:~$ systemd-analyze
Startup finished in 5.520s (firmware) + 388ms (loader) + 4.798s (kernel) + 1min 37.591s (userspace) = 1min 48.299s
graphical.target reached after 1min 37.544s in userspace
jianzen@dragon-7:~$ systemd-analyze blame
6.388s NetworkManager-wait-online.service
5.102s plymouth-quit-wait.service
562ms docker.service
305ms accounts-daemon.service
274ms man-db.service
...
jianzen@dragon-7:~$ systemd-analyze critical-chain
The time when unit became active or started is printed after the "@" character.
The time the unit took to start is printed after the "+" character.
graphical.target @1min 37.544s
└─multi-user.target @1min 37.544s
└─docker.service @1min 36.981s +562ms
└─network-online.target @1min 36.950s
└─NetworkManager-wait-online.service @1min 30.560s +6.388s
└─NetworkManager.service @1min 30.483s +64ms
└─dbus.service @1min 30.481s
└─basic.target @1min 30.477s
└─sockets.target @1min 30.477s
└─cups.socket @1min 30.589s
└─sysinit.target @1min 30.443s
└─systemd-backlight@backlight:acpi_video0.service @1.820s +3ms
└─system-systemd\x2dbacklight.slice @1.819s
└─system.slice @130ms
└─-.slice @130ms
没有任何东西blame
指向罪魁祸首,并且critical-chain
它的瓶颈在于sysinit.target
,所以我真的不知道下一步该去哪里找出导致启动如此缓慢的原因。
编辑:澄清文件系统的附加信息。
jianzen@dragon-7:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
nvme1n1 259:0 0 931.5G 0 disk
├─nvme1n1p1 259:1 0 431.5G 0 part /mnt/SLibrary
└─nvme1n1p2 259:2 0 500G 0 part /mnt/Drive 2
nvme0n1 259:3 0 476.9G 0 disk
├─nvme0n1p1 259:4 0 3G 0 part /boot/efi
├─nvme0n1p2 259:5 0 30G 0 part /home
├─nvme0n1p3 259:6 0 30G 0 part [SWAP]
└─nvme0n1p4 259:7 0 413.9G 0 part /
jianzen@dragon-7:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
PARTUUID=1e9f9308-e092-4249-b178-4c1e61d9bd37 /boot/efi vfat umask=0077 0 0
UUID=375f4eac-da6d-4d87-a17a-aed548fe7961 /home ext4 noatime,errors=remount-ro 0 0
/dev/mapper/cryptswap none swap defaults 0 0
UUID=7f37168f-738f-475e-b593-237ccf58d0a5 / ext4 noatime,errors=remount-ro 0 0
/dev/disk/by-uuid/FCC2A5FFC2A5BE70 /mnt/Drive\0402 auto nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name=Drive%202 0 0
/dev/disk/by-uuid/6bee998f-b10b-4d1e-951a-a86b6d1b8b59 /mnt/SLibrary auto nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name=SLibrary 0 0
编辑铂。 2
运行dmesg
会出现以下错误(以及其他所有错误):
[ 0.240256] ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.PB2], AE_NOT_FOUND (20210930/dswload2-162)
[ 0.240269] ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20210930/psobject-220)
[ 0.839449] integrity: Problem loading X.509 certificate -65
[ 4.826083] ================================================================================
[ 4.826138] UBSAN: invalid-load in /build/linux-RFp8Q8/linux-5.16.19/drivers/net/wireless/mediatek/mt76/dma.c:162:13
[ 4.826199] load of value 103 is not a valid value for type '_Bool'
[ 98.377451] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
[ 114.634906] ================================================================================
[ 114.634914] UBSAN: invalid-load in /build/linux-RFp8Q8/linux-5.16.19/net/mac80211/status.c:1164:21
[ 114.634921] load of value 255 is not a valid value for type '_Bool'
[ 120.040061] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
[ 355.714107] TCP: wlp4s0: Driver has suspect GRO implementation, TCP performance may be compromised.
答案1
天哪,你有很多清单。
我来看看:
[0.240256] ACPI BIOS 错误(错误):无法解析符号 [_SB.PCI0.PB2],AE_NOT_FOUND (20210930/dswload2-162) [0.240269] ACPI 错误:AE_NOT_FOUND,在名称查找/目录期间 (20210930/psobject-220)
这并不严重,只是您的内核不支持某些 BIOS 功能。您可以忍受它或在acpi=off
启动时关闭 acpi。没什么大不了的。
[0.839449]完整性:加载X.509证书时出现问题-65
这个问题应该得到解决。您似乎正在通过 UEFI 启动,请检查影响。 (您必须签署启动过程和模块 - 请参阅签署内核模块)
[4.826138]UBSAN:/build/linux-RFp8Q8/linux-5.16.19/drivers/net/wireless/mediatek/mt76/dma.c:162:13中的无效负载[4.826199]值103的负载不是有效的类型“_Bool”的值 114.634914] UBSAN:/build/linux-RFp8Q8/linux-5.16.19/net/mac80211/status.c:1164:21 [114.634921] 值 255 的负载中的无效负载不是有效值对于类型“_Bool”
您的无线驱动程序有问题,可能存在一些错误,因为您看到值 103 或 255 不是_Bool
。可能有些东西没有被正确识别。您可以检查来源。
[98.377451][drm:nv_drm_master_set[nvidia_drm]]错误 [nvidia-drm] [GPU ID 0x00000100] 无法获取模式集所有权
啊 nvidia 专有驱动程序有问题。好吧,你必须寻找这个错误,这必须由 Nvidia 自己修复,因为你无法在此处检查源代码。尝试寻找它。可能是模块中存在一些错误nvidia-drm
。
[355.714107] TCP:wlp4s0:驱动程序有可疑的 GRO 实现,TCP 性能可能会受到影响。
这是尝试设置 GRO(通用接收卸载),但它不喜欢这些值。您可以检查您的内核是否有进入内核的 RH 修复程序。欲了解更多信息,请参阅司机怀疑 GRO 实施...
编辑:发布我在 Debian bookworm(配备 Intel(R) Core(TM) i5-8350U CPU 的 Intel 笔记本)上的启动速度:
systemd-analyze
Startup finished in 18.763s (firmware) + 7.674s (loader) + 13.889s (kernel) + 6.821s (userspace) = 47.148s
graphical.target reached after 6.795s in userspace
如果我必须猜测是什么消耗了你的启动时间,那就是 Nvidia 驱动程序。您可以尝试 Nouveau 驱动程序,看看引导是否有所改善。