8

I have Kubuntu 16.04 64-bit installed on my HP Pavilion 17-f000 Notebook. I've tried the steps from the ubuntu 16.04 wiki, but the sudo pm-hibernate terminal command did nothing and creating the /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla file with these contents also had had no effect:

[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

I have 5.8GiB ram, 7.5GiB swap partition, and suspending to ram works fine.

5
  • 1
    How large is the swap partition. Suspend to disk, aka hibernation, doesn't work if swap size is less then RAM. – mikewhatever Apr 23 '16 at 19:16
  • 1
    My swap partition is 7.5 GiB and my ram is 5.8 GiB. – Enkouyami Apr 23 '16 at 20:08
  • Adding resume=/dev/myswapdevice to my /etc/default/grub and running sudo update-grub – Enkouyami Apr 25 '16 at 8:16
  • does not help. I didn't notice I didn't complete my previous comment. – Enkouyami Apr 25 '16 at 22:19
  • As regards the piece of docs you linked to (which is part of the official documentation), it's out of date and will be updated in a few weeks. Please see launchpad.net/bugs/1575466 – Gunnar Hjalmarsson Jun 12 '16 at 19:51
5

This is probably due to changes & regressions introduced in the 4.4.0 kernel such as this with Ubuntu 16.04, but I do have a workaround for 4.4.0:

I first added my swap partition to grub, rebooted, and there was no change. Next I installed the Ubuntu kernel packages with TuxOnIce stable and the option to hibernate appeared, but that failed. I later I installed the package hibernate which uses uswsusp for suspending to disk & ram and that worked. Below are the exact steps to achieve this:

  1. Double check if your swap partition/file(s) are setup correctly in /etc/default/grub; you can do so by checking the location with either cat /proc/swaps or swapon -s.

    Better yet, find out the UUID or label of the swap partition/files(s) and use that:

    tail -n -9 /proc/swaps | cut -d ' ' -f 1 | xargs sudo blkid
    
  2. Edit /etc/default/grub by finding the line with GRUB_CMDLINE_LINUX_DEFAULT=, add your swap device(s), and save. To enter the UUID, prefix it with UUID= or /dev/by-uuid/.

  3. Save changes to GRUB:

    sudo update-grub
    
  4. Add the TuxOnIce stable repository:

    sudo add-apt-repository ppa:tuxonice/ppa
    
  5. Install TuxOnIce kernel & uswsup:

    sudo apt update
    sudo apt install uswsusp linux-generic-tuxonice tuxonice-userui
    
  6. Restart your computer (sudo reboot;)

9
  • 3
    Hey, I am able to hibernate my system using ' sudo pm-hibernate ', but there is no option to hibernate(on click upon top-right settings icon). – Nikhil Verma Jun 27 '16 at 18:05
  • 2
    @NikhilVerma try this answer: askubuntu.com/a/462480/51672 – Enkouyami Jul 13 '16 at 0:13
  • 2
    So by "add your swap device" you mean add "resume=/dev/yourswap" ? – misiu_mp Jan 2 '17 at 6:35
  • 2
    What exactly is meant by "add your swap device(s), and save. "? – Alex Jan 11 '17 at 19:34
  • 2
    @Alex According to this (askubuntu.com/a/196365/187411) it means to append the string resume=UUID=[your UUID] to the string that is already there. For example GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=549ae7468" – ossbuntu Oct 27 '17 at 16:21
2

I had the exact same problem in Ubuntu 16.04, and nothing seemed to help.

I finally figured out that I just had to disable Secure Boot in the BIOS menu. I had already done the steps suggested in the accepted answer, so I can't say whether they were necessary in my case.

Not the answer you're looking for? Browse other questions tagged or ask your own question.