Systemctl hibernate doesn't work

I’ve followed this guide https://docs.fedoraproject.org/en-US/Fedora/14/html/Storage_Administration_Guide/s2-swap-creating-file.html

Whenever I try to hibernate as root or as a non-root user, I get

Failed to hibernate system via logind: Not enough swap space for hibernation

and when I analyze systemd-logind, I see the error

Failed to open swap file /swapfile to determine on-disk offset: Permission denied

❯ ll /swapfile
-rw-r–r--. 1 root root 10G Jun 22 17:48 /swapfile

❯ cat /proc/cmdline
BOOT_IMAGE=(hd0,gpt4)/boot/vmlinuz-5.6.19-300.fc32.x86_64 root=UUID=4f840e1e-09e1-4f90-8a6b-159a1c48b53a ro rhgb quiet loglevel=3 rd.luks=0 rd.lvm=0 rd.md=0 rd.dm=0 re
sume=UUID=4f840e1e-09e1-4f90-8a6b-159a1c48b53a resume_offset=11366400 intel_pstate=disable zswap.enabled=1 zswap.max_pool_percent=25 zswap.compressor=lz4

❯ cat /proc/swaps
Filename Type Size Used Priority
/swapfile file 10485756 0 -2

❯ blkid /dev/sda4
/dev/sda4: LABEL=“Root” UUID=“4f840e1e-09e1-4f90-8a6b-159a1c48b53a” BLOCK_SIZE=“4096” TYPE=“ext4” PARTUUID=“c5654dce-ac58-453b-b28f-f41ebef1167d”

❯ cat /sys/power/resume
8:4

❯ lsblk /dev/sda4
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda4 8:4 0 59.2G 0 part /

Hi @darkshadow, welcome to the community! Please take a minute to go through the introductory posts in the #start-here category if you’ve not had a chance yet. They explain how to use the forum effectively.

Please use the #english:using-fedora-english or #english:upgrading-a-fedora-installation categories for troubleshooting. The #community category is for community related discussions. I’ve moved your topic to the correct category now.

I thought of searching the error using google and found this Hibernation only triggers lockscreen with swapfile (likely selinux problem)

Anyone facing permission issues should use this guide https://fedoramagazine.org/troubleshooting-selinux/

I was able to solve this problem using the above guide.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.