Nixos Full disk encryption error

Hi, I recently started getting this dmesg:

[   10.632715] stage-1-init: [Mon Nov  6 20:44:35 UTC 2023] starting device mapper and LVM...
[   10.684199] stage-1-init: [Mon Nov  6 20:44:35 UTC 2023] ERROR: device scan failed on '/dev/mapper/enc': No such file or directory
[   10.685210] stage-1-init: [Mon Nov  6 20:44:35 UTC 2023] ERROR: there were 1 errors while registering devices
[   10.686282] stage-1-init: [Mon Nov  6 20:44:35 UTC 2023] Scanning for Btrfs filesystems
[   10.687285] stage-1-init: [Mon Nov  6 20:44:35 UTC 2023] registered: /dev/mapper/enc

This is my config:

  boot.initrd.luks.devices = {
      enc = {
          device = "/dev/disk/by-uuid/7300f617-789d-41e6-bc8e-56fe11354a66";
          preLVM = true;
          allowDiscards = true;
      };
  };

  fileSystems."/" =
    { device = "/dev/disk/by-uuid/01cbfa3a-5c2a-4470-99b9-e9868abfc98b";
      fsType = "btrfs";
      options = [ "subvol=root" "compress=zstd" ];
    };

  fileSystems."/home" =
    { device = "/dev/disk/by-uuid/01cbfa3a-5c2a-4470-99b9-e9868abfc98b";
      fsType = "btrfs";
      options = [ "subvol=home" "compress=zstd" ];
    };

  fileSystems."/nix" =
    { device = "/dev/disk/by-uuid/01cbfa3a-5c2a-4470-99b9-e9868abfc98b";
      fsType = "btrfs";
      options = [ "subvol=nix" "compress=zstd" "noatime" ];
    };

  fileSystems."/swap" =
    { device = "/dev/disk/by-uuid/01cbfa3a-5c2a-4470-99b9-e9868abfc98b";
      fsType = "btrfs";
      options = [ "subvol=swap" "noatime" ];
    };

  fileSystems."/boot" =
    { device = "/dev/disk/by-uuid/06D7-806F";
      fsType = "vfat";
    };

  swapDevices = [ { device = "/swap/swapfile"; } ];

Is this going to be an issue?

Edit: Just to make it clear, I am able to log in and use my laptop normally. lsblk shows everything is alright as well.

NAME        MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
nvme0n1     259:0    0 931.5G  0 disk
├─nvme0n1p1 259:1    0     1G  0 part  /boot
└─nvme0n1p2 259:2    0 930.5G  0 part
  └─enc     254:0    0 930.5G  0 crypt /swap
                                       /home
                                       /nix/store
                                       /nix
                                       /

I’m fairly sure this is the same bug as kernel-shared/uapi/btrfs.h: fix BTRFS_IOC_SCAN_DEV by trofi · Pull Request #706 · kdave/btrfs-progs · GitHub

This bug caused the update to btrfs-progs 6.6 to be reverted in nixpkgs, so that will be in nixos-unstable soon. And a 6.6.1 bugfix release has been made, which will subsequently make it into nixos-unstable soon after that.

1 Like

Oh yes it is. I updated today and panicked after suddenly seeing this. Thanks for the info. I’ll update again in a couple days to fix it.