Setup hibernation on Silverblue / Kionite?

There is a tutorial for 36 Workstation. I for now replaced every “/swap” with “/var/swap”, but not sure if that would just work.

Like creating the swap partition in the /var directory and using it the same way.

Do you need to change partitions during setup or something? Is everything included in the setup tutorial?

1 Like

Yes, you can follow that tutorial and get hibernation to work on Fedora Silverblue.

I have some comments on that guide, however:

  1. dracut is not needed for Silverblue.
  2. You can get the resume offset with sudo btrfs inspect-internal map-swapfile -r /var/swap/swapfile if your btrfs tools are v >= 6.1, which they are on Silverblue 37. There’s no need to download and compile an external program.
  3. The hibernate-preparation.service and hibernate-resume.service configuration is unnecessary and just slows down the hibernation process. Rather, you should just add your swapfile to /etc/fstab.

To elaborate on item 3 above, there’s no harm in automatically mounting your swapfile via /etc/fstab. By default it will get a much lower priority than your zram swap, so it will most likely only ever be used when hibernating. The system will automatically know to use the swapfile for hibernating, because the zram swap is not large enough, as it is configured to be 50% the size of your total RAM.

1 Like

Hi Eddie, I have done the tutorial along with your comments. Now when I want to run systemctl hibernate for the first time the following error message appears. The swapfile is mounted and the resume parameters are added. Any idea?

Error:
Failed to hibernate system via logind: Not enough swap space for hibernation

Edit:
My failure i forgot this chapter:

$ mkdir -p /etc/systemd/system/systemd-logind.service.d/ $ cat <<-EOF | sudo tee /etc/systemd/system/systemd-logind.service.d/override.conf [Service] Environment=SYSTEMD_BYPASS_HIBERNATION_MEMORY_CHECK=1 EOF $ mkdir -p /etc/systemd/system/systemd-hibernate.service.d/ $ cat <<-EOF | sudo tee /etc/systemd/system/systemd-hibernate.service.d/override.conf [Service] Environment=SYSTEMD_BYPASS_HIBERNATION_MEMORY_CHECK=1 EOF

Does your system use the swap in addition to the ram? Or just for hibernating?

Just for hibernating.

NAME TYPE SIZE USED PRIO
/dev/zram0 partition 8G 0B 100
/var/swap/swapfile file 40G 0B -2

The exact same thing happened to me :slight_smile:

I’m not sure why it should even be needed though, as my swapfile should be large enough to fit everything. It’s possibly related to this: Failed to hibernate system via logind: Not enough swap space for hibernation · Issue #15354 · systemd/systemd · GitHub