Open schmittlauch opened 6 years ago
Same occurs here though sda2 is a swap partition in my case while sda3 is a btrfs partition. Creates a luks.devices
for the btrfs partition only.
@schmittlauch Has this been solved or do you have a workaround?
@Spass1966 The issue hasn't been resolved so far. My workaround was adding the missing LUKS device to the config manually and never regenerating the hardware-configuration.nix since then.
Edit: Actually I cannot currently check whether this issue still exists or not, as I have changed away from a setup with 2 LUKS volumes to just one. Sorry, completely forgot about that
@schmittlauch Do you mind posting your config? I am about to do a similar install and I'd like to make sure I don't make any mistakes adding the device.
@Spass1966 my working config back when I still used such a setup (Btrfs as a "single" fs over 2 LUKS volumes):
boot.initrd.luks =
{ devices =
{ "systemA".device = "/dev/disk/by-uuid/1d57fb8c-301b-4d8c-8652-dcda39910404";
"systemB".device = "/dev/disk/by-uuid/d68d217b-5443-49ca-af1b-9f2eacb73d8b";
"cryptswap".device = "/dev/disk/by-uuid/472d5c58-d834-4ff8-82f1-f98d627e9163";
};
reusePassphrases = true;
};
fileSystems."/" =
{ device = "/dev/disk/by-uuid/0cd6d909-dba3-4542-a3b3-bffa16f6ce78";
fsType = "btrfs";
options = [ "subvol=nixos_root" ];
};
You have to change the "systemA" and "systemB" to the names of your LUKS volumes and also change the device UUIDs.
Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:
This is still an issue.
I also still see this issue. My use case is a laptop with two SSDs that I wanted to run Btrfs on LUKS with a single logical (encrypted) volume for the root directory across the two drives.
To get something to work,
hardware-configuration.nix
hardware-configuration.nix
in the same way specified in @schmittlauch's post above to add the additional physical drive that was not automatically picked up
Related - I also looked into Disko, which is a neat tool for declarative disk management, but it also has an issue with btrfs multi-device volumes: https://github.com/nix-community/disko/issues/261
Issue description
I use a Btrfs multi-device file system as my / fs. While the mount command requires only one of the devices to be mentioned, the other Btrfs devices forming the whole file system are discovered at runtime. If using them on top of LUKS encryption, that means all luks devices need to be unlocked for the mount to succeed. Nevertheless
nixos-generate-config
only creates aboot.initrd.luks.devices
entry for the device mentioned in the mount command, thus causing all other devices not to be unlocked and the mount to fail.Steps to reproduce
nixos-generate-config --root /mnt
boot.initrd.luks.devices
entry for /dev/sda1 but none for /dev/sda2Technical details
"x86_64-linux"
Linux 4.14.54, NixOS, 18.03.132847.aec217852f2 (Impala)
yes
no
nix-env (Nix) 2.0.4
/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs