I’m unable to hibernate my desktop PC using systemctl hibernate. The systems resumes as though a shutdown has been performed. I noticed that fstab does not have anything related to swap volume, nor does system monitor show swap volume. But swapoff and swapon identify the swap volume
My swap volume is less than the total RAM but is more than the RAM usage before i try to hibernate. I don’ think that in UEFI that secure boot is switched on.
However my laptop with openSUSE 15.2 goes to hibernate when i close the lid even though here too fstab does not have swap volume.
Hibernate is a very useful option for me since i have many windows open at any time. Rebooting means that i need to open all the windows again.
Any other method that you guys can suggest will also be fine with me.
Systemd Journal –
Apr 20 09:06:46 xxx kernel: secureboot: Secure boot enabled
Apr 20 09:06:46 xxx kernel: Kernel is locked down from EFI Secure Boot mode; see man kernel_lockdown.7
Current Linux Kernels can not hibernate – due to a security issue with the Swap partition …
Thanks for informing me that hibernate is not possible. Then my laptop does something else when i close the lid — is it suspend? If so then on my desktop this should work: Settings → Power → Power Button Action → Suspend
Hibernate is possible with secure boot turned off.
I am on Tumbleweed and I have managed to get hibernation working.
Credits to this message. This fix is suggested there for some Fedora bug with hibernation, but it works for me for OpenSUSE, so maybe OpenSUSE has this bug too?
Add a string
to /etc/dracut.conf.d/99-debug.conf, and then run this:
sudo dracut -vf
After I did that, hibernation started to work for me.
Before that, I changed grub.cfg from resume=your/swap/dev/path to resume=UUID=your-swap-uuid, and changed fstab option for swap partion to mount by UUID in yast. It didn’t fix hibernation, but made it so, that when I switch on my computer after choosing to hibernate, grub menu is skipped and the ‘hibernated’ boot option is loaded, but OS state was still not preserved. I don’t know if it was a necessary step to repair hibernation for me, but if the fix above won’t work, you can try doing this.
Also, I have secure boot turned off.
If you are using KDE Plasma, in system settings - workspace - startup and shutdown - tab “session management” you can tell it to restore the previous session. This will open all windows as you have left them, except such requiring root credentials (e.g. YaST). Of course, I do know that this is no solution resp. no replacement for resume from suspend which is much faster. But it may be better than nothing in case you can’t get hibernate to work.