Fedora 41. How to enable/configure hibernation

I do realize how beat up this topic may be, but I haven’t configured such things in a while.

I have a Fedora 41 on an EXT4 (all the guides use btrfs) with KDE on board (don’t know if this is somehow relevant, but just in case it does). And I’m trying to configure Hibernation.

Could someone please point me to a working guide? I’ve even found things like this topic How to set up hibernation on Fedora (KDE) 38?, with a statement that swap isn’t needed.

Thanks in advance.

Sadly, I can’t help with that at this moment. I tried this in the past as well and have a similar setup to yours, but I am also interested in setting up hibernation.

EDIT: Just realized you linked my topic, lol. It’s ancient. :sweat_smile:

1 Like

I remember how it was done in the past with mkswap and add it to the fstab, but its been ages since I done that. Also the “it can work without swap” got me interested.

But, as I can understand, you didn’t get an answer?

Not really. Haven’t thought about it much aince then either.

Try this update guide Update on hibernation in Fedora Workstation - Fedora Magazine

Yes, I did find that guide. But it is aimed at btrfs. Not really sure if it applies to ext4.

Do you have a swap file on disk that is at least as big as your RAM?
That is what the btrfs steps are doing.

I do not use hibernate, so do not have direct experience of the setup.

This is the thing. For the first time, I forgot to create a swapfile, assuming that my 64GB of ram would be more than enough.

Guess I’ll try the swapfile creation, but I wanted to know if there is something specific in Fedora (last time I’ve done it, it was Ubuntu…16 or 18).

Hi Draakz,

The file system, brtfs vs ext4, is not relavent in this scenario with the exception of the creation of a swap file. The basic steps to setup swap so that you have the capability to enable hibernation is:

  1. on ext4,
    mkswap -size {1.5 x installed RAM} /var/SWAPFILE # put this swap file on your fastest device, mine just happens to be in /var
  2. create an entry /etc/fstab that looks like this
    /var/SWAPFILE none swap defaults 0 0 # I have a very large and fast /var fs on my system so …
  3. swapon -a OR reboot

Then you setup hibernation via your power management …

NOTE: Why 1.5 x Installed RAM?
Because you need enough space in swap to hold the amount of RAM you are copying to disk when hibernating the system

1 Like

Thank you. The 1.5x is something that actually “bites on the soft spot”, since I went with 64GB of ram, and a 256GB m2, slicing the drive specifically to be 100 for the system and an encrypted -+ 120 for the work data.

Realized that “Sleep” isn’t as bad (it is a stationary pc). I do wish that I could figure out how to turn off the damn rgb on the ram…

I’m unsure because of the ZRAM. How do I make sure tha the system doesn’t use the swapfile for swap, but just the ZRAM, and hibernates properly to the swapfile while retainimg all RAM and ZRAM contents?

The swapon command lists each swap file with its priority.
Linux uses the highest priority swapfile until it is full.
Then it uses the next one.

By default you will see zram is the highest priority so it is used first.
You cannot stop linux using the other swap file, as far as I know.
But unless you run a workload that uses a lot more RAM then you have this is not likely to be an issue.

1 Like

Hi Draakz,

Yes, sleep is generally a better option than hibernate in my opinion. Personally, I don’t even do sleep in favor of just powering off when I am done for the day. My machine boots in about 20 seconds from the point of the BIOS screen to ability to login …
As for the rgb on the RAM … might I suggest a black permanent marker or black spray paint? … Just kidding …

Hi.

While you were kidding, yesterday evening I literally was applying layers of thick electric tape all over the rgb strip.

I’m even starting to get the impressions that the stars we see in the sky are actually distant rgb kits for pheripherals, which have such a high luminosity, that it can literally be seen across the galaxy. I have a somewhere to 50 sq.m. apartment with one huge room, an without the layers of tape I could literally see the rgb at the far wall… during daytime!

Although this is camera software trying to do a night shot, the top and bottom lighs are that 1mm gap at the base of the ram stick, which allow some air in. I have never raised a question of ram overheating, but I think I will soon find out.

I don’t know how I overlooked what Sleep actually is. I thought of it as a state, where the system remains online, but just turns off the screen and maybe some power consumption.

But still one strange thing I noticed. I can manually set it to Sleep. Even configured the Power button to do this. But the “Power Manager > Go to sleep after N minutes” in KDE’s configuration options seems to only turn off the monitor (waiter for 30 minutes if I’m not mistaking).

Am I missing something here?

Hi Draakz,

… thick black electrical tape will work … LOL!!! … as bright as those LEDs seem to be, are you certain that they did not ship death-ray lasers from Mars? … LOL!!!

As for the “Sleep” … depends on the processor you are working with. Different levels of sleep will do things like reduce the CPU frequency, shut off the USB power to devices, reduce power to the SDD/HDD … just depends on what the mfg of the equipment provided in the design.

1 Like

One would joke. But I basically saw the rgb shining on the wall, which is somewhere up to 7 meters away from those ram sticks.

I’ve went with 9900x and a MSI x870 Tomahawk. I have this hooked up to a fancy UPS, and “Sleep” does wonders - goes from 100sh watts to maybe 20 (I have other things hooked up, so can’t give a precise answer without investing time into unplugging everything).

I would really like to be able to use hibernation from time to time, because just saving the results of various actions on the computer can be quite time-consuming, and unfortunately, putting it to sleep does not work very reliably and repeatably. Apart from the obvious advantages of hibernation, there is unfortunately one disadvantage in my case, because I have 512 GB of RAM… you understand… :wink:

Hibernation, as I have read in many threads here on the forum, also does not work very reliably - all that remains is the laborious saving of changes and the usual “poweroff”. :winking_face_with_tongue:

1 Like