Enabling hibernation on Lubuntu

This is a simple guide to enable hibernation on Lubuntu.
It took me eight hours to fix, hopefully it wont take you this long.

  1. 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
  2. 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”
  3. We will be using s2disk for our hibernation, install it with he following command:
    aptget install uswsusp

    If the configuration wizard doesn’t start automatically type:
    sudo dpkg-reconfigure uswsusp

  4. 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=oneshot
    ExecStart=/bin/bash /opt/sleepscripts/s2disk.sh
    And /etc/systemd/system/systemd-hybrid-sleep.service
    [Service]
    Type=oneshot
    ExecStart=/bin/bash /opt/sleepscripts/s2both.sh
  5. Restart, and it should work

Kommentera

E-postadressen publiceras inte. Obligatoriska fält är märkta *