Swap partition or swap file for hibernation support?

I’m planning to use LUKS+btrfs, in a GPT partition.
What is better for hibernation?

  • a separate partition? I’ve tested successfully with a separate partition outside LUKS.
  • or a swap file. I suppose it could be in a separate subvolume of the btrfs partition. How to set it up? This solutiojn allows more flexibility, as I can change easily the size of the swap.

I prefer a swap partition over a swap file but that’s just me :slight_smile:
here is some good ideas: Power management/Suspend and hibernate - ArchWiki

I had a few problems with the swapfile a couple of years back, so I went back to the trusty swap partition.

At any rate please keep us updated if you go with the swapfile.

Swap file is far faster.

With Hibernation?

Thanks 1fallen.
One year ago, with Pop OS 22.04, hibernation to swap file didn’t work and to a swap partition did work.
I\ll follow your advice.

And does swap file work weel?

I hope I’m not miss-understanding but the Wheel will remain the same with a swap file or parttition ie:

groups
sys network rfkill users video storage lp audio wheel me

I forgot to show this:

cat /proc/swaps
Filename                                Type            Size            Used            Priority
/dev/zram0                              partition       14159868        0               100

EDIT:2 Also zram and Hibernation is a tough go.