Hibernation: Unable to resume from device; PM: Image not found (code -16); driver iwlwifi failed with error

Swapfile on BTRFS filesystem on encrypted LUKS device; systemd initrd; impermanence module is used

resume and resume_offset were found with findmnt -no UUID -T /swap/swapfile and btrfs inspect-internal map-swapfile -r /swap/swapfile

boot.initrd.systemd.enable = true;
boot.kernelParams = [ "resume_offset=64353002" ];
boot.resumeDevice = "/dev/disk/by-uuid/fd339e00-2576-4b25-adae-1c03b6d09387";
boot.initrd.availableKernelModules = [ "vmd" "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.enableRedistributableFirmware =  true;

On boot from hibernation, the system doesn’t resume and iwlwifi fails.

log

Dec 26 09:44:39 laptop kernel: Linux version 6.12.63 (nixbld@localhost) (gcc (GCC) 14.3.0, GNU ld (GNU Binutils) 2.44) #1-NixOS SMP PREEMPT_DYNAMIC Thu Dec 18 12:55:23 UTC 2025
Dec 26 09:44:39 laptop kernel: Command line: init=/nix/store/b2cqpqgwvwvjlklvq6rfpl43kgmz2x2x-nixos-system-laptop-26.05.20251225.3e2499d/init resume_offset=64353002 root=fstab resume=/dev/disk/by-uuid/fd339e00-2576-4b25-adae-1c03b6d09387 loglevel=4 lsm=landlock,yama,bpf
<...>
Dec 26 09:44:39 laptop kernel: PM: hibernation: Registered nosave memory: [mem 0x00000000-0x00000fff]
Dec 26 09:44:39 laptop kernel: PM: hibernation: Registered nosave memory: [mem 0x0009f000-0x000fffff]
Dec 26 09:44:39 laptop kernel: PM: hibernation: Registered nosave memory: [mem 0x66988000-0x669b6fff]
Dec 26 09:44:39 laptop kernel: PM: hibernation: Registered nosave memory: [mem 0x6a419000-0x6a419fff]
Dec 26 09:44:39 laptop kernel: PM: hibernation: Registered nosave memory: [mem 0x6ca7c000-0x727fefff]
Dec 26 09:44:39 laptop kernel: PM: hibernation: Registered nosave memory: [mem 0x72800000-0xffffffff]
<...>
Dec 26 09:44:39 laptop systemd-hibernate-resume-generator[91]: Reported hibernation image: ID=nixos VERSION_ID=26.05 kernel=6.12.63 UUID=fd339e00-2576-4b25-adae-1c03b6d09387 offset=64353002
<...>
Dec 26 09:44:42 laptop systemd[1]: Found device /dev/disk/by-uuid/fd339e00-2576-4b25-adae-1c03b6d09387.
Dec 26 09:44:42 laptop systemd[1]: Found device /dev/mapper/main.
Dec 26 09:44:42 laptop systemd[1]: Reached target Initrd Root Device.
Dec 26 09:44:42 laptop systemd[1]: Starting create-needed-for-boot-dirs.service...
Dec 26 09:44:42 laptop systemd[1]: Starting Resume from hibernation...
Dec 26 09:44:42 laptop systemd-hibernate-resume[219]: Reported hibernation image: ID=nixos VERSION_ID=26.05 kernel=6.12.63 UUID=fd339e00-2576-4b25-adae-1c03b6d09387 offset=64353002
Dec 26 09:44:42 laptop systemd-hibernate-resume[219]: Unable to resume from device '/dev/disk/by-uuid/fd339e00-2576-4b25-adae-1c03b6d09387' (254:0) offset 64353002, continuing boot process.
Dec 26 09:44:42 laptop kernel: BTRFS: device label main devid 1 transid 1664 /dev/mapper/main (254:0) scanned by mount (221)
Dec 26 09:44:42 laptop kernel: BTRFS info (device dm-0): first mount of filesystem fd339e00-2576-4b25-adae-1c03b6d09387
Dec 26 09:44:42 laptop kernel: BTRFS info (device dm-0): using crc32c (crc32c-intel) checksum algorithm
Dec 26 09:44:42 laptop kernel: PM: Image not found (code -16)
Dec 26 09:44:42 laptop systemd[1]: systemd-hibernate-resume.service: Deactivated successfully.
Dec 26 09:44:42 laptop systemd[1]: Finished Resume from hibernation.
<...>
Dec 26 09:44:44 laptop kernel: Intel(R) Wireless WiFi driver for Linux
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3: enabling device (0000 -> 0002)
Dec 26 09:44:44 laptop systemd[1]: Starting Virtual Console Setup...
Dec 26 09:44:44 laptop kernel: intel_rapl_msr: PL4 support detected.
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3: CSR_RESET = 0x10
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3: Host monitor block 0x0 vector 0x0
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 0]: 0x3f1d0430
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 1]: 0x3f1d0030
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 2]: 0x3f1d0430
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 3]: 0x3f1d0030
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 4]: 0x3f1d0430
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 5]: 0x3f1d0030
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 6]: 0x3f1d0430
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 7]: 0x3f1d0030
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 8]: 0x3f1d0030
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 9]: 0x3f1d0030
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 10]: 0x3f1d0030
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 11]: 0x3f1d0030
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 12]: 0x3f1d0430
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 13]: 0x3f1d0030
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 14]: 0x3f1d0430
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3: Host monitor block 0x0 vector 0x1
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 0]: 0x040066c2
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 1]: 0x040066c2
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 2]: 0x040066c2
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 3]: 0x040066c2
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 4]: 0x040066c2
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 5]: 0x040066c2
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 6]: 0x040066c2
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 7]: 0x040066c2
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 8]: 0x040066c2
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 9]: 0x040066c2
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 10]: 0x040066c2
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 11]: 0x040066c2
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 12]: 0x040066c2
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 13]: 0x040066c2
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 14]: 0x040066c2
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3: Host monitor block 0x0 vector 0x6
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 0]: 0xf00c7c75
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 1]: 0xb00c7c75
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 2]: 0xb00c7c75
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 3]: 0xa00c7c75
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 4]: 0xa00c7c75
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 5]: 0xe00c7c75
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 6]: 0xa00c7c75
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 7]: 0xe00c7c75
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 8]: 0xb00c7c75
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 9]: 0xf00c7c75
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 10]: 0xb00c7c75
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 11]: 0xb00c7c75
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 12]: 0xb00c7c75
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 13]: 0xf00c7c75
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 14]: 0xa00c7c75
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3: Host monitor block 0x22 vector 0x0
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3:     value [iter 0]: 0xc9ccc019
Dec 26 09:44:44 laptop kernel: intel_rapl_common: Found RAPL domain package
Dec 26 09:44:44 laptop kernel: intel_rapl_common: Found RAPL domain core
Dec 26 09:44:44 laptop kernel: intel_rapl_common: Found RAPL domain uncore
Dec 26 09:44:44 laptop kernel: intel_rapl_common: Found RAPL domain psys
Dec 26 09:44:44 laptop kernel: iwlwifi 0000:00:14.3: probe with driver iwlwifi failed with error -110


