I applied hibernation for fedora 41, hibernate is not working

This works for me:

$ sudo touch /swapfile
$ sudo chattr +C /swapfile
$ sudo fallocate --length 400M /swapfile
$ sudo chmod 600 /swapfile
$ sudo mkswap -L SWAPFILE /swapfile
Setting up swapspace version 1, size = 400 MiB (419426304 bytes)
LABEL=SWAPFILE, UUID=ee5307b3-b6d7-4849-966d-2c58a588f49f
$ sudo bash -c 'echo /swapfile swap swap defaults 0 0 >>/etc/fstab'
$ sudo swapon -a
$ swapon -s
Filename	Type		Size		Used	Priority
/dev/zram0   partition	1992700		0		100
/swapfile    file		409596		0		-2
$ sudo systemctl hibernate

The logs from hibernation & resume:

2024-11-09T13:25:27.021613+02:00 systemd[1]: Reached target sleep.target.
2024-11-09T13:25:27.022640+02:00 systemd[1]: Starting systemd-hibernate.service...
2024-11-09T13:25:27.040960+02:00 systemd[1]: session-1.scope: Unit now frozen-by-parent.
2024-11-09T13:25:27.041110+02:00 systemd[1]: user@1000.service: Unit now frozen-by-parent.
2024-11-09T13:25:27.041121+02:00 systemd[1]: user-1000.slice: Unit now frozen-by-parent.
2024-11-09T13:25:27.041137+02:00 systemd[1]: user.slice: Unit now frozen.
2024-11-09T13:25:27.041270+02:00 systemd-sleep[1413]: Successfully froze unit 'user.slice'.
2024-11-09T13:25:27.056624+02:00 kernel: PM: Image not found (code -16)
2024-11-09T13:25:27.056773+02:00 systemd-sleep[1413]: Performing sleep operation 'hibernate'...
2024-11-09T13:25:27.057621+02:00 kernel: PM: hibernation: hibernation entry
2024-11-09T13:25:40.097463+02:00 kernel: Filesystems sync: 0.009 seconds
2024-11-09T13:25:40.097737+02:00 kernel: Freezing user space processes
2024-11-09T13:25:40.097837+02:00 kernel: Freezing user space processes completed (elapsed 0.001 seconds)
2024-11-09T13:25:40.097915+02:00 kernel: OOM killer disabled.
...
2024-11-09T13:25:40.098675+02:00 kernel: PM: hibernation: Basic memory bitmaps created
2024-11-09T13:25:40.098747+02:00 kernel: PM: hibernation: Preallocating image memory
2024-11-09T13:25:40.098824+02:00 kernel: PM: hibernation: Allocated 194863 pages for snapshot
2024-11-09T13:25:40.098885+02:00 kernel: PM: hibernation: Allocated 779452 kbytes in 0.08 seconds (9743.15 MB/s)
2024-11-09T13:25:40.098953+02:00 kernel: Freezing remaining freezable tasks
2024-11-09T13:25:40.099025+02:00 kernel: Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
2024-11-09T13:25:40.099091+02:00 kernel: printk: Suspending console(s) (use no_console_suspend to debug)
2024-11-09T13:25:40.099169+02:00 kernel: Disabling non-boot CPUs ...
2024-11-09T13:25:40.099236+02:00 kernel: smpboot: CPU 1 is now offline
2024-11-09T13:25:40.099308+02:00 kernel: PM: hibernation: Creating image:
2024-11-09T13:25:40.099375+02:00 kernel: PM: hibernation: Need to copy 184291 pages
2024-11-09T13:25:40.099439+02:00 kernel: PM: hibernation: Normal pages needed: 184291 + 1024, available pages: 334404
2024-11-09T13:25:40.099499+02:00 kernel: Enabling non-boot CPUs ...
2024-11-09T13:25:40.099565+02:00 kernel: smpboot: Booting Node 0 Processor 1 APIC 0x1
2024-11-09T13:25:40.099634+02:00 kernel: CPU1 is up
2024-11-09T13:25:40.099698+02:00 kernel: usb usb1: root hub lost power or was reset
2024-11-09T13:25:40.100804+02:00 kernel: usb usb2: root hub lost power or was reset
2024-11-09T13:25:40.101807+02:00 kernel: virtio_scsi virtio2: 2/0/0 default/read/poll queues
2024-11-09T13:25:40.102404+02:00 kernel: virtio_blk virtio4: 2/0/0 default/read/poll queues
2024-11-09T13:25:40.102927+02:00 kernel: usb 1-1: reset high-speed USB device number 2 using xhci_hcd
...
2024-11-09T13:25:40.104670+02:00 kernel: PM: hibernation: Basic memory bitmaps freed
2024-11-09T13:25:40.104843+02:00 kernel: OOM killer enabled.
2024-11-09T13:25:40.104958+02:00 kernel: Restarting tasks ... done.
2024-11-09T13:25:40.105068+02:00 kernel: PM: hibernation: hibernation exit
2024-11-09T13:25:40.098538+02:00 systemd-sleep[1413]: System returned from sleep operation 'hibernate'.
2024-11-09T13:25:40.107329+02:00 systemd[1]: user@1000.service: Unit now thawed.
2024-11-09T13:25:40.107390+02:00 systemd[1]: session-1.scope: Unit now thawed.
2024-11-09T13:25:40.107430+02:00 systemd[1]: user-1000.slice: Unit now thawed.
2024-11-09T13:25:40.107468+02:00 systemd[1]: user.slice: Unit now thawed.
2024-11-09T13:25:40.109647+02:00 systemd-sleep[1413]: Successfully thawed unit 'user.slice'.
2024-11-09T13:25:40.109985+02:00 systemd-resolved[794]: Clock change detected. Flushing caches.
2024-11-09T13:25:40.111102+02:00 systemd[1]: systemd-hibernate.service: Deactivated successfully.
2024-11-09T13:25:40.111591+02:00 systemd[1]: Finished systemd-hibernate.service.
2024-11-09T13:25:40.117309+02:00 systemd[1]: Reached target hibernate.target.
2024-11-09T13:25:40.117527+02:00 systemd[1]: Stopped target sleep.target.
2024-11-09T13:25:40.117935+02:00 systemd[1]: Stopped target hibernate.target.
2024-11-09T13:25:40.119884+02:00 systemd-logind[835]: Operation 'hibernate' finished.
...
2024-11-09T13:25:42.123455+02:00 polkitd[817]: g_error_free: assertion 'error != NULL' failed
2024-11-09T13:25:42.123505+02:00 polkitd[817]: g_error_free: assertion 'error != NULL' failed
2024-11-09T13:25:44.141043+02:00 ModemManager[900]: <msg> [base-manager] couldn't check support for device '/sys/devices/pci0000:00/0000:00:02.0/0000:>
2024-11-09T13:25:48.897814+02:00 kernel: tpm tpm0: NULL key integrity failure!
2024-11-09T13:25:48.901812+02:00 kernel: tpm tpm0: NULL Seed name comparison failed
2024-11-09T13:25:48.902221+02:00 kernel: tpm tpm0: NULL name has changed, disabling TPM due to interference

I don’t have SB on this machine. The TPM error looks strange. Maybe it’s some issue with how the TPM storage is set up.

1 Like