10

I have lost the to me essential hibernate functionality after upgrading ubuntu. This is normal, but unfortunately I could not reenable it this time.

I tried these three previous solutions:

but no hibernation option appears.

Some additional info:

  • sudo pm-hibernate outputs nothing and appears to do nothing.

  • sudo s2disk outputs:

    s2disk: Could not open the snapshot device. Reason: Operation not permitted

I guess this is my key clue, but I didn't find any obvious explanations/solutions when googling that - I'm afraid I'm ignorant of the meaning.

There is no change to dmesg output and /var/log/pm-suspend.log does not exist after running pm-hibernate.

The machine is capable of hibernating under ubuntu 15.04 and earlier - the above options worked previously.

(I am aware this is a potential duplicate of this question, but wanted to add more detail.)

nsandersen
  • 273
  • 1
  • 5
  • 14
  • I have the same problem, only I can hibernate /suspend but my Lenovo z51-70 won't wake up from it. I even added the options that you provided. – Mookey Apr 24 '16 at 19:47
  • Take a look [here](http://askubuntu.com/questions/462472/xubuntu-14-04-how-to-enable-hibernate). I just tested on both Ubuntu and Xubuntu 16.04, and it work on both. On Ubuntu I have to reboot for it to show in the menu. I will go ahead and close this as duplicate, but let me know if it fixes your problem or not, so I can reopen it. – Mitch Apr 25 '16 at 06:43
  • Take a look at a [workaround I used](http://askubuntu.com/a/763516/51672) – Enkouyami Apr 27 '16 at 03:22
  • @Enkouyami Thank you. What precisely do you mean by "and add your swap partition inside." - like this: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash /dev/sda3" – nsandersen Apr 29 '16 at 21:31
  • What's the content of `/var/log/pm-suspend.log` after you run `sudo pm-hibernate`? (I'm aware it doesn't suspend the computer but it should generate some interesting log entries.) The output of `sudo dmesg` should also contain something worthwhile (only look at the entries generated since running `pm-hibernate`). – David Foerster Apr 29 '16 at 21:36
  • @DavidFoerster Thank you. For the first one there is unfortunately "No such file or directory". Or perhaps that is a clue in itself! The end of the dmesg output is the same before/after running sudo pm-hibernate.. or do I need to look elsewhere than at the end of the output? – nsandersen Apr 29 '16 at 21:52
  • 2
    That is extremely odd. Can you please add this crucial information to your question? Does is change anything if you reinstall `pm-utils` (`sudo apt-get install --reinstall pm-utils`)? What's in `/etc/pm/config.d/` and `/etc/pm/sleep.d/`? – David Foerster Apr 29 '16 at 23:37
  • David - I will try, tomorrow - need sleep. @Enkouyami - tux/ice seems to hibernate and I get a progress bar when resuming, however after that it seems to switch the screen off. It might be fully booted, but just with a black screen, had that a few versions back too, but I cannot remember the solution. Thank you both. – nsandersen Apr 29 '16 at 23:46
  • @DavidFoerster Thank you! Uninstalling tux on ice and reinstalling pm-utils did it. Do you want to phrase an answer? I don't mind looking foolish :) To answer your other point if it is still interesting, /etc/pm/config.d was empty, /etc/pm/sleep.d contained the directories 10_grub-common, 10_unattended-upgrades-hibernate and novatel_3G_suspend and the file 20_custom-ehci_hcd. – nsandersen Apr 30 '16 at 21:16
  • You can write an answer based on that when/if this question is re-opened. – David Foerster Apr 30 '16 at 21:28
  • @Mitch - in view of the extra info edited in and comment trail, should it still be a duplicate? (Yes may be a valid answer.) It looks like the problem was that pm-hibernate was not properly installed from the Ubuntu 16 CD. – nsandersen Apr 30 '16 at 21:41
  • This indeed very odd. I had a 16.04 machine (T560) that was last updated on 19th April and had uswsusp working which is broken after todays update and the config file was deleted. The 15.10 (T530) machine that I upgraded today has no problems. – LiveWireBT May 01 '16 at 21:00
  • Some more investigation here from my side: I compared both /etc directories and /usr/lib/pm-utils/sleep.d in meld and couldn't find anything related after reinstalling pm-utils and uswsusp. Just before trying to reinstall I remembered that I should turn off secure boot for the way I load the installer ISO. I booted again into the system and found that hibernate works and the menu option is back again. This is reproducible on the other machine where I forgot to turn back on secure boot at some time in the past. (Yes the T560 performed hibernation on 16.04 at the 19th with secure boot on.) – LiveWireBT May 02 '16 at 23:10
  • I have the problem of "sudo pm-hibernate outputs nothing and appears to do nothing." on an Acer 4730Z as well. It too hibernated without problem on earlier versions. I get the following in pm-suspend.log: `Running hook /usr/lib/pm-utils/sleep.d/000kernel-change thaw hibernate: /usr/lib/pm-utils/sleep.d/000kernel-change thaw hibernate: success.` Which looks like it might be hibernating and immediately unhibernating. However, I do not see the disk activity I would expect if the image were actually being written to disk. I have enough SWAP and the 4730Z was built before secure boot. – Hugh Buntu Jul 24 '17 at 02:38

2 Answers2

3

You need to disable Secure Boot if you are using UEFI.

With Secure Boot enabled hibernation is disabled for security reasons.

Pilot6
  • 88,764
  • 91
  • 205
  • 313
  • 1
    Since Ubuntu won't tell you this, judging from OP, how would one quickly check whether Secure Boot is enabled? – matanster Jun 17 '18 at 12:16
0

In terminal, try sudo systemctl hibernate. If the system is able to do so, i.e. has enough swap space, it should work. Use of this command requires a password, which is not necessarily a bad thing, because it makes one pause to consider that the current system state is being recorded to a possibly-unencrypted HDD.

To make a Hibernate keyboard shortcut:

  • Press System and type key.
  • Select Keyboard settings.
  • on the Shortcuts tab, add to Custom Shortcuts the command systemctl hibernate and set a key combination. Note that sudo is not used here, though a password is requested when using the shortcut.