How to set up hibernation on Fedora (KDE) 38?

I want to set up hibernation on my Fedora KDE 38 install. I have 8GB of ZRAM, 48GB or RAM and I want to create a hidden swapfile on my HDD, which the system should hibernate to. How do I set up hibernation, and how do I make it rather use the ZRAM instead of the swapfile for general swap purposes during runtime? Additionally I want to be able to hibernate graphically from within KDE Plasma. And another important thing to know is that I’m using secure boot.

How did this not get any comments in such a long time?

Hibernation a.k.a suspend to disk might have issues, so Fedora does not support it in its default configuration, you can suspend to RAM without having issues. When you want to experiment with settings up hibernation, I can recommend you can take a look at this article.

Also, you could read some more information on kernel sleep states or even check out the Archlinux wiki and try getting some tips from there.

A note on the first article: I use ext4 and not btrfs, so either the guide also has some information on that or I’ll have to figure it out on my own.

When using ext4 the swap file used for hibernation may be under the root file system ( / ) since the bios can access it there. When using btrfs bios cannot access it in the btrfs file system: It then must either be placed in the /boot file system (ext4) or have its own swap partition.

1 Like

And the concept of that article is to disable the swap file/partition when the system is running, to prevent conflicts with the ZRAM and enable it when hibernating and disable it again once the system is resumed?