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.

2 Answers2

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;)

vaselo
  • 5
  • 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: https://askubuntu.com/a/462480/51672 – Obsidian Jackal Jul 13 '16 at 00:13
  • 2
    So by "add your swap device" you mean add "resume=/dev/yourswap" ? – misiu_mp Jan 02 '17 at 06:35
  • 2
    What exactly is meant by "add your swap device(s), and save. "? – Alex Jan 11 '17 at 19:34
  • Swap devices are designated areas the OS uses to swap out memory stored in RAM to your hard drive. You need to add those to the /etc/default/grub file, so when you come back from hibernating, GRUB will know where to look, in order to move it back to the RAM to resume your session. – Obsidian Jackal Jan 12 '17 at 15:00
  • 2
    @Alex According to this (https://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
  • @ossbuntu I followed all the steps. When I do: tail -n -9 /proc/swaps | cut -d ' ' -f 1 | xargs sudo blkid it results: /dev/sda9: UUID="446fad30-4abb-4b70-91b0-0e09059e0a14" TYPE="swap" PARTUUID="150f68f3-b6a2-48c9-825a-5cac06e1225d". So, I finally make the change in /etc/default/grub like: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=446fad30-4abb-4b70-91b0-0e09059e0a14". After all these I run in terminal: sudo pm-hibernate and system goes to hibernate. When i press power button I select ubuntu and black screen appears and system does not goes to login screen. any fix? – LearningROR Apr 22 '18 at 10:34
  • @LearningROR I don't know... but I included the quiet splash words in my example just because they were there beforehand for my computer. Maybe quiet splash doesn't work for your computer, I honestly don't know what they mean or what they do, but you should only include whatever words were there beforehand and add the resume=[UUID] part – ossbuntu Apr 23 '18 at 13:40
  • @ossbuntu ahh ok. No problem. I tried all possible options but nothing seems to work for me. :) I am using Dell Inspiron 5558 – LearningROR Apr 26 '18 at 11:09
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.

danmou
  • 191