Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initrd configuration to unlock existing LUKS device #756

Open
solomon-b opened this issue Sep 2, 2024 · 1 comment
Open

initrd configuration to unlock existing LUKS device #756

solomon-b opened this issue Sep 2, 2024 · 1 comment
Labels
question Not a bug or issue, but a question asking for help or information

Comments

@solomon-b
Copy link

solomon-b commented Sep 2, 2024

I have an existing Nixos installation with LUKS full disk encryption and the disk partitions managed by Disko. The LUKS crypt was secured with fido2 (and a backup password) and initrd was set to use fido2 via:

  boot.initrd.luks.devices.CRYPT.crypttabExtraOpts = [ "fido2-device=auto" ];

I need to switch the system to boot via the backup password but am having trouble updating initrd. I'm using a nixos boot disk, manually unlocking the crypt, mounting everything in /mnt, and running nixos-install.

When I boot the machine it goes right to attempting to mount the partitions inside the encrypted LUKS device without decrypting the LUKS device.

I tried setting initrd.luks.devices.CRYPT.device as described here but this conflicts with Disko's generated config.

I noticed that the settings option should allow me to specify the device via the disko config. So I tried setting:

{
  name = "luks";
  start = "512MiB";
  end = "100%";
  content = {
    type = "luks";
    name = "CRYPT";
    settings = {
        device = "/dev/disk/by-uuid/my-actual-uuid";
    };
    content = {
      type = "zfs";
      pool = "tank";
    };
  };
};

Unfortunately, this didn't help when I rebooted.

I'm not sure if it matters but I'm still using the deprecated table type for my disko config. I'm hesitant to change that before getting the system to boot.

@solomon-b solomon-b changed the title initrd configuration to unlock LUKS device initrd configuration to unlock existing LUKS device Sep 2, 2024
@iFreilicht
Copy link
Contributor

I tried setting initrd.luks.devices.CRYPT.device as described here but this conflicts with Disko's generated config.

You can remove parts of disko's config temporarily. The other solution would be to use lib.mkForce to ensure your configuration takes precendence over what disko defined.

@iFreilicht iFreilicht added the question Not a bug or issue, but a question asking for help or information label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Not a bug or issue, but a question asking for help or information
Projects
None yet
Development

No branches or pull requests

2 participants