I used this wiki page to enable hibernation on my encrypted systems. And I was able to get hibernation working on my laptop, but on my PC sadly I am not able to hibernate.
See following infos:
[kokko@endeavour ~]$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 223,6G 0 disk
├─sda1 8:1 0 100M 0 part
├─sda3 8:3 0 1K 0 part
├─sda4 8:4 0 500M 0 part
├─sda5 8:5 0 108,2G 0 part
└─sda6 8:6 0 1,9G 0 part [SWAP]
sdb 8:16 0 931,5G 0 disk
└─sdb2 8:18 0 931,5G 0 part
sdc 8:32 0 477G 0 disk
├─sdc1 8:33 0 300M 0 part /boot/efi
└─sdc2 8:34 0 476,7G 0 part
└─luks-211e4232-ac5f-4c73-9fa8-06d1de3bcea9 254:0 0 476,7G 0 crypt /
sr0 11:0 1 10,2M 0 rom
[kokko@endeavour ~]$ swapon --show
NAME TYPE SIZE USED PRIO
/swapfile file 17G 0B -2
/dev/sda6 partition 1,9G 0B -3
free -h
gesamt benutzt frei gemns. Puffer/Cache verfügbar
Speicher: 15Gi 1,5Gi 13Gi 136Mi 994Mi 13Gi
Swap: 18Gi 0B 18Gi
[kokko@endeavour ~]$ sudo systemctl hibernate
Failed to hibernate system via logind: Not enough swap space for hibernation
[kokko@endeavour ~]$
The main difference is that my laptop does only show 1 swap, whereas my PC has 2 (1 from ubuntu 1 from EOS).
[kokko@endeavour ~]$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
UUID=38e73302-d834-441d-a90f-498f000266b9 swap swap defaults,noatime,discard 0 2
UUID=6C5C-97C5 /boot/efi vfat umask=0077 0 2
/dev/mapper/luks-211e4232-ac5f-4c73-9fa8-06d1de3bcea9 / ext4 defaults,noatime,discard 0 1
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
/swapfile none swap defaults,pri=-2 0 0
Jan 09 21:12:22 endeavour systemd-logind[521]: /sys/power/resume and /sys/power/resume_offset has no matching entry in /proc/swaps; Hibernation will fail: resume=8:6, resume_offset=337920
Try to get rid of your swap partition by commenting out the entry shown above. Your 17G swapfile should be enough.
sudo nano /etc/fstab
Reboot and report back.
If this doesn’t work you may first have to turn off all swap devices and files with swapoff -a, then edit fstab and delete entries, reboot and recreate your swapfile.
Good hint! But unfortunately this did not make any difference.
[kokko@endeavour ~]$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
#UUID=38e73302-d834-441d-a90f-498f000266b9 swap swap defaults,noatime,discard 0 2
UUID=6C5C-97C5 /boot/efi vfat umask=0077 0 2
/dev/mapper/luks-211e4232-ac5f-4c73-9fa8-06d1de3bcea9 / ext4 defaults,noatime,discard 0 1
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
/swapfile none swap defaults,pri=-2 0 0
[kokko@endeavour ~]$ swapon --show
NAME TYPE SIZE USED PRIO
/swapfile file 17G 0B -2
[kokko@endeavour ~]$ systemctl hibernate
Failed to hibernate system via logind: Not enough swap space for hibernation
+journal
Jan 09 22:41:32 endeavour systemd-logind[514]: /sys/power/resume and /sys/power/resume_offset has no matching entry in /proc/swaps; Hibernation will fail: resume=8:6, resume_offset=337920
So this is the same as before. I’ll check my laptop for differences in the setup, maybe I ll find something.
@joekamprad
Thanks for the link, I’ll read this when I have a little more patience-