Hibernation on encrypted setup broke after an update

Hello, I’ve been daily driving EndeavourOS since this summer, and it’s my first time here asking for help (sorry for bad English or formatting). I managed to make myself an encrypted system install, with hibernation via a swapfile.
But for the past few months, hibernation hasn’t worked at all, and I get a mysterious error when I ask my computer to hibernate.

I don’t think the problem is with my swap file, since it’s still working and its offset hasn’t changed. I think the only way it broke was after an update, because I haven’t change anything at the time it stopped working.

Here are some command outputs that may help (I hope so):

[me@my-framework ~]$ sudo systemctl hibernate
[sudo] Mot de passe de me : 
Call to Hibernate failed: Invalid argument

Please note that I didn’t need to use sudo before, and since I have a problem with hibernate, it asks me for privileges in order to start “hibernate.target”. The suspend command systemctl suspend stills works without any problems.

[me@my-framework ~]$ sudo journalctl -ru systemd-hibernate.service
jan 25 17:20:27 my-framework systemd[1]: Failed to start System Hibernate.
jan 25 17:20:27 my-framework systemd[1]: systemd-hibernate.service: Failed with result 'exit-code'.
jan 25 17:20:27 my-framework systemd[1]: systemd-hibernate.service: Main process exited, code=exited, status=1/FAILURE
jan 25 17:20:27 my-framework systemd-sleep[6218]: Failed to find location to hibernate to: Invalid argument
jan 25 17:20:27 my-framework systemd[1]: Starting System Hibernate...
...
[me@my-framework ~]$ journalctl -xe | grep hibernate
...
jan 25 17:20:27 my-framework sudo[6211]: me : TTY=pts/0 ; PWD=/home/me ; USER=root ; COMMAND=/usr/bin/systemctl hibernate
░░ Subject: L'unité (unit) systemd-hibernate.service a commencé à démarrer
░░ L'unité (unit) systemd-hibernate.service a commencé à démarrer.
jan 25 17:20:27 my-framework systemd-sleep[6218]: Failed to find location to hibernate to: Invalid argument
jan 25 17:20:27 my-framework systemd[1]: systemd-hibernate.service: Main process exited, code=exited, status=1/FAILURE
░░ An ExecStart= process belonging to unit systemd-hibernate.service has exited.
jan 25 17:20:27 my-framework systemd[1]: systemd-hibernate.service: Failed with result 'exit-code'.
░░ The unit systemd-hibernate.service has entered the 'failed' state with result 'exit-code'.
░░ Subject: L'unité (unit) systemd-hibernate.service a échoué
░░ L'unité (unit) systemd-hibernate.service a échoué, avec le résultat failed.
░░ Subject: L'unité (unit) hibernate.target a échoué
░░ L'unité (unit) hibernate.target a échoué, avec le résultat dependency.
jan 25 17:20:27 my-framework systemd[1]: hibernate.target: Job hibernate.target/start failed with result 'dependency'.
Translation for the french bits (using Deepl)
[me@my-framework ~]$ journalctl -xe | grep hibernate
...
jan 25 17:20:27 my-framework sudo[6211]: me : TTY=pts/0 ; PWD=/home/me ; USER=root ; COMMAND=/usr/bin/systemctl hibernate
░░ Subject: The unit systemd-hibernate.service has started to run
░░ The unit systemd-hibernate.service has started to run.
jan 25 17:20:27 my-framework systemd-sleep[6218]: Failed to find location to hibernate to: Invalid argument
jan 25 17:20:27 my-framework systemd[1]: systemd-hibernate.service: Main process exited, code=exited, status=1/FAILURE
░░ An ExecStart= process belonging to unit systemd-hibernate.service has exited.
jan 25 17:20:27 my-framework systemd[1]: systemd-hibernate.service: Failed with result 'exit-code'.
░░ The unit systemd-hibernate.service has entered the 'failed' state with result 'exit-code'.
░░ Subject: Unit systemd-hibernate.service failed
░░ The unit (unit) systemd-hibernate.service has failed, with the result 'failed'.
░░ Subject: Unit hibernate.target failed
░░ The unit (unit) hibernate.target failed, with the result dependency.
jan 25 17:20:27 my-framework systemd[1]: hibernate.target: Job hibernate.target/start failed with result 'dependency'.

I won’t send more information to avoid flooding the topic.

It would be really nice if you could help me, as I’ve already done quite a bit of research but have no idea where the error is coming from or how to fix it.
I’d be happy to provide further information.

You can add a file called /etc/dracut.conf.d/resume.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

Thank you very much for the help.
I already have this file with this content:

add_dracutmodules+=" resume "

But I will replace it in favour of what you suggested. I will update you in an hour after testing it.

Could you also explain what the content you sent me does? I understand that it adds something to the kernel installation but I don’t know exxactemetn how it works. I’d also like to be able, in the future, to understand how to find the solution to this kind of problem, so that I don’t have to come back here and bother you.

Don’t replace it. Add the new line to it. You need both.

It adds the file /usr/lib/systemd/system/systemd-hibernate-resume.service to the initrd. This is needed due to a change in systemd 255 that requires that service to be available.

2 Likes

Thanks a million, everything’s working perfectly now! I don’t know how I would have known about this without your help, thank you so much for your responsiveness. I feel like I’ve chosen one of the best Linux distros :slight_smile:

2 Likes

See also:

You’re right, odd that I didn’t come across it during my research. Maybe the page wasn’t indexed by the search engines. It’s even the same computer model as mine lol.
Thank you.

For some reason endeavouros forum is not on the top of google results, sometimes not even on the first page. It’s a good practice to search here first.

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