Dear all, I am a Fedora newbie, just installed on my laptop few days ago.
I followed the tutorial on how to enable hibernation from the official fedora documentation, however when I test it by typing as root:
systemctl hibernate
I get:
Failed to hibernate system via logind: Not enough swap space for hibernation
However, if I do:
echo disk > /sys/power/state
Hibernation works flawlessly, in the sense that the computer turns off, and then when I boot up the system again I am at the exact point when I launched the command.
Great to see you are running Fedora.
What exactly is the issue? Is it that it doesn’t work for root? I just tried it as root. It worked!
Although I am running Rawhide … but I bet F32 should be having similar versions. Have you updated your Fedora recently? I mean a complete update. Try it
Dear twohot, thank you for your reply. I just run an update, also the kernel updated. However the problem persists, as you can see in my first post, the hibernation works using the command disk, so the configuration is correct. The problem is that I cannot hibernate with systemd since I get the error that there is not enough space, and I need systemd hibernation.
Hibernate should work out of the box
In any case, your issue may be similar to the one on this mailing list:
The user outlined the steps he took to fix it. It turns out that a module was missing in initrd.
We could confirm by searching for “hibernat” in the output of: journalctl -b 0
If your issue is different, the search may reveal that too.
I think that similar to “Suspend” also “Hybernate” should be made available from the Gnome power-off menu - don’t you think? On battery supported PCs “Suspend” may be sufficient, but for regular PCs using PSU only the other option is safer in case of a power outage…
You mean that if its not available by default in the menu then is not supposed to work?if its so, thats not the case since hibernation (through systemd) always worked in any other distribution I used before Fedora: Ubuntu, Mint, Elementary Os, Arch, Manjaro.
Just to be clear, hibernation is not officially supported. Due to the countless hardware combinations and particularly because of Secure Boot, it’s not supported upstream and while the Workstation SIG would like to have it working out of the box, they cannot.
If you get it working, you should consider it serendipity more than anything else.
I think you are missing my initial point: hibernation is working, in fact, echo disk > /sys/power/state hibernates the system, and I can successfully resume my sessions after boot. In my understanding, this means that the kernel boot parameters the fstab file, and the quantity of swap space (which is larger than my ram) are in the correct fashion.
The problem is that hibernation through systemd does not work, in fact if I do: systemctl hibernate, I obtain:
Failed to hibernate system via logind: Not enough swap space for hibernation
So I guess the problem is related to some control check in logind.
For many users, on a variety of systems, hibernation works just fine, e.g. in your case via /sys/power/state. What I’m saying is that since kernel upstream does not currently support it, its implementation in every other higher level tool such as systemd or GNOME is all over the place and not very actively pursued.
If you want to troubleshoot the issue, you could try incrementally increasing your swap file size (if it’s a partition you could add a swap file) to figure out the discrepancy in systemd’s caclulations and file a bug against systemd. I’m not sure it’s going to convince anyone to work on it though, but ymmv.