After days of struggle, I’ve got NixOS installing on a seemingly redundant disk setup from a combination of bash scripts and .nix files but am having an issue with GRUB /boot/efiX
folder thinking it’s encrypted/
In this Partition Creation Script I’m
- Using mdadm to create a RAID10 out of my four nvme drives
- Creating a luks volume on that array and formatting it with ext4 fs
- Mounting that encrypted luks partition to root
/
← this might be part of the problem - Creating and mounting
/boot/efiX
partition on each of those drives for redundant bootloader
Then in my hardware-configuration.nix I’m
- Setting up the four redundant
/boot/efiX
as grub boot mirrors - Mounting the luks ext4 partition as root
/
Technically, this installs and boots, however there’s an error at the end of the process which reappears inside the booted OS which is preventing me from doing a nix-rebuild switch
.
The error in the nix rebuild is like so
building Nix...
building the system configuration...
updating GRUB 2 menu...
updating GRUB 2 menu...
updating GRUB 2 menu...
updating GRUB 2 menu...
updating GRUB 2 menu...
installing the GRUB 2 boot loader into /boot/efi0...
Installing for x86_64-efi platform.
/nix/store/k2cwk22w6v7fhmmac0ifk4si3cbn18gj-grub-2.12/sbin/grub-install: error: attempt to install to encrypted disk without cryptodisk enabled. Set `GRUB_ENABLE_CRYPTODISK=y' in file `/nix/store/k2cwk22w6v7fhmmac0ifk4si3cbn18gj-grub-2.12/etc/default/grub'.
/nix/store/ilc3scjv4fbq33pxi26n8d585wvssgzm-install-grub.pl: installation of GRUB EFI into /boot/efi0 failed: No such file or directory
Failed to install bootloader
It seems to take issue with the /boot/efiX
partitions being mounted in what it thinks is an encrypted space, and so grub wants me to set enableCryptodisk=true;
.
I can’t do that however because
- That
/boot/efiX
mount isn’t actually encrypted (to my knowledge?) - According to This other thread grub encryption and luks encryption aren’t particularly compatible
- I don’t want an encrypted bootloader, that seems to add complexity without benefit
Any idea how I can essentially coerce grub into thinking that /boot/efiX are not encrypted directories?
Contents of those boot/efiX
directories, despite the warnings, show bootloader was installed…
Really I just need to suppress the warning
/boot/efi0:
total 2392
drwxr-xr-x 5 root root 4096 Dec 31 1969 .
drwxr-xr-x 7 root root 4096 Dec 18 18:48 ..
-rwxr-xr-x 1 root root 9058 Dec 18 18:48 background.png
-rwxr-xr-x 1 root root 2413132 Dec 18 18:48 converted-font.pf2
drwxr-xr-x 3 root root 4096 Dec 18 18:17 EFI
drwxr-xr-x 5 root root 4096 Dec 18 18:48 grub
drwxr-xr-x 2 root root 4096 Dec 18 18:32 kernels
Extra context, lsblk output from within booted NixOS
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme3n1 259:0 0 3.7T 0 disk
├─nvme3n1p1 259:4 0 512M 0 part /boot/efi3
└─nvme3n1p2 259:5 0 3.7T 0 part
└─md0 9:0 0 7.5T 0 raid10
└─luksraid 254:0 0 7.5T 0 crypt /nix/store
/
nvme2n1 259:1 0 3.7T 0 disk
├─nvme2n1p1 259:7 0 512M 0 part /boot/efi2
└─nvme2n1p2 259:8 0 3.7T 0 part
└─md0 9:0 0 7.5T 0 raid10
└─luksraid 254:0 0 7.5T 0 crypt /nix/store
/
nvme1n1 259:2 0 3.7T 0 disk
├─nvme1n1p1 259:6 0 512M 0 part /boot/efi1
└─nvme1n1p2 259:9 0 3.7T 0 part
└─md0 9:0 0 7.5T 0 raid10
└─luksraid 254:0 0 7.5T 0 crypt /nix/store
/
nvme0n1 259:3 0 3.7T 0 disk
├─nvme0n1p1 259:10 0 512M 0 part /boot/efi0
└─nvme0n1p2 259:11 0 3.7T 0 part
└─md0 9:0 0 7.5T 0 raid10
└─luksraid 254:0 0 7.5T 0 crypt /nix/store
/