How to enable hibernation with refind boot manager

I’ve successfully installed Cachy OS, the first time I try a arch based distro.

The only remaining issue to solve is how to hibernate.
I’ve researched a little before asking.

I’m using refind boot manager.
My setup is:

  • a partition for /boot/efi
  • another one for /boot
  • another one for swap, it has the same size as physical RAM.
  • the root partition: LUKS + btrfs. It is ciphered.

I don’t know how to specify the resume hook to initramfs.

Is it easy to change boot manager without reinstalling everything?

You do not need to switch boot managers to unlock resume functionality. It is boot manager agnostic. See Power management/Suspend and hibernate - ArchWiki

OK, with GRUB I know how to activate hibernation and with systemd boot, but don’t find how to do it with refind.

If you mean adding the kernel cmdline to the boot options, refer to Boot Manager Configuration | CachyOS.

2 Likes

Thanks to your answer it’s been easy.

1 Like

could you eventually help me on this one, I have similar setup. Except I want to swap into file, instead of a swap partition. Is it even possible with zram? Some say yes, some nope. So idk, and I did not manage to make it work.

Getting this response…

sudo systemctl hibernate
Call to Hibernate failed: Not enough suitable swap space for hibernation available on compatible block devices and file systems

Despite having free space available:

free
               total        used        free      shared  buff/cache   available
Mem:        65152244     5042780    58679440      198608     2245776    60109464
Swap:       70254588           0    70254588

A year ago with Pop OS! based on Ubuntu 22.04, I wasn’t able to hibernate to file inside an encrypted btrfs partitiion. With a separated swap partition, hibernation ran smoothly.

How much RAM do you have?
Swap file size should about the same size than phisIcal RAm.

1 Like

@xetra have a look what Archwikisites @naim did link

1 Like

Thank you @hotte, I did for multiple hours, and I dont understand it. So confusing to me.

I have around 2 gigs more than RAM.

Mem:        65152244 
Swap:       70254588
❯ zramctl 
NAME       ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 zstd           67G   4K   62B   20K      16 [SWAP]
❯ swapon --show
NAME       TYPE      SIZE USED PRIO
/dev/zram0 partition  67G   0B  100
❯ systemctl hibernate 
Call to Hibernate failed: Not enough suitable swap space for hibernation available on compatible block devices and file systems

@xetra
hi mate, what is your intention, what do you want to realize ?
you write

I want to swap into file, instead of a swap partition.

on cachyOS that’s by default zram
to see it, just run swapon -s
also have a look here
and here

but if you want to hibernate, a swap partition is required normally

Thanks for reply :slight_smile:

Yes, I want to hibernate. So its not possible to make hibernation work with swap file, only with swap partition?

guess that’s reality

1 Like

Thx my friend, gonna make a swap partition then :upside_down_face:

1 Like