Ubuntu – S2disk works, but hibernation from menu gets stuck afer login

18.04hibernatepower-managementsystemdxubuntu

Running Xubuntu 18.04 LTS, I've set up hibernation with uswsusp, and it works flawlessly (s2disk).

Then, I've integrated s2disk to Systemd (systemctl hibernate) by overriding the systemd-hibernate service to

[Service]
ExecStart=
ExecStartPre=-/bin/run-parts -v -a pre /usr/lib/systemd/system-sleep
ExecStart=/usr/sbin/s2disk
ExecStartPost=-/bin/run-parts -v --reverse -a post /usr/lib/systemd/system-sleep

As expected, sudo systemctl hibernate works without any issues.

The problem appears when clicking the hibernate button on the power menu (enabled via polkit) fails – it looks like it worked, but when resuming the system freezes completely upon login.

I suspect that the button does not actually run the same commands as the other methods, but I couldn't find how to set it.

Update: This seems to be machine-specific. I have another PC, with very similar setup (same Xubuntu version and hibernation configuration – from here). On the other PC, it works correctly, but for the machine in question (it's a laptop), it still does not.

Update 2: I've tried to restart Plymouth upon resume (this is a solution to similar issues I've found), but it didn't help.

Best Answer

  • Perhaps you forgot (like me) to specify the resume & resume_offset Linux boot parameters? Without the resume_offset I had nearly the same problem: black screen on "s2disk: Returned to userspace" message.

    I've written here a full answer to be able to resume from a swap file.