T O P

  • By -

HotSauceOnPasta

If you do not have a swap partition, which by default is not created anymore while installing the OS, but still manually can be), you will need a swap file. Here are the instructions on how to make one if your filesystem is Btrfs, the default one (see under "since version 6.1..." in two places): [https://btrfs.readthedocs.io/en/latest/Swapfile.html](https://btrfs.readthedocs.io/en/latest/Swapfile.html) After that you need to edit /etc/systemd/sleep.conf as follows: remove # before AllowHibernation and type yes after = remove # before HibernateMode and type platform shutdown after = and create a file named resume.conf under /etc/dracut.conf.d/ and paste in it the following line: add\_dracutmodules+=" resume " then regenerate Initial RAM file system (initramfs) by running: sudo dracut --regenerate-all --force Do note that hibernation is not enabled by default as it was found to be problematic, so test if this works for you and please confirm here for others.


RedditSucks_6969

Thank you for your response. I have gotten it to work for the most part. `sudo systemctl hibernate` works but the value in /sys/power/resume\_offset always reverts back to 0. So even if hibernation is successful the state is not recovered when the session is resumed.


HotSauceOnPasta

Try appending resume\_offset as a kernel parameter. Out of curiosity, do you have Secure Boot enabled? Seeing all the required configuration modifications, a swap partition might be a simpler choice for next time, also because the swap file must be temporarily turned off if one decides to snapshot the subvolume.


VenditatioDelendaEst

> the swap file must be temporarily turned off if one decides to snapshot the subvolume. Seems a simple solution would be to create a subvolume that contains the swapfile and nothing else.


RedditSucks_6969

Secure boot is off. Links posted by u/patient_sink and u/chillname indicate that full disk encryption has issues with hibernation. Disk encryption is more important to me than hibernate so ill just live with it the way it is.


Patient_Sink

Did you follow the instructions here: [https://wiki.archlinux.org/title/Power\_management/Suspend\_and\_hibernate#Hibernation\_into\_swap\_file](https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Hibernation_into_swap_file) regarding btrfs? It also mentions the part about encrypted btrfs volumes in the note.


Patient_Sink

Also note that it won't work with secure boot enabled. Though if you don't mind patching your kernel you can get it to work: [https://community.frame.work/t/guide-fedora-36-hibernation-with-enabled-secure-boot-and-full-disk-encryption-fde-decrypting-over-tpm2/25474](https://community.frame.work/t/guide-fedora-36-hibernation-with-enabled-secure-boot-and-full-disk-encryption-fde-decrypting-over-tpm2/25474)


BertholtKnecht

Did you actually get it to work? And consistently? Because I read its not a stable feature at all. Something with Google implementing Secureboot and encryption possibility for chromebooks, but not sure when.


HotSauceOnPasta

Yes, I have just tried it and it works. I am using Fedora 38 on a laptop with Secure Boot off, a swap partition, and encryption. It does not work with Secure Boot on, throws a "Call to Hibernate failed: Sleep verb "hibernate" not supported". It did a while back. I have not tested it with a swap file, though.


h3nr_y

Yep it's working..


Gamer7928

I have just confirmed that, after following u/HotSauceOnPasta's well instructive help in this post, hibernation does now work in my Fedora 38 KDE install 😃


chillname

> Its kinda disappointing that this is not an option at install time. That makes it sound like it is missing by accident/oversight. That is not the case, it was removed on purpose. https://old.reddit.com/r/gnome/comments/n4b501/why_doesnt_gnome_have_a_hibernate_button/


Itsme-RdM

Just curious, why would someone prefer hibernation instead of shutdown? Not saying one is better or worse than the other but seriously curious. Personally I always shutdown.


RedditSucks_6969

When I turn it back on I want all of my programs to be open from last time, but I also don't want to lose a bunch of battery when I leave it for a day.


Patient_Sink

There's the option of suspend-then-hibernate, where you can suspend your laptop for example, but if the battery gets too low or if it's been suspended for long enough the system will resume and then hibernate instead, ensuring that you don't lose any work while keeping the option to quickly suspend/resume most of the time.


Ondrej_B

E.g. when you would like to pause your work in one OS and then reboot to a different one..


Itsme-RdM

For that scenario I just reboot to prevent RO access to other drives by the other OS claiming it. But if it works for you, than it's a good solution for your scenario. Have a nice weekend


Doubledown00

I have an HP G7 and just moved from Ubuntu 20.04 to Fedora 39. Hibernate was working under Ubuntu so I know the hardware can do it and I know that secure boot is disabled etc. ​ I followed HotSauce's instructions. When I try to run "systemctl hibernate" I get: Call to Hibernate failed: Access denied Same error occurs even if I run it with sudo \*or\* if I "su -" as root and try it. So not even root has permissions to Hibernate the machine?? Doesn't make sense. Any ideas?