我的电脑 10 次中有 9 次需要 ≅ 2 分钟才能关闭或重新启动。我尝试了很多事情,比如添加systemd
和/或shutdown
到 initcpio 钩子,但没有运气。
reboot -f
永远不会挂起,所以我按照这些步骤进行调试。添加选项/proc/cmdline后变为
initrd=\intel-ucode.img initrd=\initramfs-linux.img root=PARTUUID=d596f77d-aafa-479f-ad3c-df9e7c91fc7b rw quiet systemd.log_level=debug systemd.log_target=kmsg log_buf_len=1M printk.devkmsg=on enforcing=0
和debug.sh
#!/bin/sh
mount -o remount,rw /
dmesg > /shutdown-log.txt
mount -o remount,ro /
令我惊讶的是,这大大减少了挂起的次数,但我设法在重新启动时填写了shutdown-log.txt:https ://gist.github.com/MatTheCat/99498b006651110462f3488dcb454b40
这是重新启动正常时的shutdown-log.txt : https ://gist.github.com/MatTheCat/77f168927008bb0b886bb944d19337f1
电脑是戴尔 XPS 13 9380。
$ lspci
00:00.0 Host bridge: Intel Corporation Device 3e34 (rev 0b)
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 620 (Whiskey Lake)
00:04.0 Signal processing controller: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem (rev 0b)
00:08.0 System peripheral: Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th Gen Core Processor Gaussian Mixture Model
00:12.0 Signal processing controller: Intel Corporation Cannon Point-LP Thermal Controller (rev 30)
00:14.0 USB controller: Intel Corporation Cannon Point-LP USB 3.1 xHCI Controller (rev 30)
00:14.2 RAM memory: Intel Corporation Cannon Point-LP Shared SRAM (rev 30)
00:15.0 Serial bus controller [0c80]: Intel Corporation Device 9de8 (rev 30)
00:15.1 Serial bus controller [0c80]: Intel Corporation Device 9de9 (rev 30)
00:16.0 Communication controller: Intel Corporation Cannon Point-LP MEI Controller (rev 30)
00:1c.0 PCI bridge: Intel Corporation Device 9dbe (rev f0)
00:1d.0 PCI bridge: Intel Corporation Cannon Point-LP PCI Express Root Port (rev f0)
00:1d.4 PCI bridge: Intel Corporation Device 9db4 (rev f0)
00:1f.0 ISA bridge: Intel Corporation Cannon Point-LP LPC Controller (rev 30)
00:1f.3 Audio device: Intel Corporation Cannon Point-LP High Definition Audio Controller (rev 30)
00:1f.4 SMBus: Intel Corporation Cannon Point-LP SMBus Controller (rev 30)
00:1f.5 Serial bus controller [0c80]: Intel Corporation Cannon Point-LP SPI Controller (rev 30)
01:00.0 Network controller: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter (rev 32)
02:00.0 PCI bridge: Intel Corporation JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] (rev 02)
03:00.0 PCI bridge: Intel Corporation JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] (rev 02)
03:01.0 PCI bridge: Intel Corporation JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] (rev 02)
03:02.0 PCI bridge: Intel Corporation JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] (rev 02)
03:04.0 PCI bridge: Intel Corporation JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] (rev 02)
04:00.0 System peripheral: Intel Corporation JHL6540 Thunderbolt 3 NHI (C step) [Alpine Ridge 4C 2016] (rev 02)
38:00.0 USB controller: Intel Corporation JHL6540 Thunderbolt 3 USB Controller (C step) [Alpine Ridge 4C 2016] (rev 02)
6d:00.0 Non-Volatile memory controller: SK hynix Device 1527
$ lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 0489:e0a2 Foxconn / Hon Hai
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
似乎匹配https://bugs.archlinux.org/index.php?do=details&task_id=50420因为
[ 2144.333960] systemd-shutdown[1]: Sending SIGTERM to remaining
...
[ 2234.342297] systemd-shutdown[1]: Sending SIGKILL to PID 306 (lvmetad).
调查。
设置
use_lvmetad
为而0
不是/etc/lvm/lvm.conf可以解决此问题。我不知道发生了什么,所以我只希望这不会引起任何问题,因为我没有使用 LVM。1
我仍然愿意接受任何解释。
自从我写这篇文章以来已经有一段时间了,所以我试图重置
use_lvmetad
.大约十次重新启动后看不到任何问题。保持我的手指交叉。
我在 OpenSUSE Leap 15.1 上看到了类似的问题,我按照相同的说明进行操作,但关机日志从来没有任何有趣的东西 (*)。然而,我找到了另一种方法来查看在“达到目标关闭”之前哪些 systemd 作业仍然处于活动状态。我做到
systemctl enable debug-shell.service
了,在下一次启动时,我按下了 Ctrl+Alt+F9 进入 systemd 调试 shell,在那里我输入 了内容while true; do systemctl list-jobs | cat ; done
,以便它连续列出 systemd 作业(并且没有寻呼机)。然后在挂起一段时间的下一次重新启动/关机时,我再次切换到 VT9,我可以看到显然,这意味着 lvmetad 也是我的问题。我现在将尝试禁用它的解决方案,谢谢。我只是想提一下这种调试技术,以防其他人遇到这个问题,因为当 systemd 没有继续前进时,我们都想知道的一件事是“它仍在执行哪些作业?”
(*) 既然你提到它,日志确实有
Sending SIGKILL to PID 502 (lvmetad).
不幸的是,我没有解释为什么 lvmetad 行为不端。这台计算机有一个加密分区,根本不使用 LVM。
版本:lvm2-2.02.180-lp151.3.2.x86_64、systemd-234-lp151.25.7.x86_64
自从我安装了 openSuse Leap 15.1 后,我的笔记本电脑也遇到了同样的问题。这是我关闭电源的方法:
Ctrl+ Alt+F1
Alt+ PrtSc+O