I plan to install Fedora 41, but I really need hibernation (suspend to disk) instead of a simple standby (suspend to memory), because I will have disk encryption enabled. Hibernation is the only way to safely suspend an encrypted device, as any sensitive data is then contained in the encrypted drive and not in the memory.
But how can I enable that? I’m willing to use btrfs, I do not care so much about that. I only need hibernation and encryption.
There are two articles on Fedora Magazine the can probably help you. The first one is from this year:
Also take a look at the BTRFS documentation on the swapfile section.
Be mindful that BTRFS is the default filesystem, so don’t skip the step with chattr to disable copy-on-write to avoid problems.
A Swap file is seems your best bet sine it’s much easier to get rid of if you decide to not use hibernation anymore.
It’s been a while since I last used Hibernation, because the size of the swap file or partition must be at least the size of the RAM of the system, I gave up using long ago.
I selected the standard partition scheme in the Fedora 41 installer (so that it will use ext4 instead of btrfs), enabled encryption and just added a dedicated SWAP partition matching my RAM size:
I am running Fedora 42 on a LUKS-encrypted BTRFS filesystem (/boot is on a seperate unencrypted ext4 partition) with secure boot enabled. I’m not sure if hibernation is possible with this setup but it would be really nice, as my laptop battery drains quite quickly on suspend.
I tried creating a swapfile on a seperate subvolume as described the first article, but did not manage to get hibernation working. Systemd still says it is not configured or supported by the kernel when I try to run systemctl hibernate.
To summarise, these are the steps I tried:
Create the subvol (and disable CoW, update SELinux policy)