I’m following the steps outlined in this issue (with adjustments for the suggested fix) almost exactly using the latest ISO installer. nixos-install succeeds and when I reboot I see this:
<<< NixOS Stage 1 >>>
loading module dm-snapshot...
loading module dm_mod....
running udev...
Starting systemd-udevd version 255.6
Waiting 10 seconds for device /dev/disks/by-uuid/<UUID> to appear....... - failure
/dev/disks/by-uuid/<UUID> is unavailable
An error occurred in sage 1 of the boot process, which mount the
root filesystem on '/mnt-root' and then start stage 2. Press one
of the following keys:
[...]
Basically there is no opportunity for me to enter the password during boot.
You’re following a 4 year old guide there, things have probably changed a fair bit.
What you’re seeing is that your bootloader is trying to wait for a drive that doesn’t exist. This would happen if you did not configure it to try and unlock your luks first. What’s in your configuration.nix?
This cannot be correct, because the LUKS partition has to be unlocked before the partition with the UUID of the root partition can even exist. They must be different in a correct configuration.
Reboot into the install medium, and then check for the UUID of the LUKS partition (without mounting anything) with blkid. When you have the correct UUID, just update the luks.devices."nixos" device.
Since you use a UUID, I don’t think preLVM is relevant at all.
Nice catch. I updated the configuration.nix to have the UUID of the LUKS partition. After the update, same issue appears but this time loader waits for the right UUID and fails the same way.
I entered the interactive shell and verified that the /dev/disks/by-uuid/<UUID> actually exits.
PS. I removed both the workarounds listed in my last comment to keep things clean.
I actually tried that and was able to decrypt the disk. After that, I tried to mount it to /mnt but that fails complaining: /mnt no such file or directory.
Hi,
I have a quite similar configuration of a luks encryped device with lvm containing a root and swap device. So the configuration.nix and hardware-configuration seems in order.
I think you should be able to mount the root device when booting with a capable distribution on usb or dvd.
I found the issue: the path to the disk in the configuration.nix has “disks” instead of “disk”. When I was trying out the path, tab completion made me overlook this issue and I was busy verifying just the UUID part of the sting :facepalm:
Thanks for your help with the LUKS partition UUID issue.