-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to hibernate system via logind: Not enough swap space for hibernation #15354
Comments
Please turn on debug logging in systemd-logind (i.e.
and then restart the service). Then reproduce the issue once and provide the logging this generates. |
Also provide contents of /proc/swaps |
I am using
|
"sudo journalctl -u systemd-logind" is the right way. Can you paste the full log excerpt? |
|
OK, so you have your swap file in /home, and logind lives in a sandbox that makes /home unaccessible to it, i.e. locking homed into a sandbox is a good thing I am sure. In you case the path to the swap file collides with that though. You have two options: turn off the sandboxing option, i.e.
This will downgrade the sandbox a bit: instead of hiding /home (replacing it with an empty dir) it will be visible, but read-only to logind. Alternatively just move or bind mount the swap file to a place outside of /home and just use it from there, since this hiding only applies to /home things will then just work. Having a swap file in /home is a bit of an exotic choice I would claim, hence I don't think we should make any changes in systemd upstream. Hence I hope it is OK if I just close this issue. Does this make sense? |
It works! Thank you very much!! |
Let's make the log msgs a bit longer, to make clearer what is going on here... Prompted bymy attempts to debug systemd#15354
Let's make the log msgs a bit longer, to make clearer what is going on here... Prompted bymy attempts to debug #15354
Let's make the log msgs a bit longer, to make clearer what is going on here... Prompted bymy attempts to debug systemd#15354 (cherry picked from commit 0ed4b54)
Same problem for the same reason. Solution 2 (which is better) is not an option for me as I don't have space for my swap file anywhere else but I tried solution 1, rebooted and I get the same error message. Thanks for your help/advice! |
Big hammer is setting |
Thank you very much @arvidjaar for the suggestion. As it turns out, the mistake was mine: while trying to figure out what was going on, I had deleted my swap file and re-created a new one and the Your solution @arvidjaar actually allowed me to realize that there was something else going on. So it was useful. Now, both options work for me:
or
Which one do you think is safest/best? I realize that it is hard to compare them as they touch at totally different things. My understanding is that making home readable creates a little security vulnerability while not checking for swap size might cause loss of data if the swap is not large enough. So it might be a personal choice as to what matters more. But I thought that I'd ask for your advice (plus, I am not certain that my interpretation of the risks in either case is actually correct). Thank you very much!! In any event, with one or the other option (and now that I corrected my kernel parameters), I can hibernate again 🙂 |
After upgrading systemd (243.162-2 -> 245.4-2), the system can not hibernate. And then I downgraded it to 243.162-2, it just works. After that, I upgraded to 245.4-2 again, and it can not hibernate.
systemd version the issue has been seen with
Used distribution
Expected behaviour you didn't see
Unexpected behaviour you saw
Steps to reproduce the problem
step 1: upgrade systemd and reboot.
step 2: using
sudo systemctl hibernate
and it shows failed.step 3: downgrad systemd and reboot.
step 4: using
sudo systemctl hibernate
and it works.step 5: upgrade systemd and reboot.
step 6: using
sudo systemctl hibernate
and it shows failed.I have 16G memory and a 20G swap file, so it should have enough swap space.
The text was updated successfully, but these errors were encountered: