3

How do you enable hibernate on Ubuntu 18.04?

My system is an ASUS Z10PE-D16, ASSUS Geforce GTX 1080TI TURBO, 128 GB memory Multiple disks.


Installed Ubuntu Desktop 18.4 Found https://help.ubuntu.com/community/PowerManagement/Hibernate
I followed the first method of 3: SWSUSP:

To hibernate we use the built in function of the kernel.
To resume we use dracut.

First install dracut: sudo apt install dracut
Run dracut: dracut
dracut genertates a new initrd file with other name: initramfs... in stead of initrd...
now remove the original inird file(s): sudo rm /boot/initrd
add resume /dev/sdx to /etc/default/grub on parameter GRUB_CMD_DEFAULT:
like: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=/dev/sdxy"
sdxy is the swap-partition. (size of swap at least sizeofmemory + 1G).
now update grub: sudo update-grub
Restart system: reboot

Now test hibernate:

sudo -S bash -c 'echo shutdown > /sys/power/disk'  
sudo -S bash -c 'echo disk > /sys/power/state'

or try also:

sudo -S bash -c 'echo platform > /sys/power/disk'  
sudo -S bash -c 'echo disk > /sys/power/state' 

one or another could not work.
System will now hibernate: that take some time depending on the amount of memory used and speed of swap.
System powers down.

Test Resume:
Poweron system:
Again it will take some time.
Hopefully your session is presented.
On one of my systems I have to press ctrl+alt F9 to show session.

Warning:
When hibernating with the test-scenario one will observe that there is a security issue: when system resumes the session is active again without asking for the password.
In the "settings power" set Hibernate on "When the Power Button is pressed"
Then on resume password is needed.
You can use the power icon to really power-off the system.

David Foerster
  • 35,754
  • 55
  • 92
  • 145
user829738
  • 31
  • 3
  • 4
    While we appreciate people wanting to share their knowlage, this is a Q&A site and you must use that format. Ask your question and then answer it yourself, otherwise this will just be removed and your time wasted. – Mark Kirby May 14 '18 at 12:03
  • Possible duplicate of [Ubuntu 18.04 can't resume after hibernate](https://askubuntu.com/a/1038856/349837). See also: [How to go automatically from Suspend into Hibernate?](https://askubuntu.com/a/1075860/349837) and [Hibernation using systemctl and getting it working in tough cases](https://askubuntu.com/a/821122/349837) from [How can I hibernate on Ubuntu 16.04?](https://askubuntu.com/q/768136/349837). – Pablo Bianchi Mar 08 '19 at 19:56

0 Answers0