This is a simple guide to enable hibernation on Lubuntu.
It took me eight hours to fix, hopefully it wont take you this long.
- Make sure you have a swap partition! NOTE SWAP PARTITION it’s much simpler.
There are multiple guides online to setup the swap area,
see this as an example: https://help.ubuntu.com/community/SwapFaq - Enable the hibernate buttons by editing this file:
sudo nano /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla[Disable hibernate by default in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=no[Disable hibernate by default in logind]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions;org.freedesktop.login1.hibernate-ignore-inhibit
ResultActive=noto ”yes” - We will be using s2disk for our hibernation, install it with he following command:
apt–get install uswsusp
If the configuration wizard doesn’t start automatically type:
sudo dpkg-reconfigure uswsusp
-
Now we need to tell the system to use s2disk so do the following:cp /lib/systemd/system/systemd-hibernate.service /etc/systemd/system/cp /lib/systemd/system/systemd-hybrid-sleep.service /etc/systemd/system/
And edit the /etc/systemd/system/systemd-hibernate.service
[Service]Type=oneshotExecStart=/bin/bash /opt/sleepscripts/s2disk.shAnd /etc/systemd/system/systemd-hybrid-sleep.service[Service]Type=oneshotExecStart=/bin/bash /opt/sleepscripts/s2both.sh - Restart, and it should work