/sys/power/resume not persistent, breaking hibernation

I used to be able to hibernate from my swapfile just fine, but at some point it quit working, presumably following a system upgrade, but I didn’t notice it right away. I use dracut to make my initramfs and systemd-boot as my bootloader. I’m on Linux 6.7.1.arch1-1.

I stress that hibernation was working: I have added the dracut module " resume " and set the resume and resume_offset kernel parameters in /etc/kernel/cmdline and I see them in the .conf files in my /efi partition as well as in /proc/cmdline.

However, while /sys/power/resume_offset holds the correct value for the offset of my swapfile, /sys/power/resume has content “0:0”. Hibernate is not displayed as an option upon pressing the power button on my computer. When I overwrite /sys/power/resume with the correct partition containing my swapfile (the root partition), hibernate becomes an option. When I select this option, the computer appears to hibernate, but upon waking, it does not resume from the suspended session, and the content of /sys/power/resume has been reset to 0:0.

I don’t understand the process by which /sys/power/resume is overwritten, so I’m not sure what to do about this. Is this a bug, or might I have failed to configure something properly?

Thanks in advance for any help.

You can add a file called /etc/dracut.conf.d/resume2.conf with this contents:

install_items+=" /usr/lib/systemd/system/systemd-hibernate-resume.service "

Then run sudo dracut-rebuild

You will need to reboot before it will take effect.

1 Like

Thanks a ton! That did it and it’s working great now.

1 Like

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