Closed hmajid2301 closed 1 year ago
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/stuck-waiting-10-seconds-for-luks-device/33423/1
Most of the cases where I saw this error was when a device driver to load the disk was missing. Have you run nixos-generate-config to get a hardware configuration as described here? https://github.com/nix-community/nixos-anywhere/blob/main/docs/quickstart.md eg.:
nixos-generate-config --no-filesystems --root /mnt
Ok. Just found that your device drivers are here: https://gitlab.com/hmajid2301/dotfiles/-/blob/80483732a327990126cf289a30690e8607bce36e/hosts/framework/hardware-configuration.nix#L13
You can use the "edit" feature in systemd-boot to add a new kernel parameter.
Do this and add boot.debug1devices
. This will drop you in a shell in initrd where you run commands like lsblk
. You should be able to see your root storage device i.e. /dev/nvme0n1.
I just saw that you have used /dev/vda
which sounds like you are not installing this on actual hardware but in a virtual machine? If that is the case than you might miss some virtio drivers to load the block device.
Thanks for replying,
Yes I was testing this temporarily on a VM, and you are correct with it having some issues. I set it up on my laptop and got the following error now:
loading module 1915...
loading module dm-snapshot... loading modu
loading modul
dgpu.
fs...
loading module am_mod...
running udev...
Starting systemd-udevd version 253.6
Passphrase for /dev/disk/by-partlabel/luks:
Verifying passphrase for /dev/disk/by-partlabel/luks...
starting device mapper and LVM...
0
success
Press one An error occurred in stage 1 of the boot process, which must mount the root filesystem on /mnt-root' and then start stage 2.
of the following keys:
i) to launch an interactive shell
f) to start an interactive shell having pid 1 (needed if you want to
start stage 2's init manually)
r) to reboot immediately
*) to ignore the error and continue
f" #
#
# lsblk
/nix/store/cdi1599hhgjr0b2qy5zy2azki8wal9rj-extra-utils/bin/ash: lsblk: not found
# fdisk -1
Disk /dev/nvme0n1: 1863 GB, 2000398934016 bytes, 3907029168 sectors 242251 cylinders, 256 heads, 63 sectors/track Units: sectors of 1 * 512 = 512 bytes
Device
/dev/nvme0n1p1
Boot StartCHS 0,0,2
EndCHS 1023,255,63
StartLBA
EndLBA
Sectors Size Id Type
1 3907029167 3907029167 18636 ee EFI GPT
Disk /dev/dm-0: 1831 GB, 1965484408832 bytes, 3838836736 sectors 238956 cylinders, 255 heads, 63 sectors/track
Units: sectors of 1 * 512 = 512 bytes
Disk /dev/dm-0 doesn't contain a valid partition table 2 #
this was an issue in my install script by removing the bit that creates a volume
echo "Creating blank volume"
sudo btrfs subvolume create /mnt/root # removing this line fixed this issue
sudo btrfs subvolume snapshot -r /mnt/ /mnt/root-blank
Hi :wave: ,
I know this is not a direct issue with disko per say, but more my usage of it. I am struggling to get to decrypt a LUKs device when using disko and would love some help to see what I am doing wrong.
I am getting the following error:
waiting 10 seconds for device /dev/disk/by-partlabel/luks to appear ......... - failure /dev/disk/by-partlabel/luks is unavailable
Disko Config for device
https://gitlab.com/hmajid2301/dotfiles/-/blob/80483732a327990126cf289a30690e8607bce36e/hosts/framework/disks.nix ```nix disko.devices = { disk = { nvme0n1 = { type = "disk"; device = "/dev/vda"; # device = "/dev/nvme0n1"; content = { type = "gpt"; partitions = { ESP = { label = "boot"; name = "ESP"; size = "512M"; type = "EF00"; content = { type = "filesystem"; format = "vfat"; mountpoint = "/boot"; mountOptions = [ "defaults" ]; }; }; swap = { label = "swap"; size = "32G"; content = { type = "swap"; resumeDevice = true; randomEncryption = true; }; }; luks = { size = "100%"; label = "luks"; content = { type = "luks"; name = "cryptroot"; extraOpenArgs = [ "--allow-discards" "--perf-no_read_workqueue" "--perf-no_write_workqueue" ]; # https://0pointer.net/blog/unlocking-luks2-volumes-with-tpm2-fido2-pkcs11-security-hardware-on-systemd-248.html #settings = { crypttabExtraOpts = [ "fido2-device=auto" "token-timeout=10" ]; }; content = { type = "btrfs"; extraArgs = [ "-L" "nixos" "-f" ]; subvolumes = { "/root" = { mountpoint = "/"; mountOptions = [ "subvol=root" "compress=zstd" "noatime" ]; }; "/home" = { mountpoint = "/home"; mountOptions = [ "subvol=home" "compress=zstd" "noatime" ]; }; "/nix" = { mountpoint = "/nix"; mountOptions = [ "subvol=nix" "compress=zstd" "noatime" ]; }; "/persist" = { mountpoint = "/persist"; mountOptions = [ "subvol=persist" "compress=zstd" "noatime" ]; }; "/log" = { mountpoint = "/var/log"; mountOptions = [ "subvol=log" "compress=zstd" "noatime" ]; }; }; }; }; }; }; }; }; }; }; fileSystems."/persist".neededForBoot = true; ```Grub config
https://gitlab.com/hmajid2301/dotfiles/-/blob/80483732a327990126cf289a30690e8607bce36e/nixos/optional/grub.nix ```nixs { pkgs , inputs , ... }: { boot = { loader = { efi = { canTouchEfiVariables = true; efiSysMountPoint = "/boot"; }; grub = { enable = true; efiSupport = true; theme = inputs.grub-theme + "/src/catppuccin-mocha-grub-theme"; device = "nodev"; }; }; kernelPackages = pkgs.linuxPackages_latest; }; } ```I have a custom ISO which has an install script which partitions the drive during running the script:
Previous initrd config
```nix boot = { loader = { systemd-boot.enable = true; efi.canTouchEfiVariables = true; }; initrd.luks.devices = { root = { device = "/dev/disk/by-uuid/0c07218e-5df9-4312-b0da-06b5881c1236"; preLVM = true; }; }; }; ```:heart: Any ideas what I am missing here ? I believe luks automatically adds an entry to the initrd for us: https://github.com/nix-community/disko/blob/master/lib/types/luks.nix#L66-L70
Device Config: https://gitlab.com/hmajid2301/dotfiles/-/blob/80483732a327990126cf289a30690e8607bce36e/hosts/framework/configuration.nix