将 ubuntu 16.04 更新到 18.04 后,我无法 hibernate 。
我尝试了一切:
sudo -s
echo platform > /sys/power/disk
echo disk > /sys/power/state
和
sudo -s
echo shutdown > /sys/power/disk
echo disk > /sys/power/state
和
sudo apt-get install uswsusp
sudo s2disk
和
安装 hibernate 2.0+15+g88d54a8-1.deb
sudo hibernate
在每种情况下,计算机都会卡在空白屏幕上并且永远不会关闭。 另一方面,暂停正在工作。但我需要保存到磁盘以便拔下电脑。
有没有人遇到过这个问题并解决了?
最佳答案
这是 Ubuntu 18.04 的所有“可能”步骤,请确保所有步骤都通过。这有点棘手,因为您正在升级。
1- 确保已安装 hibernate
sudo apt install pm-utils hibernate pm-hibernate
然后尝试:
sudo pm-hibernate
(这一步对你不起作用)
2- 确保你有足够的交换空间并且你指向正确的交换空间
运行这个来检查你的交换:
grep swap /etc/fstab
你应该得到这样的东西:
swap was on /dev/nvme0n1p5 during installation
UUID=xyz-bb32-4ad2-aaeb-xyz none swap sw
如果没有,那么您需要创建一个(我想这对您有用)。
3-将swap的UUID复制到grub中
将上一步的 UUID 复制到组文件中(我很确定这是你的问题。
sudo gedit /etc/default/grub
然后将简历更改为指向 UUID 而不是开发名称:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=xyz-bb32-4ad2-aaeb-xyz"
4- 启用 hibernate (如果尚未启用)
sudo gedit /var/lib/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
然后在那个文件中过去:
[Re-enable hibernate by default in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes
[Re-enable hibernate by default in logind]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate
ResultActive=yes
5- 盖子关闭时 hibernate
sudo gedit /etc/systemd/logind.conf
并包含
#HandleLidSwitch=suspend
HandleLidSwitch=hibernate
关于hibernate - Ubuntu 18.04 更新 hibernate 挂起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52067410/