49

I have a fresh install of 16.04.1 on a Lenovo T450s that always worked fine with respect to suspend/hibernate on Ubuntu (previous version I used was 14.04.5). Swap is comfortably bigger than RAM on this install.

As I am used to now, after the install I tried to go on with the usual hack for hibernation activation. However, things seem to be different this time as sudo pm-hibernate does not seem to do anything.

As far as I understand, now that ubuntu has switched to systemd, the correct command would be systemctl hibernate which returns

 Failed to hibernate system via logind: Sleep verb not supported

I tried the solutions mentioned here, but they are mostly aimed at re-enabling pm-hibernate and making it an entry in the logout menu. I also saw that one possible solution is to install the Tuxonice kernel, but did not try as I am not very keen on tampering with the kernel in general and using a PPA kernel in particular.

So, is there a way to reactivate hibernation on the last, systemd-based versions of Ubuntu? Preferably using systemd, and avoiding potentially system-breaking hacks. Or do I just have to wait and hope until the next update?

Marc
  • 1,252

2 Answers2

55

I was finally able to solve my own problem following some topics on Fedora (they made the switch to systemd a while ago so there's more material there).

It turns out that I had secure boot enabled (I recall being asked about that during 16.04 install, and that I kept it on without giving it much thought) and that caused the output of cat /sys/power/disk to be:

 [disabled]

Indeed not a very good sign. So I rebooted and went searching in my BIOS settings, disabled secure boot there. Now cat /sys/power/disk gets me:

 [platform] shutdown reboot suspend 

which looks better. And indeed calling systemctl hibernate results in a successful hibernate/thaw sequence.

Moreover, the option to hibernate now shows up in the graphical interface without the need for any hack (at least on my computer).

Marc
  • 1,252
22

This can also happen when your swap is too small to hold your RAM contents (e.g. when you added more RAM to your computer after setting up the OS).

Check e.g. in htop, then Mem number should be <= the Swp number.

See https://github.com/systemd/systemd/issues/6729

nh2
  • 1,831
  • 2
  • 18
  • 19