Fixing Hibernation That Never Powers Off on Fedora

Tadios Abebe | Oct 26, 2026 min read

In a previous post I wrote about enabling hibernation on Fedora Workstation. Hibernation was working, my session was restored every time I powered the machine back on, but there was a weird behavior I kept noticing on my HP EliteBook 830 G9 running Fedora 44.

After clicking Hibernate, the screen would go off but the keyboard backlight would light up and the power button indicator would stay on. It would stay like that for hours. The only way to turn it off was to hold the power button for a few seconds. When I powered it back on, the session was restored as if nothing happened.

So hibernation itself was working, but the machine never actually powered off. This means the battery keeps draining while the laptop is supposedly hibernated, and if you force it off too early you lose your session completely.

In this post I will go through how I found the cause and how to fix it.

How Hibernation Powers Off

To understand the problem, we need to know what happens after you click hibernate:

  • The kernel freezes all processes and turns off devices, including the display.
  • It creates a snapshot of RAM and writes it to the swap file.
  • Once the image is written, the kernel powers off the machine.

That last step can be done in different ways. The kernel exposes the available methods in /sys/power/disk:

cat /sys/power/disk
[platform] shutdown reboot suspend test_resume

The one in brackets is the active mode. By default systemd uses platform, which means the kernel asks the firmware to put the machine into the ACPI S4 sleep state. The firmware is then responsible for cutting the power.

The other option, shutdown, skips the firmware’s S4 handling and simply powers off the machine like a normal shutdown (ACPI S5).

Finding the Cause

1. Check if the Image Is Being Written

  • The first thing I wanted to know was whether the hibernation image was written to disk at all. If the session was restored after a forced power off, the image is clearly there, but let’s confirm it from the logs.

  • List the previous boots:

journalctl --list-boots
  • Then look for hibernation entries and exits in the current boot:
journalctl -b 0 | grep -E "Performing sleep|hibernation (entry|exit)|returned from sleep"
  • In my case most hibernations ended with System returned from sleep operation 'hibernate', which means the image was written and resumed correctly.

2. Check Failed Resumes

  • A few times I lost my session after hibernating. To see why, check the kernel log of the boot that came right after:
journalctl -b 0 -k | grep -i "image not found"
PM: Image not found (code -22)
  • This means there was no valid image on the swap file. In both cases the machine was powered off with the power button only a couple of minutes after hibernation started, which interrupted writing the image.

3. Putting It Together

  • The image is written successfully.
  • The kernel then moves to the final stage and asks the firmware to enter S4.
  • The power is never cut, so the keyboard light and power LED stay on indefinitely.

At this point my suspicion was the firmware’s S4 handling, which is a known issue on a number of HP laptops (and some other vendors). But the logs can’t confirm that, because everything the kernel prints after the image is written is lost once the machine is forced off. So let’s watch it happen.

Validating the Issue

The idea is to hibernate once with the default platform mode and once with shutdown mode, while keeping the kernel messages visible on screen, and compare where each one ends.

In platform mode, the last things the kernel does are:

  • Write the image and print PM: Image saving done.
  • Prepare devices for S4, print ACPI: PM: Preparing to enter system sleep state S4 and take the non-boot CPUs offline.
  • Hand over to the firmware’s S4 entry. Nothing is printed after this because the power should be cut.

In shutdown mode, the kernel skips the S4 stage and prints reboot: Power down right before cutting the power.

Save your work before doing this, you will most likely have to hold the power button at the end of the platform test.

1. Switch to a Text Console

  • The kernel messages are printed on the text console, not on your desktop. Switch to one with Ctrl+Alt+F3 and log in.

2. Make Sure Platform Mode Is Active

  • Check the current mode, it should be [platform]:
cat /sys/power/disk
  • If you already applied the fix from the next section, temporarily disable it by renaming the drop-in:
sudo mv /etc/systemd/sleep.conf.d/hibernate-mode.conf /etc/systemd/sleep.conf.d/hibernate-mode.conf.off

3. Keep Kernel Messages Visible

  • By default the kernel suspends the console during hibernation, and Fedora boots with quiet which hides most kernel messages. We can change both at runtime, nothing here survives a reboot.

  • Keep the console active while devices are suspended:

echo N | sudo tee /sys/module/printk/parameters/console_suspend
  • Enable extra power management debug messages:
echo 1 | sudo tee /sys/power/pm_debug_messages
  • Print all kernel messages to the console:
sudo dmesg -n 8

4. Hibernate and Watch the Screen

  • Run:
