I followed this guide (https://confluence.jaytaala.com/display/TKB/Use+a+swap+file+and+enable+hibernation+on+Arch+Linux+-+including+on+a+LUKS+root+partition) but it didn't work.
filefrag -v /swapfile | awk 'NR==4 {print $4}' | tr -d .
15820800
I put that on /etc/default/grub and I ran "grub-mkconfig -o /boot/grub/grub.cfg".
How can you hibernate?
I used loginctl command. After it booted as after a normal shutdown.
I didn't see the pm-utils package.
I use dinit.
I do the same without issue, and it's init-independent. You need:
I copied the resume hook position from another Artix device with lvm on luks and a swap partition.
As the Artix guide states https://wiki.artixlinux.org/Main/InstallationWithFullDiskEncryption.
There it works:
HOOKS=(base udev autodetect modconf kms keyboard keymap consolefont encrypt resume block filesystems fsck)
I tried this following the Arch wiki (https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Configure_the_initramfs) before seeing the answer and it works for the swap file:
HOOKS="base udev autodetect modconf block keyboard keymap consolefont encrypt filesystems resume fsck"
(And I set the offset in grub config)
Is it better to place it after udev then?
With that (after encrypt) I can't use "loginctl hibernate", nothing happens and no error.
But I can hibernate with "echo disk > /sys/power/state".
Since hook order is important, I'd say yes.
I tried it since I have encryption it couldn't find the swap file because it wasn't unlocked yet.
This one so:
HOOKS="base udev autodetect modconf block keyboard keymap consolefont encrypt filesystems resume fsck"