![Ubuntu 22.04 关机前卡住](https://linux22.com/image/1027194/Ubuntu%2022.04%20%E5%85%B3%E6%9C%BA%E5%89%8D%E5%8D%A1%E4%BD%8F.png)
我遇到的问题是,我的笔记本电脑既不能关机也不能重新启动 - 而且从安装后的第一次启动开始就没有正确运行过 - 它只是卡在某些随机的行上(抱歉只是手动写下屏幕输出):
systemd-shutdown[1]: Powering off.
或者
kvm: exiting hardware virtualization
或者
Worker [int] processing [...] is taking [...]
或者
[...] waiting for process: systemd-udevd, systemd-udevd, systemd-udevd [...]
输出也会打印(但在这些行之前):
[...]
[ OK ] Finished System Power Off.
[ OK ] Reached target System Power Off.
另外,我似乎没有注意到关机期间有任何故障
我从可启动的 USB 密钥安装了 Ubuntu Minimal(https://releases.ubuntu.com/22.04/ubuntu-22.04-desktop-amd64.iso),同时安装 Win11。
michael@go:~ $ sudo lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 4K 1 loop /snap/bare/5
loop1 7:1 0 61.9M 1 loop /snap/core20/1405
loop2 7:2 0 61.9M 1 loop /snap/core20/1518
loop3 7:3 0 155.6M 1 loop /snap/firefox/1232
loop4 7:4 0 400.8M 1 loop /snap/gnome-3-38-2004/112
loop5 7:5 0 248.8M 1 loop /snap/gnome-3-38-2004/99
loop6 7:6 0 81.3M 1 loop /snap/gtk-common-themes/1534
loop7 7:7 0 91.7M 1 loop /snap/gtk-common-themes/1535
loop8 7:8 0 45.9M 1 loop /snap/snap-store/575
loop9 7:9 0 45.9M 1 loop /snap/snap-store/582
loop10 7:10 0 43.6M 1 loop /snap/snapd/15177
loop11 7:11 0 47M 1 loop /snap/snapd/16010
loop12 7:12 0 284K 1 loop /snap/snapd-desktop-integration/10
loop13 7:13 0 284K 1 loop /snap/snapd-desktop-integration/14
sda 8:0 1 29.3G 0 disk
└─sda1 8:1 1 29.3G 0 part /media/michael/UBUNTU 22_0
mmcblk0 179:0 0 119.3G 0 disk /media/michael/SD_Storage
nvme0n1 259:0 0 119.2G 0 disk
├─nvme0n1p1 259:1 0 260M 0 part /boot/efi
├─nvme0n1p2 259:2 0 16M 0 part
├─nvme0n1p3 259:3 0 58.3G 0 part
├─nvme0n1p4 259:4 0 890M 0 part
└─nvme0n1p5 259:5 0 59.8G 0 part /
有趣的是,当我从 USB 密钥运行 Ubuntu(尝试 Ubuntu)时,笔记本电脑成功关闭(在要求移除安装介质后按回车键)。
我的硬件是 Microsoft Surface Go 2
michael@go:~ $ sudo lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 39 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Vendor ID: GenuineIntel
Model name: Intel(R) Core(TM) m3-8100Y CPU @ 1.10GHz
CPU family: 6
Model: 142
Thread(s) per core: 2
Core(s) per socket: 2
Socket(s): 1
Stepping: 9
CPU max MHz: 3400.0000
CPU min MHz: 400.0000
BogoMIPS: 3199.92
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse
36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb
rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopo
logy nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl
vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic
movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm
3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stib
p tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bm
i1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_p
t xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_noti
fy hwp_act_window hwp_epp md_clear flush_l1d arch_capabilities
Virtualization features:
Virtualization: VT-x
Caches (sum of all):
L1d: 64 KiB (2 instances)
L1i: 64 KiB (2 instances)
L2: 512 KiB (2 instances)
L3: 4 MiB (1 instance)
NUMA:
NUMA node(s): 1
NUMA node0 CPU(s): 0-3
Vulnerabilities:
Itlb multihit: KVM: Mitigation: VMX disabled
L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnera
ble
Mds: Mitigation; Clear CPU buffers; SMT vulnerable
Meltdown: Mitigation; PTI
Mmio stale data: Mitigation; Clear CPU buffers; SMT vulnerable
Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Spectre v2: Mitigation; Retpolines, IBPB conditional, IBRS_FW, STIBP conditional,
RSB filling
Srbds: Mitigation; Microcode
Tsx async abort: Not affected
图形:
michael@go:~ $ sudo lspci | grep -i vga
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 615 (rev 02)
00:13.0 Non-VGA unclassified device: Intel Corporation Sunrise Point-LP Integrated Sensor Hub (rev 21)
目前
michael@go:~ $ uname -r
5.15.0-40-generic
我很快就拿到了一台搭载英特尔奔腾 CPU 的 Surface Go 2 型号。系统关闭并成功重启。
在我的研究过程中,我尝试了不同的 grub 配置(acpi=force、apm=power_off),尽管说实话,我不确定它们实际上起了什么作用。
我还看到一篇帖子建议禁用 kvm 和 kvm_intel 模块,我也尝试过,但没有成功。
我没什么主意了,所以也许有人有主意。告诉我缺少什么信息来获得线索。
问候,迈克尔
答案1
我在安装 Debian 时连续两天遇到了这个问题,我尝试了最常见的解决方案,它们是:卸载并将 kvm 模块列入黑名单。错误尚未修复,我仍然收到以下错误:
systemd-shutdown[1]: Powering off.
或者
kvm: exiting hardware virtualization
或者
Worker [int] processing [...] is taking [...]
或者
[...] waiting for process: systemd-udevd, systemd-udevd, systemd-udevd [...]
我能够解决这个错误,我所做的是卸载并列入黑名单内置(在我的例子中,nouveau 适用于 debian 或基于 debian 的发行版)
首先打开终端并复制整个命令以卸载并将 nouveau 驱动程序列入黑名单(确保您知道哪些是您的 GPU 的专有驱动程序):
cat <<EOF | sudo tee /etc/modprobe.d/blacklist-nouveau.conf
blacklist nouveau
blacklist lbm-nouveau
options nouveau modeset=0
alias nouveau off
alias lbm-nouveau off
EOF
按回车键,然后再次复制:
echo options nouveau modeset=0 | sudo tee -a /etc/modprobe.d/nouveau-kms.conf
sudo update-initramfs -u
然后用专有 gpu 驱动程序替换命令,在我的情况下是英伟达:
sudo apt install nvidia-detect
sudo nvidia-detect
sudo apt install [detected-driver-name]
或者
sudo apt install nvidia-driver
之后,我就可以关机或重启,没有任何问题
如果你正在使用 nvidia 显卡,我推荐你使用这个页面https://docs.kinetica.com/7.1/install/nvidia_deb/,以下是卸载和将 nouveau 列入黑名单并替换为专有驱动程序的步骤