[Nix-dev] Encrypted root: LUKS over LVM

James Cook james.cook at utoronto.ca
Sun Jan 4 22:35:43 CET 2015


On 4 January 2015 at 12:04, Nikita Karetnikov <nikita at karetnikov.org> wrote:
> I’m trying to configure NixOS with LUKS over LVM as described in [1].
> After partitioning the disk (see ‘partition-table.sfdisk’), I did the
> following:
>
> # mkfs.ext3 /dev/sda1
> # cryptsetup luksFormat -i 5000 /dev/sda2
> # cryptsetup luksOpen /dev/sda2 main
> # pvcreate /dev/mapper/main
> # vgcreate main /dev/mapper/main
> # lvcreate -n main --extent=100%FREE main
> # mkfs.ext3 /dev/main/main
> # mkdir /mnt/boot
> # mount /dev/sda1 /mnt/boot
> # mount /dev/main/main /mnt
> # nixos-generate-config --root /mnt
>
> Then I edited ‘configuration.nix’ (attached) according to the wiki page
> and ran ‘nixos-install’, which failed (see ‘nixos-install.log’).  Is
> anything wrong with the config file?
>
> [1] https://nixos.org/wiki/Encrypted_Root_on_NixOS

I'm not sure if this matters, but try mounting /mnt before /mnt/boot.
I wonder if the second mount command is overriding the first, so that
/mnt/boot points to your LVM logical volume.

James


More information about the nix-dev mailing list