Hibernate not working from swap file

So I recently put Endeavour on another of our machines, and since it had 32GB of memory thought “I don’t need swap”, not knowing that swap was necessary for Hibernation.

So I setup a swap file following these steps. After that and a restart my DE now has a Hibernate option in the power options. However, when I use it, it doesn’t actually save my session at all, and turning on the PC after a hibernate is the same as a cold boot, my session wasn’t saved at all.

Has anyone else had this issue? I even tried making my swapfile bigger than my system memory to be extra sure it has enough space to save. I’ve done everything identical to the post except in etc/default/grub's GRUB_CMDLINE_LINUX_DEFAULT I also have ‘quiet’ and ‘nvme_load=yes’ as they were already there and I didn’t want to mess with the existing config more. Would either of these interfere with saving/loading the state?

Here are my relevant lines of the grub config

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="EndeavourOS"
GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=3 resume=UUID=<my uuid here> nowatchdog nvme_load=YES"

You didn’t follow the instructions properly & add the UUID of the partition that has the swap file on it. Please go back and re-read the instructions from the post.

at least it misses resume_offset:

1 Like

Where am I missing that? I have my UUID where I put <my uuid here>

Ah, thanks. Should that be set in the grub config at all?
I’m reading the Arch wiki on it here, but I’m getting permission denied trying to add the value to /sys/power/resume_offset, even as root

I think it needs resume=<swap_file_partition> resume_offset=<swap_file_offset>

https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Hibernation_into_swap_file

You may find this thread very helpful.

1 Like

I’ve added the resume_offset and regenerated my grub config, but it still does not load my session.

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="EndeavourOS"
GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=3 resume=UUID=<my uuid here> resume_offset=34816 nowatchdog nvme_load=YES"

34816 comes from the physical_offset column from filefrag -v /swapfile.

Thanks, that was it. I needed to update the mkinitcpio config and generate the images

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.