I recently switched to Fedora KDE, and have been having issues with battery drain when sleeping.
Deep sleep is not available, so i’ve set up hibernation, which works fine on its own. But when trying to configure hibernation after sleep, it doesn’t go into hibernation after the specified amount of time.
Using systemctl suspend-then-hibernate correctly enters sleep and hibernates after the set amount of time, but trying any other way doesn’t work. Additionally it has worked perfectly shortly before, but then stopped working again, no major changes in between.
What i’ve tried
Using the Power management, setting “When sleeping, enter:” to “Standby then hibernate”
Setting HibernateDelaySec=60AllowSuspendThenHibernate=yes in both /usr/lib/systemd/sleep.conf and /etc/systemd/sleep.conf
Attempting to sleep using both power button, closing the lid and timing out
Update system using sudo dnf upgrade --refresh
System info
Operating System: Fedora Linux 43
KDE Plasma Version: 6.5.5
KDE Frameworks Version: 6.22.0
Qt Version: 6.10.1
Kernel Version: 6.18.7-200.fc43.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 20 × 12th Gen Intel® Core™ i7-12700H
Memory: 32 GiB of RAM (31.0 GiB usable)
Graphics Processor 1: Intel® Iris® Xe Graphics
Graphics Processor 2: NVIDIA GeForce RTX 3050 Ti Laptop GPU
Manufacturer: Dell Inc.
Product Name: XPS 15 9520
Please let me know if any more info is needed.
Thanks in advance
Your setting HibernateDelaySec=60 only allows 60 seconds between suspend and hibernation. I would extend that to at least 300 (5 minutes)
Having those settings in both /usr/lib/systemd/sleep.conf and /etc/systemd/sleep.conf may cause conflict since both are read by systemd and are not necessarily in sync when read. User settings are intended to be placed under /etc/systemd/. The other is an example of attributes that users can select, and is subject to change with systemd updates. Settings in /etc/systemd/sleep.conf are intended to override settings in /usr/lib/systemd/sleep.conf.
The 60 seconds between sleep and hibernation is purely for testing, i’d of course use a bigger interval whenever it works.
Having the config in only /etc/systemd/ or /usr/lib/systemd/ doesn’t make any difference, the laptop still won’t enter hibernation after sleeping for a while.
Have you created the physical swap space that is mandatory for hibernation?
Have you entered the proper resume=,UUID> entry into the kernel command line so the kernel knows where to read the RAM image when resuming from hibernation?
The command swapon should show all configured swap spaces used and hibernation requires a physical swap space (file or partition) equal to or larger than the physical RAM to store data from RAM when hibernating. Without that space hibernation cannot be achieved.
Restarting from hibernation requires that there be an option in the kernel command line to tell the system what swap to read when resuming.
60 seconds may be causing a race condition. It is possible that the system has not fully settled from sleep into suspend before it attempts to hibernate. If it has not fully suspended then it may not be possible to hibernate with the suspend-then-hibernate service
I still suggest increasing that delay even for testing.
Note that I do not use hibernation so this is merely a logical assumption and not tested by me.
It has worked once or twice with 60 seconds. I have also tested it with longer timeouts (5, 10, 15 minutes), and that hasn’t worked.
So i don’t think that’s it.