4

After upgrading from ubuntu 16.04 to 16.10 the hibernate function no longer works. When hibernate is invoked the machine hangs. Under 16.04 it worked perfectly. Trying "sudo pm-hibernate" also fails.

  • Please give hardware details. –  Oct 19 '16 at 10:45
  • At times like this it's a good time to learn where system error messages are stored. Looking '/var/log/syslog' is a good place to start. Then copy and paste anything that looks relevant into your question... Thanks. – WinEunuuchs2Unix Oct 19 '16 at 11:49
  • 1
    It did not work in 16.04 for a few months if you installed kernel updates. – Pilot6 Oct 19 '16 at 15:16

3 Answers3

2

I've come to the same issue very recently (this week or the previous). What has been working for me is combination of @richbl s answer somewhere just here around, @morhook answer in this thread and my own answer in this one. I post it all here to have it in one place.

What I did to make the hibernation work again on my ASUS U36SD running Xubuntu 16.10 "Yakkety Yak":

  1. Stop using sudo pm-hibernate - it is not working any more.

  2. Modify the /etc/default/grub so that the GRUB_CMDLINE_LINUX_DEFAULT variable contains also pci=nomsi resume=UUID=XXXXXXXX, where XXXXXXXX is the UUID of the swap partition. To determine the UUID of your swap, use:

    lsblk -o name,fstype,uuid
    

    Full example here:

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pci=nomsi resume=UUID=d30170d7-b3a2-38c5-a386-541a6d0013c7"
    
  3. Update the new grub configuration:

    sudo update-grub
    
  4. Create a new file com.ubuntu.enable-hibernate.pkla in /etc/polkit-1/localauthority/50-local.d/:

    sudo nano /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
    

    and fill it with this content:

    [Re-enable hibernate by default in upower]
    Identity=unix-user:*
    Action=org.freedesktop.upower.hibernate
    ResultActive=yes
    
    [Re-enable hibernate by default in logind]
    Identity=unix-user:*                            
    Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.hibernate-multiple-sessions
    ResultActive=yes
    
  5. If you are using encryption, you must tweak it a little bit more - it is well described here.

  6. Reboot the computer.

  7. You should now be able to see the hibernate option in the poweroff menu and it should work.

crysman
  • 508
  • 8
  • 17
  • I've made a bugreport on launchpad: https://bugs.launchpad.net/ubuntu/+source/pm-utils/+bug/1641919 – crysman Nov 15 '16 at 11:37
  • Unfortunatelly, in my case, this works only for first hibernation after fresh boot :/ Any next hibernation would fail ending-up with a login screen like if I had just locked the desktop – crysman Nov 16 '16 at 14:05
  • With the above I have the same issue, only the first hibernation works. However subsequent hibernations will cause the machine to hang. – Terry Dixon Nov 20 '16 at 23:22
0

Hibernation does not work with UEFI Secure Boot enabled on new Ubuntu kernels for security reasons.

You need to disable Secure Boot if you want to use hibernation.

Pilot6
  • 90,100
  • 91
  • 213
  • 324
0

Not sure if it's better to post a link that might solve your problem, or to repost that solution below:


Since you're running Ubuntu 16.04, you should consider running the native systemd suspend/hibernate services in lieu of the pm-utils tools.

In my own case, here's what I've done to configure my machine for hibernate/resume using systemd:

  1. In etc/default/grub, configure GRUB_CMDLINE_LINUX_DEFAULT to include the resume parameter, passing the UUID of the swap partition in question (i.e., resume=UUID=453f0121-505d-42d3-8dad-87f913e67ddc). My current GRUB_CMDLINE_LINUX_DEFAULT is

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pci=nomsi resume=UUID=453f0121-505d-42d3-8dad-87f913e67ddc"

  2. Run sudo update-grub

  3. Edit/confirm resume=UUID=453f0121-505d-42d3-8dad-87f913e67ddc entry in resume file located in /etc/initramfs
  4. Run sudo update-initramfs -u
  5. Edit /etc/systemd/logind.conf to set HandleLidSwitch=hibernate (optional: permits hibernate to start on lid close)
  6. Run sudo service systemd-logind restart
  7. Reboot for good measure

I've bold-faced the two parameters that--for my machine--are important: pci=nomsi and resume=UUID=[your swap partition]. While the latter parameter is pretty well understood and is often refenced when talking about enabling hibernate on a Debian system, it took a bit of discovery to find the need for the former.

Best of luck!

richbl
  • 2,303
  • For future reference: copy information here into answers from appropriate sources -- so it's here and so in case the other end goes away, it's here :) – cat Dec 14 '16 at 13:40