无法在 Ubuntu 18.04 上使休眠模式运行

无法在 Ubuntu 18.04 上使休眠模式运行

我无法让 Hibernate 在 Ubuntu 18.04 上运行,我尝试按照这些教程进行操作,完成以下所有步骤后,休眠仍然可以正常重启:

Github-gnome-shell-extension-hibernate-status

Askubuntu:18.04 中的休眠

系统:

华硕 N580VD,配备 16GB 内存和 20GB 交换空间

分区表:

sda     238,5G  
├─sda1    499M  Windows recovery 
├─sda2    100M  EFI System
├─sda3     16M  Microsoft reserved
├─sda4  117,9G  Microsoft basic data
├─sda5     20G  Linux swap
└─sda6    100G  Linux filesystem

交换分区 UUID:

sudo blkid | grep sda5
/dev/sda5: TYPE="swap" PARTLABEL="Basic data partition" PARTUUID="8d0c9f85-0436-48b5-8973-6aec3b8e3445"

/etc/fstab 的内容:

# <file system> <mount point>   <type>  <options>       <dump>  <pass>

# / was on /dev/sda6 during installation
UUID=27ed4a93-0aa1-d401-206c-4a930aa1d401 /               ext4    errors=remount-ro 0       1

# /boot/efi was on /dev/sda2 during installation
/dev/sda5       none            swap    sw              0       0
/dev/disk/by-uuid/01D4A10A933D25B0 /mnt/01D4A10A933D25B0 auto nosuid,nodev,nofail,noauto 0 0
/dev/disk/by-uuid/864A-6441 /mnt/864A-6441 auto nosuid,nodev,nofail 0 0

# Entry for Swap (added for hibernate): 
UUID=8d0c9f85-0436-48b5-8973-6aec3b8e3445 none  swap    sw              0       0

/etc/default/grub 的内容:

GRUB_DEFAULT="saved"
GRUB_TIMEOUT_STYLE="hidden"
GRUB_TIMEOUT="2"
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=8d0c9f85-0436-48b5-8973-6aec3b8e3445"
GRUB_CMDLINE_LINUX=""

export GRUB_COLOR_NORMAL="white/black"
export GRUB_COLOR_HIGHLIGHT="light-blue/black"
GRUB_SAVEDEFAULT="true"

/etc/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;org.freedesktop.login1.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions;org.freedesktop.login1.hibernate-ignore-inhibit
ResultActive=yes

[Enable hibernate to be run via cron]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.hibernate-multiple-sessions
ResultAny=yes

/etc/initramfs-tools/conf.d/resume 的内容:

resume=UUID=8d0c9f85-0436-48b5-8973-6aec3b8e3445

执行了这些命令:

sudo update-initramfs -u -k all
sudo update-grub

我还安装了 gnome-shell-extension-hibernate-status。任何帮助都将不胜感激!

编辑1:不仅休眠功能不起作用,而且我的冷启动时间也变得非常慢!!

答案1

有一个包,你可以轻松地使用它来休眠,
打开终端并写入 sudo apt install hibernate ,它会问你一些问题,然后你就可以使用休眠了sudo hibernate

相关内容