Will hibernate ever work out of the box?

One of the biggest barrier to Fedora being adopted by normies on a large scale is the lack of hibernation. I know it’s not a straightforward thing that (if I understand correctly) depends on hardward, disk management, etc, but I’m wondering: will we ever have hibernation out of the box on Fedora?

“Normies” have never even heard of hibernation.

The latest documentation is here. Looks like it’s been a while since anybody has worked on hibernation.

They don’t need to hear about it because it’s the default behavior when you close your laptop on most mainstream machines, so they don’t even need to know what it means. And as a result, it’s the expected behavior on modern machines.

Thanks, yeah it’s been a while!

Not true. Closing the laptop uses suspend and not hibernation.

There is a distinct difference, in that Suspend keeps everything in ram ready to resume and the machine idles at its lowest power state.

Hibernation, on the other hand, requires a physical swap space on the drive where everything from ram is written to the device and the system fully powers off. Resuming from hibernation requires the machine be manually powered on and it then reads the data that was stored in the physical swap to recover the pre-hibernation state.

So maybe you mean suspend to RAM (closing the lid and machine sleeps), and not suspend to disk (“hibernation”, where the machine is entirely turned off)?

suspend to RAM works out of the box in Fedora, at least on all my current and past machines

suspend to disk is not supported (out of the box) and likely won’t any time soon.

I disagree with you on this.

Back when I used Windows, I used to hibernate all the time just because it was difficult to restore the exact state with many apps and files open. It was simply easier to hibernate, especially in the past when systems were slower and booting took longer than resuming from hibernation.

After migrating from Windows to Linux 3+ years ago, I was really surprised to realize after a while that hibernation isn’t necessary at all on Linux! Somehow, it’s super easy to boot up (in seconds, btw) and resume working.

Another factor: a few years ago, a lot of laptops had issues with sleep modes in Linux (and could overheat in a backpack during a commute). This could have contributed to the habit of Linux users simply powering off to make sure there’s no battery drain or overheating. My current laptop finally sleeps well @ Fedora 44 KDE, but I still prefer to power it off and on.

I do not see anyone around my extensive Linux circles (hundreds of users) using hibernation, and I haven’t heard a single complaint about it. That’s why I’m sure hibernation is not an issue in Linux.

@computersavvy @augenauf @andym

Thanks for chiming in :folded_hands: the reason I’m asking this is because in the few laptops that I’ve used Fedora on, including my current one, “sleep” still consumes a lot of battery. Withing a few hours, the battery will be drained (and I can also feel the laptop heating up a little bit). I know that may also be laptop dependent, but that’s my general experience with Fedora.

It feels very different from, for example, a mac, where you can close the lid and the laptop will consume so little battery that after days it will be in almost the same state. So I assumed that this difference was because Fedora went to sleep and MacOS hibernated, but perhaps I was wrong on that.

Hibernation is not hard to set up but is not in high demand for the great majority of users.

Simple steps.

  1. create a physical swap space that is at least as large as your total RAM. A different partition is best, though there are ways to do so with a swap file.
  2. configure that swap space for system use.
  3. You now need to do a few other steps that I am not totally familiar with since I do not use hibernation, but instructions are available with a little searching.
    One of those steps will involve adding a resume=<your swap UUID here> into the kernel command line for use when resuming from hibernation.
    Another will require that you ensure that the appropriate systemd service for hibernation is enabled. (I don’t know which ones are necessary, but they should all be available in the /usr/lib/systemd/system and/or the /etc/systemd/system directory for you to peruse.)

A complicating factor is that with secure boot you also get kernel lockdown, and according to man kernel_lockdown

Unencrypted hibernation/suspend to swap are disallowed as the kernel image is saved to a medium that can then be accessed.

This is not normal behavior, neither is it frequently reported. If you have the time and willingness, I would rather advise you to try troubleshooting (including asking here on Ask Fedora).