Nixos stage 1 error: /dev/disk/by-uuid/3b21faf2-812a-4aec-b37e-df09560de558 is unavailable

Hi!
This is my hardware config:

# Do not modify this file!  It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations.  Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:

{
  imports =
    [ (modulesPath + "/installer/scan/not-detected.nix")
    ];

  boot.initrd.availableKernelModules = [ "vmd" "xhci_pci" "nvme" ];
  boot.initrd.kernelModules = [ ];
  boot.kernelModules = [ "kvm-intel" ];
  boot.extraModulePackages = [ ];

  fileSystems."/" =
    { device = "/dev/mapper/luks-3b21faf2-812a-4aec-b37e-df09560de558";
      fsType = "btrfs";
      options = [ "subvol=@" ];
    };

  boot.initrd.luks.devices."luks-3b21faf2-812a-4aec-b37e-df09560de558".device = "/dev/disk/by-uuid/3b21faf2-812a-4aec-b37e-df09560de558";

  fileSystems."/boot" =
    { device = "/dev/disk/by-uuid/93B3-C820";
      fsType = "vfat";
      options = [ "fmask=0077" "dmask=0077" ];
    };

  swapDevices =
    [ { device = "/dev/disk/by-uuid/c36d6a26-6291-4721-820f-d486e272f39d"; }
    ];

  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
  hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

I put just for reference, because I didn’t change anything. I suspect that something may be wrong with either new kernel or systemd-udevd.service. However, this is my problem: when I restart my computer I get the following error:


/dev/disks/by-uuid/something_558 is unavailable… This is quite problematic because it is the main disk (NIX-ROOT).
What may be important is that I use disk encryption and it is formatted using btrfs.

Can you help me out? For now I have to use my older generation…
Best,
Miro

Please help me with my problem…

maybe you can try popping on the matrix or discord chat servers - there are some really helpful people there as well


i would have expected that you were dropped into a recovery shell and could inspect the system… i think you might need to do that to figure out what is going on here… :thinking:

Well I didn’t I even tried to but I couldn’t type anything.
Once after about 10 minutes this device showed up and I could decrypt it.

Something very odd is going on, either with udev or with the kernel. You might want to bump up the log level. In the boot menu, press e to edit the cmdline, and change it have loglevel=7 and udev.log_level=debug

1 Like

Thank you!

What is strange I can now normally boot but it takes a lot of time. After setting logs to higher level I got these:

I won’t even try to pretend that I understand any of them but what concerns me are these logs: Failed to remove source n/a (type io) from epoll, ignoring: Bad file descriptor (last line) and line 1759: Waiting 10 seconds for device /dev/disk/by-uuid/3b21faf2-812a-4aec-b37e-df09560de558 to appear....nvme0n1p3: /nix/store/qya2n1wigipsmki603fspjpdmszcx5h6-udev-rules/60-persistent-storage.rules:138 Added SYMLINK 'disk/by-uuid/3b21faf2-812a-4aec-b37e-df09560de558'. This is the line after which there used to be a “failure” and it refused to go on. Can you help me out further what these logs mean?

Somethings up with either the nvme kernel module or this 10000:e1:00.0 device. You see:

[Wed Oct 22 06:09:53 UTC 2025] 10000:e1:00.0: Running built-in command "kmod load"
[Wed Oct 22 06:09:53 UTC 2025] Loading module: pci:v00001E0Fd0000001Bsv00001E0Fsd0000001Bbc01sc08i02

Running this, we can see what kernel module that’s an alias for:

$ modinfo -F name pci:v00001E0Fd0000001Bsv00001E0Fsd0000001Bbc01sc08i02
nvme

And then a minute later:

[Wed Oct 22 06:10:52 UTC 2025] 10000:e1:00.0: Worker [231] processing SEQNUM=1978 is taking a long time

And then finally another minute later:

[Wed Oct 22 06:11:52 UTC 2025] Timed out while waiting for udev queue to empty.
[Wed Oct 22 06:11:56 UTC 2025] nvme0n1: Device is queued (SEQNUM=2039, ACTION=add)
[Wed Oct 22 06:11:56 UTC 2025] Inserted module 'nvme'
[Wed Oct 22 06:11:56 UTC 2025] 10000:e1:00.0: Device processed (SEQNUM=1978, ACTION=add)

So for some reason, the nvme module is taking barely over two minutes to load. That’s really weird.

1 Like
user-1@bonifacy ~> modinfo -F name pci:v00001E0Fd0000001Bsv00001E0Fsd0000001Bbc01sc08i02
nvme
user-1@bonifacy ~> 

Also, is this behaviour expected?:

user-1@bonifacy ~> nvme
The program 'nvme' is currently not installed. You can install it
by typing:
  nix-env -iA nixpkgs.nvme-cli.out

Or run it once with:
  nix-shell -p nvme-cli.out --run 'nvme ...'
user-1@bonifacy ~ [127]> 

Is there some way to force recompiling kernel? Is this a good solution?

nvme is just the name of a kernel module, not a command you run. There is a command named nvme in that nvme-cli package, but that’s a whole other thing. The nvme module is just the name of the kernel code for the nvme driver. These modules are loaded into the kernel at runtime when udev detects that a device needs its kernel driver loaded.

I don’t see a reason for you to recompile the kernel. I’m not sure why it’s taking so long to load that module.

i didn’t look at stage 1 to confirm this but couldn’t we just explicitly add "nvme" to the list of kernel modules that get loaded in the initramfs before udev starts? maybe i am totally misunderstanding this though… :sweat_smile:

I don’t really think that would fix anything. I mean it’s worth a shot to add boot.initrd.kernelModules = [ "nvme" ];, but I think it will still take two minutes to load (and anyway, whenever we migrate to systemd initrd by default, those modules will no longer be definitely loaded before udev starts). I think the problem is something wrong in kernel space trying to get this device figured out, for whatever reason.

1 Like

Might be worth trying to switch kernel versions, I’ve had it improve some of my hardware functionality (and make it worse at times :p)

I don’t really think that would fix anything. I mean it’s worth a shot to add boot.initrd.kernelModules = [ "nvme" ];

Sadly it didn’t work.

Might be worth trying to switch kernel versions, I’ve had it improve some of my hardware functionality (and make it worse at times :p)

I wanted to do that for some time, but wiki is quite unhelpfull. I want to install latest LTS kernel, which “Package” to choose from:

nix-repl> :l <nixpkgs>
Added 12607 variables.

nix-repl> pkgs.linuxPackages
pkgs.linuxPackages                           pkgs.linuxPackages_custom_tinyconfig_kernel
pkgs.linuxPackages-libre                     pkgs.linuxPackages_ham
pkgs.linuxPackages-rt                        pkgs.linuxPackages_hardened
pkgs.linuxPackages-rt_latest                 pkgs.linuxPackages_latest
pkgs.linuxPackagesFor                        pkgs.linuxPackages_latest-libre
pkgs.linuxPackages_4_19                      pkgs.linuxPackages_latest_hardened
pkgs.linuxPackages_5_10                      pkgs.linuxPackages_latest_xen_dom0
pkgs.linuxPackages_5_10_hardened             pkgs.linuxPackages_latest_xen_dom0_hardened
pkgs.linuxPackages_5_15                      pkgs.linuxPackages_lqx
pkgs.linuxPackages_5_15_hardened             pkgs.linuxPackages_rpi0
pkgs.linuxPackages_5_4                       pkgs.linuxPackages_rpi02w
pkgs.linuxPackages_5_4_hardened              pkgs.linuxPackages_rpi1
pkgs.linuxPackages_6_1                       pkgs.linuxPackages_rpi2
pkgs.linuxPackages_6_10                      pkgs.linuxPackages_rpi3
pkgs.linuxPackages_6_11                      pkgs.linuxPackages_rpi4
pkgs.linuxPackages_6_12                      pkgs.linuxPackages_rt_5_10
pkgs.linuxPackages_6_12_hardened             pkgs.linuxPackages_rt_5_15
pkgs.linuxPackages_6_13                      pkgs.linuxPackages_rt_5_4
pkgs.linuxPackages_6_13_hardened             pkgs.linuxPackages_rt_6_1
pkgs.linuxPackages_6_14                      pkgs.linuxPackages_testing
pkgs.linuxPackages_6_14_hardened             pkgs.linuxPackages_testing_bcachefs
pkgs.linuxPackages_6_15                      pkgs.linuxPackages_xanmod
pkgs.linuxPackages_6_16                      pkgs.linuxPackages_xanmod_latest
pkgs.linuxPackages_6_1_hardened              pkgs.linuxPackages_xanmod_stable
pkgs.linuxPackages_6_6                       pkgs.linuxPackages_xen_dom0
pkgs.linuxPackages_6_6_hardened              pkgs.linuxPackages_xen_dom0_hardened
pkgs.linuxPackages_6_9                       pkgs.linuxPackages_zen
pkgs.linuxPackages_custom

I said “Package” because I cannot find them in search.nixos.org…:
NixOS Search

The default in NixOS is the latest LTS kernel, but the equivalent of that default is just boot.kernelPackages = pkgs.linuxPackages;. The latest released kernel is boot.kernelPackages = pkgs.linuxPackages_latest;.

There must be some mistake here.
Latest LTS kernel version, according to site The Linux Kernel Archives - Releases, is 6.12. I did put boot.kernelPackages = pkgs-stable.linuxPackages_latest; in my config (pkgs-stable point to nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-25.05";), but…:

user-1@bonifacy ~> uname -r
6.17.3
user-1@bonifacy ~> 

Right, because 6.17 is the latest released kernel. The latest LTS kernel is not the latest released kernel. The latest LTS kernel is what you get by default, which is equivalent to boot.kernelPackages = pkgs.linuxPackages;. If you want a kernel that’s too new to be LTS, that’s when you do boot.kernelPackages = pkgs.linuxPackages_latest;

Oh, sorry… I didn’t understand your post at first. English is not my first language:)

Okay, setting kernel to an LTS release instead latest stable seems to be fixing this issue. Thank you for your help!

However if you have any ideas why this happened I would be very interesting in trying them out to find out!

1 Like

I just got back from my journey and found out that the problem was with my second laptop (took very long to start) but it hasn’t got an nvme drive. I’ll try to post its logs tomorrow.

Hi!

This is my hardware config of my other computer:

# Do not modify this file!  It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations.  Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:

{
  imports =
    [ (modulesPath + "/installer/scan/not-detected.nix")
    ];

  boot.initrd.availableKernelModules = [ "vmd" "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ];
  boot.initrd.kernelModules = [ "nvme" ];
  boot.kernelModules = [ "kvm-intel" ];
  boot.extraModulePackages = [ ];

  fileSystems."/" =
    { device = "/dev/disk/by-uuid/d40711b1-377f-40ad-b204-6444523e7070";
      fsType = "btrfs";
      options = [ "subvol=@" ];
    };

  fileSystems."/boot" =
    { device = "/dev/disk/by-uuid/F6C2-B42B";
      fsType = "vfat";
      options = [ "fmask=0077" "dmask=0077" ];
    };

  swapDevices =
    [ { device = "/dev/disk/by-uuid/68eab074-19f1-4d7b-829c-249cbf42d4e4"; }
    ];

  # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
  # (the default) this is the recommended approach. When using systemd-networkd it's
  # still possible to use this option, but it's recommended to use it in conjunction
  # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
  networking.useDHCP = lib.mkDefault true;
  # networking.interfaces.enp0s20f0u2.useDHCP = lib.mkDefault true;
  # networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true;

  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
  hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
  hardware.graphics.enable = true;
}

Otherwise it is practically the same as “bonifacy”. This link will take you to a folder with two files: log_bonifacy and log_kaktus. Bonifacy is one with nvme disk, kaktus has msata.