1

I've read these two official documentations on the matter: https://wiki.debian.org/Hibernation#Suspend_and_hibernate_configuration_in_Debian_Jessie https://wiki.debian.org/SystemdSuspendSedation

I've tried to make this simple script to see if anything is working:

I've installed all the packages they mention in the post.

# /etc/pm/sleep.d/suspend.sh
#
# The /etc/pm/sleep.d is the right place to put your custom suspend/resume scripts.
# None of the stuff in /etc/hibernate/ has _any_ effect (OnResume, RestartServices,
# UnloadModules etc). The /etc/init.d/atheros script is just a simple wrapper for
# unloading the ath_pci module.

case "$1" in
        hibernate|suspend)
        logger went to hibernate or suspend!
                ;;
        thaw|resume)
        logger resumed from hibernation or suspend!
                ;;
        *) exit $NA
                ;;
esac

No logger outputs.

so then I edited this file: /etc/acpi/lid.sh

and added this code

grep -q closed /proc/acpi/button/lid/*/state
if [ $? = 0 ]
then
  rfkill block all && hibernate -k -f
else
  rfkill unblock all
fi

If I try the suspend button that seems to work, the laptop goes to sleep and wakes up after a little while if I press the power button. Checking the logs I see these messages dealing with suspend.

Dec 14 00:25:16 host systemd[1]: Configuration file /etc/systemd/system/suspend-sedation.service is marked executable. Please remove executable permission bits. Proceeding anyway.
Dec 14 00:25:16 host systemd[1]: Configuration file /etc/systemd/system/suspend-sedation.service is marked executable. Please remove executable permission bits. Proceeding anyway.
Dec 14 00:25:35 host systemd[1]: Configuration file /etc/systemd/system/suspend-sedation.service is marked executable. Please remove executable permission bits. Proceeding anyway.
Dec 14 00:25:35 host systemd[1]: Configuration file /etc/systemd/system/suspend-sedation.service is marked executable. Please remove executable permission bits. Proceeding anyway.
Dec 14 00:30:22 host systemd[1]: Configuration file /etc/systemd/system/suspend-sedation.service is marked executable. Please remove executable permission bits. Proceeding anyway.
Dec 14 00:30:22 host systemd[1]: Configuration file /etc/systemd/system/suspend-sedation.service is marked world-writable. Please remove world writability permission bits. Proceeding anyway.
Dec 14 00:30:22 host systemd[1]: Configuration file /etc/systemd/system/suspend-sedation.service is marked executable. Please remove executable permission bits. Proceeding anyway.
Dec 14 00:30:22 host systemd[1]: Configuration file /etc/systemd/system/suspend-sedation.service is marked world-writable. Please remove world writability permission bits. Proceeding anyway.
Dec 14 00:31:43 host systemd[1]: [/etc/systemd/system/suspend-sedation.service:1] Missing '='.
Dec 14 00:31:48 host systemd[1]: [/etc/systemd/system/suspend-sedation.service:1] Missing '='.
Dec 14 00:32:11 host systemd[1]: [/etc/systemd/system/suspend-sedation.service:1] Unknown section 'unit'. Ignoring.
Dec 14 00:33:07 host systemd[1]: [/etc/systemd/system/suspend-sedation.service:1] Unknown section 'unit'. Ignoring.
Dec 14 00:36:26 host swapon[571]: swapon: /dev/sda4: software suspend data detected. Rewriting the swap signature.
Dec 14 00:36:26 host rsyslogd-2007: action 'action 17' suspended, next retry is Mon Dec 14 00:36:56 2015 [try http://www.rsyslog.com/e/2007 ]
Dec 14 00:41:38 host swapon[588]: swapon: /dev/sda4: software suspend data detected. Rewriting the swap signature.
Dec 14 00:41:38 host rsyslogd-2007: action 'action 17' suspended, next retry is Mon Dec 14 00:42:08 2015 [try http://www.rsyslog.com/e/2007 ]
Dec 14 00:54:53 host swapon[561]: swapon: /dev/sda4: software suspend data detected. Rewriting the swap signature.
Dec 14 00:54:53 host rsyslogd-2007: action 'action 17' suspended, next retry is Mon Dec 14 00:55:23 2015 [try http://www.rsyslog.com/e/2007 ]
Dec 14 01:05:22 host swapon[527]: swapon: /dev/sda4: software suspend data detected. Rewriting the swap signature.
Dec 14 01:05:22 host rsyslogd-2007: action 'action 17' suspended, next retry is Mon Dec 14 01:05:52 2015 [try http://www.rsyslog.com/e/2007 ]
Dec 14 01:09:21 host kernel: [  186.002598] Suspending console(s) (use no_console_suspend to debug)
Dec 14 01:09:21 host kernel: [  186.046622] wl_suspend: PCI Suspend handler
Dec 14 01:09:21 host kernel: [  186.046631] wl_suspend: Not WOWL capable
Dec 14 01:09:21 host kernel: [  186.641662] PM: suspend of devices complete after 639.250 msecs
Dec 14 01:09:21 host kernel: [  186.642043] PM: late suspend of devices complete after 0.379 msecs
Dec 14 01:09:21 host kernel: [  186.657547] PM: noirq suspend of devices complete after 15.511 msecs


[  186.046622] wl_suspend: PCI Suspend handler
[  186.046631] wl_suspend: Not WOWL capable
[  186.641662] PM: suspend of devices complete after 639.250 msecs
[  186.642043] PM: late suspend of devices complete after 0.379 msecs
[  186.657547] PM: noirq suspend of devices complete after 15.511 msecs

now on to hibernate, that seems to just plain out die. It doesn't save state and everything I get sent all the way back to the EFI menu to chooser.

blubee@host:~$ sudo cat /var/log/syslog | grep "hiber"
Dec 14 00:36:26 host kernel: [    4.213177] PM: Looking for hibernation image.
Dec 14 00:41:38 host kernel: [    4.231179] PM: Looking for hibernation image.
Dec 14 00:54:53 host kernel: [    4.219918] PM: Looking for hibernation image.
Dec 14 01:05:22 host kernel: [    4.213743] PM: Looking for hibernation image.

and this output from dmesg

[    4.213743] PM: Looking for hibernation image.

by the way this laptop has 16GB of ram and I have 32GB swap, just to make sure. I've read that 32GB is overkill but I just had to test it out.

What else can I do to sort this thing out and get hibernate to work as expected?

1

Setting hybernation file

as mentioned on this post, setting the hybernation file could help...

  1. Find uuid of your swap partition. Suppose the partition is sdb3, then

    $ ls -l /dev/disk/by-uuid/ | grep sdb3
    lrwxrwxrwx 1 root root 10 окт.   9 08:59 1dd7e123-1f82-45f0-a202-0ff3ea6f081a -> ../../sdb3
    
  2. Open /etc/default/grub, and find the line starting with GRUB_CMDLINE_LINUX_DEFAULT=". Add there between the quotes resume=/dev/disk/by-uuid/your-swap-uuid. As an example:

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=/dev/disk/by-uuid/1dd7e123-1f82-45f0-a202-0ff3ea6f081a"
    
  3. Run as a root update-grub

bios settings

Another problem I had were some bios settings. I reloaded the bios defaults and it finally worked

  • At least as of Ubuntu 18.04 (and possibly also whatever upstream Debian version that corresponds to) it seems to be absolutely essential to set the resume parameter by UUID. Hopefully this saves someone else hours of debugging. – AnOccasionalCashew Nov 17 '18 at 3:57
0

You could specify the image location in your /etc/default/grub by pathing it like:

GRUB_CMDLINE_LINUX_DEFAULT="resume=/dev/sda4"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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