systemctl hibernate
  • Use systemctl hibernate instead of echo disk > /sys/power/state. systemd stores the location of the swap file in a UEFI variable before hibernating, so your session can still be resumed after you force the machine off.

  • Watch the messages and take a picture of the screen once it stops moving. In my case the output ended like this:

PM: Compressing and saving image data (1443865 pages)...
PM: Image saving progress:   0%
PM: Image saving progress:  10%
...
PM: Image saving progress: 100%
PM: hibernation: Wrote 5775460 kbytes in 7.48 seconds (772.12 MB/s)
PM: Image size after compression: 3643292 kbytes
PM: Image saving done
PM: S
  • The image was fully written in under 8 seconds, so writing the image is not the problem. Right after Image saving done the screen stopped updating in the middle of a line, and the keyboard light and power LED stayed on until I held the power button.

  • You will also see ACPI: PM: Preparing to enter system sleep state S4 earlier in the output, before the image is created. Don’t let that confuse you, that is the kernel preparing to take the snapshot, not the actual S4 entry.

5. Repeat with Shutdown Mode

  • Restore the drop-in (or create it as shown in the next section):
sudo mv /etc/systemd/sleep.conf.d/hibernate-mode.conf.off /etc/systemd/sleep.conf.d/hibernate-mode.conf
  • After resuming, the debug settings from step 3 are still active, but run them again if you rebooted in between. Then hibernate again:
systemctl hibernate
  • This time the output should end with reboot: Power down and the machine should turn off completely.

6. What This Tells Us

  • Both runs use the same kernel, the same drivers and write the same image. The only difference is how the machine is powered off at the end.
  • With platform mode the machine hangs in the final S4 stage. With shutdown mode it powers off normally.
  • So the problem is in the platform S4 stage. On an HP laptop the most likely cause is the firmware, but strictly speaking we can’t see whether it hangs inside the firmware’s S4 entry or in a driver preparing for it, because the display stops before those last steps are printed. Capturing those would require something like a USB serial console or netconsole, which is not worth it when shutdown mode already fixes the problem.

Since a normal power off works fine on these machines, the fix is to tell the kernel to use a regular power off at the end of hibernation instead of S4.

The Fix: Change HibernateMode to shutdown

systemd controls this through the HibernateMode option in sleep.conf. You can see the defaults with:

cat /usr/lib/systemd/sleep.conf
[Sleep]
#HibernateMode=platform shutdown

systemd tries platform first and only falls back to shutdown if platform is not available. We want to use shutdown directly.

1. Create a Drop-in Directory

  • Instead of editing the main configuration file, we will create a drop-in:
sudo mkdir -p /etc/systemd/sleep.conf.d

2. Set HibernateMode

  • Create a drop-in file that sets the hibernate mode to shutdown:
printf '[Sleep]\nHibernateMode=shutdown\n' | sudo tee /etc/systemd/sleep.conf.d/hibernate-mode.conf

3. Test Hibernation

  • No reboot is required, systemd reads this configuration every time you hibernate. Run:
systemctl hibernate
  • The screen will go off and the LEDs will stay on for a few seconds while the image is written to disk. After that the machine should power off completely with all LEDs turned off.

  • Press the power button and your session should be restored.

Trade-off

With HibernateMode=shutdown the firmware no longer knows the machine is hibernated, it treats it as a regular shutdown. This means wake sources like opening the lid or pressing a key will not resume the machine, you have to use the power button. For most people this is how hibernation is used anyway, so it is not a big deal.

Reverting the Changes

1. Revert the Debug Settings

  • The debug settings from the validation steps are runtime only, so a reboot resets them. If you want to revert them without rebooting:
echo Y | sudo tee /sys/module/printk/parameters/console_suspend
echo 0 | sudo tee /sys/power/pm_debug_messages
sudo dmesg -n 3
  • 3 is the default console log level on Fedora when booting with quiet. You can check your original values with cat /proc/sys/kernel/printk after a reboot, the first number is the console log level.

2. Revert the HibernateMode Fix

  • If a future BIOS update fixes the S4 issue, or you want to go back to the default behavior for any reason, remove the drop-in:
sudo rm /etc/systemd/sleep.conf.d/hibernate-mode.conf
  • If you renamed it during the validation steps, remove that one instead:
sudo rm /etc/systemd/sleep.conf.d/hibernate-mode.conf.off
  • No reboot is required. Next time you hibernate, systemd will go back to its default HibernateMode=platform shutdown. You can confirm the active configuration with:
systemd-analyze cat-config systemd/sleep.conf

If you are seeing the same weird behavior where your laptop never powers off after hibernation, give this a try.

comments powered by Disqus