On a fresh install of EOS + i3 on my new Dell laptop when I close the laptop lid and then reopen it a few seconds later the screen is blank/off for a few seconds, then a frozen image of the DE the moment I closed the laptop is displayed. Completely unresponsive, cursor doesn’t move and a hard reset is required.
I followed the instructions here How to configure suspend-then-hibernate properly? - #3 by kagetora13 to set up suspend-then-hibernate as I thought maybe no hibernation or suspend functionality was configured out the box for EOS. However i’m still having exactly the same issue.
Here’s the last few lines from the log file
May 27 18:55:40 inspiron-5425 systemd[1]: Reached target Sleep.
May 27 18:55:40 inspiron-5425 systemd[1]: Starting System Suspend...
May 27 18:55:40 inspiron-5425 systemd-sleep[18521]: Entering sleep state 'suspend'...
Where do I go from here? Thanks
Some more information:
/etc/systemd/sleep.conf
[Sleep]
#AllowSuspend=yes
#AllowHibernation=yes
AllowSuspendThenHibernate=yes
#AllowHybridSleep=yes
#SuspendMode=
#SuspendState=mem standby freeze
#HibernateMode=platform shutdown
HibernateState=disk
#HybridSleepMode=suspend platform shutdown
#HybridSleepState=disk
#Suspend then Hibernate after 15 min
HibernateDelaySec=15min
I might not be able to offer much help with this issue but I wonder if you did try to just suspend or hibernate “separately” to see if they work as intended:
systemctl suspend
systemctl hibernate
Try one at a time to see if they effectively suspend or hibernate and then the system will wake up as it should afterwards.
sudo systemctl hibernate
Failed to hibernate system via logind: Not enough swap space for hibernation
With systmctl suspend same thing as before, frozen screen. However I’ve now discovered if I leave it 1 minute the laptop suddenly comes back to life and the screen updates.
Looks like there’s two separate issues going on here, hibernation swap issue and slow wake up from suspend. The jump between 20:53 to 20:55 is where the screen is frozen and i’m waiting for the laptop to come back to life.
May 27 20:53:52 inspiron-5425 systemd[1]: Reached target Sleep.
May 27 20:53:52 inspiron-5425 systemd[1]: Starting System Suspend...
May 27 20:53:52 inspiron-5425 systemd-sleep[136930]: Entering sleep state 'suspend'...
May 27 20:53:52 inspiron-5425 kernel: PM: suspend entry (s2idle)
May 27 20:53:52 inspiron-5425 kernel: Filesystems sync: 0.007 seconds
May 27 20:53:52 inspiron-5425 wpa_supplicant[628]: wlan0: CTRL-EVENT-DSCP-POLICY clear_all
May 27 20:53:52 inspiron-5425 wpa_supplicant[628]: wlan0: CTRL-EVENT-DSCP-POLICY clear_all
May 27 20:53:52 inspiron-5425 wpa_supplicant[628]: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
May 27 20:55:03 inspiron-5425 kernel: Freezing user space processes ... (elapsed 0.001 seconds) done.
May 27 20:55:03 inspiron-5425 kernel: OOM killer disabled.
May 27 20:55:03 inspiron-5425 kernel: Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
May 27 20:55:03 inspiron-5425 kernel: printk: Suspending console(s) (use no_console_suspend to debug)
Cheers, yeah I can live with a 1 minute wake up from suspend for now, it’s not the end of the world. Hopefully I can fix the hibernation for a semi workable system. I’ll try increasing the size of the swap file first, it’s 16GB and I’ve got 16GB ram.
Thanks for the suggestion. /sys/power/image_size is 6427271168, which I assume is bytes, so 6.4GB. In which case I assume the 17GB swap_file I now have is more than enough?
I’m using btrfs and a swap file, I assume the issue is somewhere there.
With that hibernation now starts, screen goes black for a few seconds, comes on again then the laptop powers down. On powering up, going through the grub menu again and logging in none of my environment has been saved and it looks like a fresh login.
May 28 01:21:55 inspiron-5425 systemd[1]: Reached target Sleep.
May 28 01:21:55 inspiron-5425 systemd[1]: Starting Hibernate...
May 28 01:21:55 inspiron-5425 kernel: PM: Image not found (code -16)
May 28 01:21:55 inspiron-5425 systemd-sleep[2853]: Entering sleep state 'hibernate'...
May 28 01:21:55 inspiron-5425 kernel: PM: hibernation: hibernation entry
May 28 01:21:55 inspiron-5425 wpa_supplicant[634]: wlan0: CTRL-EVENT-DSCP-POLICY clear_all
May 28 01:21:55 inspiron-5425 wpa_supplicant[634]: wlan0: CTRL-EVENT-DSCP-POLICY clear_all
May 28 01:21:55 inspiron-5425 wpa_supplicant[634]: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
looks like some special care needs to be taken with BTRFS swap
Hibernation into swap file on Btrfs
The resume_offset number can be computed using the tool btrfs_map_physical.c. Do not try to use the filefrag tool, on Btrfs the “physical” offset you get from filefrag is not the real physical offset on disk; there is a virtual disk address space in order to support multiple devices. [3]
Download or copy the tool btrfs_map_physical.c into a file named btrfs_map_physical.c, then compile it,
Note the the first physical offset returned by this tool. In this example, we use 4009762816. Also note the pagesize that can be found with getconf PAGESIZE.
To compute the resume_offset value, divide the physical offset by the pagesize. In this example, it is 4009762816 / 4096 = 978946.