How to enable Hibernation to Swapfile on BTRFS?

Hey guys, so I got my system setup with BTRFS via the installer but I have no idea how to enable hibernation to swap file.
My system configurations are as follows:

  • My laptop has its single drive encrypted with LUKS; 8gb of ram
  • My desktop it’s not encrypted but the root folder and swapfile lives on a ssd (256 gb) while the home folder lives on a hdd (1tb); 16gb of ram
  • Both systems have BTRFS partitions for their respective drives.
  • Both systems have ztsd compression, as per default the installer

How do I go about setting up hibernation on both systems? So far I’ve tried putting in the resume_offset parameter with the correct number for each system but when I tell the system to hibernate, it just creates an entirely new session instead of restoring the session.

i start with a script to solve such issues as long as calamares does not have something implemented to get this working in the first place:

But the script only handles to recreate swapfile and enable resume if you install with automated partition and swapfile from installer it is not able to handle anything different.

1 Like