5.19.0-41-generic
我在外部 NVME SSD 驱动器。这是 USB 设备,根据lsusb
:
Bus 002 Device 002: ID 0bda:9210 Realtek Semiconductor Corp. RTL9210 M.2 NVME Adapter
我使用的笔记本电脑有 Intel CPU 和专用的 Nvidia GPU(以及集成的 Intel GPU)。v525 非免费驱动程序已安装ubuntu-drivers install nvidia:525
。它有 8GiB 的 RAM。
我可以正常启动操作系统,甚至可以挂起到 RAM(睡眠)但挂起到磁盘(休眠)似乎不起作用。操作系统安装在加密的 LVM 分区上,设置如下:
$ lsblk
sdb 8:16 0 119.2G 0 disk
├─sdb1 8:17 0 512M 0 part /boot/efi
├─sdb2 8:18 0 1.7G 0 part /boot
└─sdb3 8:19 0 67.1G 0 part
└─sda3_crypt 253:0 0 67.1G 0 crypt
├─vgkubuntu-root 253:1 0 50G 0 lvm /var/snap/firefox/common/host-hunspell
│ /
├─vgkubuntu-home 253:2 0 4G 0 lvm /home
└─vgkubuntu-swap 253:3 0 11G 0 lvm [SWAP]
$ cat /etc/crypttab
sda3_crypt UUID=7e297f18-38c5-4a2f-b5fc-a46f42b5418a none luks,discard
我通过以下步骤启用了休眠模式本指南:
- 配置交换分区
/dev/vgkubuntu/swap
,并将其添加到fstab
- 已添加
resume=UUID=fc1fc4b9-09c9-4198-bb11-b13846491b4f
到GRUB_CMDLINE_LINUX_DEFAULT=
/etc/default/grub
- 创建
/etc/initramfs-tools/conf.d/resume
文件RESUME=UUID=fc1fc4b9-09c9-4198-bb11-b13846491b4f
内容为 - 运行
update-grub
,update-initramfs -c -k all
然后重新启动
当我按下 KDE 开始菜单上的休眠按钮时,笔记本电脑可以正常关闭,但恢复时,我看到一个带有鼠标光标的黑屏(这是在我被提示输入 LUKS 密码之后)。偶尔,此错误行会短暂出现,然后消失:
[ 159.380884] I/O error, dev sdb, sector 25607104 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
我不得不强行关闭机器才能正常启动。恢复后磁盘似乎无法写入。这是journalctl
我能找到的最后日志:
May 05 22:16:20 HOSTNAME ModemManager[996]: <info> [sleep-monitor] system is about to suspend
May 05 22:16:20 HOSTNAME NetworkManager[889]: <info> [1683299780.9345] manager: sleep: sleep requested (sleeping: no enabled: yes)
May 05 22:16:20 HOSTNAME NetworkManager[889]: <info> [1683299780.9347] device (enp3s0): state change: unavailable -> unmanaged (reason 'sleeping', sys-iface-state: 'managed')
May 05 22:16:20 HOSTNAME NetworkManager[889]: <info> [1683299780.9379] device (p2p-dev-wlp2s0): state change: disconnected -> unmanaged (reason 'sleeping', sys-iface-state: 'managed')
May 05 22:16:20 HOSTNAME NetworkManager[889]: <info> [1683299780.9385] manager: NetworkManager state is now ASLEEP
May 05 22:16:20 HOSTNAME NetworkManager[889]: <info> [1683299780.9389] device (wlp2s0): state change: activated -> deactivating (reason 'sleeping', sys-iface-state: 'managed')
May 05 22:16:20 HOSTNAME dbus-daemon[887]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' requested by ':1.12' (uid=0 pid=889 comm="/usr/sbin/NetworkManager --no-daemon " label="unconfined")
May 05 22:16:20 HOSTNAME systemd[1]: Starting Network Manager Script Dispatcher Service...
May 05 22:16:20 HOSTNAME dbus-daemon[887]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
May 05 22:16:20 HOSTNAME systemd[1]: Started Network Manager Script Dispatcher Service.
May 05 22:16:20 HOSTNAME kernel: wlp2s0: deauthenticating from 1c:3b:f3:2f:d3:08 by local choice (Reason: 3=DEAUTH_LEAVING)
May 05 22:16:21 HOSTNAME wpa_supplicant[923]: wlp2s0: CTRL-EVENT-DISCONNECTED bssid=1c:3b:f3:2f:d3:08 reason=3 locally_generated=1
May 05 22:16:21 HOSTNAME wpa_supplicant[923]: wlp2s0: CTRL-EVENT-DSCP-POLICY clear_all
May 05 22:16:21 HOSTNAME NetworkManager[889]: <info> [1683299781.0595] device (wlp2s0): supplicant interface state: completed -> disconnected
May 05 22:16:21 HOSTNAME NetworkManager[889]: <info> [1683299781.0597] device (wlp2s0): state change: deactivating -> disconnected (reason 'sleeping', sys-iface-state: 'managed')
May 05 22:16:21 HOSTNAME avahi-daemon[884]: Withdrawing address record for fe80::765c:abc2:2e9:d572 on wlp2s0.
May 05 22:16:21 HOSTNAME avahi-daemon[884]: Leaving mDNS multicast group on interface wlp2s0.IPv6 with address fe80::765c:abc2:2e9:d572.
May 05 22:16:21 HOSTNAME avahi-daemon[884]: Interface wlp2s0.IPv6 no longer relevant for mDNS.
May 05 22:16:21 HOSTNAME NetworkManager[889]: <info> [1683299781.0748] dhcp4 (wlp2s0): canceled DHCP transaction
May 05 22:16:21 HOSTNAME NetworkManager[889]: <info> [1683299781.0748] dhcp4 (wlp2s0): activation: beginning transaction (timeout in 45 seconds)
May 05 22:16:21 HOSTNAME NetworkManager[889]: <info> [1683299781.0748] dhcp4 (wlp2s0): state changed no lease
May 05 22:16:21 HOSTNAME avahi-daemon[884]: Withdrawing address record for 192.168.0.159 on wlp2s0.
May 05 22:16:21 HOSTNAME avahi-daemon[884]: Leaving mDNS multicast group on interface wlp2s0.IPv4 with address 192.168.0.159.
May 05 22:16:21 HOSTNAME avahi-daemon[884]: Interface wlp2s0.IPv4 no longer relevant for mDNS.
May 05 22:16:21 HOSTNAME systemd-resolved[822]: wlp2s0: Bus client set default route setting: no
May 05 22:16:21 HOSTNAME systemd-resolved[822]: wlp2s0: Bus client reset DNS server list.
May 05 22:16:21 HOSTNAME NetworkManager[889]: <info> [1683299781.1436] device (wlp2s0): set-hw-addr: reset MAC address to B4:D5:BD:DD:EA:D7 (scanning)
May 05 22:16:21 HOSTNAME NetworkManager[889]: <info> [1683299781.1464] device (wlp2s0): state change: disconnected -> unmanaged (reason 'sleeping', sys-iface-state: 'managed')
May 05 22:16:21 HOSTNAME wpa_supplicant[923]: p2p-dev-wlp2s0: CTRL-EVENT-DSCP-POLICY clear_all
May 05 22:16:21 HOSTNAME wpa_supplicant[923]: p2p-dev-wlp2s0: CTRL-EVENT-DSCP-POLICY clear_all
May 05 22:16:21 HOSTNAME wpa_supplicant[923]: nl80211: deinit ifname=p2p-dev-wlp2s0 disabled_11b_rates=0
May 05 22:16:21 HOSTNAME systemd[1]: Reached target Sleep.
May 05 22:16:21 HOSTNAME systemd[1]: Starting Record successful boot for GRUB...
May 05 22:16:21 HOSTNAME systemd[1]: Starting NVIDIA system hibernate actions...
May 05 22:16:21 HOSTNAME hibernate[2041]: nvidia-hibernate.service
May 05 22:16:21 HOSTNAME logger[2041]: <13>May 5 22:16:21 hibernate: nvidia-hibernate.service
May 05 22:16:21 HOSTNAME systemd[1]: grub-common.service: Deactivated successfully.
May 05 22:16:21 HOSTNAME systemd[1]: Finished Record successful boot for GRUB.
May 05 22:16:21 HOSTNAME systemd[1]: Starting GRUB failed boot detection...
May 05 22:16:21 HOSTNAME systemd[1]: grub-initrd-fallback.service: Deactivated successfully.
May 05 22:16:21 HOSTNAME systemd[1]: Finished GRUB failed boot detection.
May 05 22:16:21 HOSTNAME wpa_supplicant[923]: wlp2s0: CTRL-EVENT-DSCP-POLICY clear_all
May 05 22:16:21 HOSTNAME wpa_supplicant[923]: wlp2s0: CTRL-EVENT-DSCP-POLICY clear_all
May 05 22:16:21 HOSTNAME wpa_supplicant[923]: nl80211: deinit ifname=wlp2s0 disabled_11b_rates=0
May 05 22:16:21 HOSTNAME systemd[1]: nvidia-hibernate.service: Deactivated successfully.
May 05 22:16:21 HOSTNAME systemd[1]: Finished NVIDIA system hibernate actions.
May 05 22:16:21 HOSTNAME systemd[1]: Starting Hibernate...
May 05 22:16:21 HOSTNAME kernel: PM: Image not found (code -16)
May 05 22:16:21 HOSTNAME systemd-sleep[2061]: Entering sleep state 'hibernate'...
May 05 22:16:21 HOSTNAME kernel: PM: hibernation: hibernation entry
有人知道哪里出了问题吗?根据 SMART,SSD 本身似乎很健康。我怀疑这与驱动器在恢复过程中未正确通电/连接/启用有关,但目前我不知道如何进一步排除故障。
答案1
我自己设法解决了这个问题——似乎是内核问题。我设法通过将与内核相关的软件包降级到5.15.0-71-generic
(这是/曾经是 22.04 可用的最新 LTS 版本)来使 Hibernate 正常工作。