I’ve donwgraded kernel to pkgs.linuxKernel.packages.linux_6_6 and failure with iwlwifi disappeared. But hibernation still doesn’t work

The same setup worked on ArchLinux, so the issue must be with NixOS

FYI, on EFI systems, having boot.initrd.systemd.enable enabled means you don’t need the other two lines here; it figures that information out automatically at runtime.

Anyway, just to sanity check, could you show how you created the swap file?

btrfs filesystem mkswapfile -s 24G /swap/swapfile. Thats 2 times RAM I have, so size is not an issue

And /swap is subvolume mounted with compress=no,nodatacow,noatime,subvol=/swap options

oh, this should absolutely not be happening until after

Because create-needed-for-boot-dirs.service ends up mounting the file system temporarily, which you are not allowed to do before resuming. So this is technically a bug in impermanence (though I’m not sure it’s what’s causing your issue). You can fix it with boot.initrd.systemd.services.create-needed-for-boot-dirs.after = [ "local-fs-pre.target" ];. (FWIW, I think impermanence should not work this way, and should just use the mounts normally instead of temporarily replicating them in its own service; and that’s exactly what preservation does)

1 Like

Thanks! Now hibernation works

I changed kernel back to default and driver iwlwifi failure did not reappear. It guess it was caused by interrupted resume.