When using mirroredBoots with / on tmpfs, the following error occurs when building or rebuilding nixos:
...
evaluating file '/nix/var/nix/profiles/per-user/root/channels/nixos/pkgs/tools/misc/grub/2.0x.nix'
evaluating file '/nix/var/nix/profiles/per-user/root/channels/nixos/pkgs/development/tools/gnulib/default.nix'
updating GRUB 2 menu...
updating GRUB 2 menu...
updating GRUB 2 menu...
Failed to get blkid info (returned 512) for / on tmpfs at /nix/store/nvycxmg4g2q5jyqdxfvkgi95sqs48iw3-install-grub.pl line 202.
warning: error(s) occurred while switching to the new configuration
The build stops there. However, the build is actually completed and Grub updated, so I can reboot into the new derivation.
This doesn’t occur with a normal / on tmpfs installation, only / on tmpfs using mirroredBoots.
It’s not a showstopper since the new build still completes and activates, but it’s a little concerning nonetheless. Anyone know what might be the problem?
Additional info from Github Issue:
To Reproduce
Steps to reproduce the behavior:
- Configure
hardware-configuration.nix
with / on tmpfs. - Configure
configuration.nix
andhardware-configuration.nix
for mirroredBoots with two EFI boot partitions on different drives [1], [2] -
nix-build
ornix-rebuild
(dry-build and dry-activate succeed with no error, only boot/switch/etc cause this error)
Expected behavior
Re/Build should complete as normal.
Additional context
It seems the problem is that blkid /
returns nothing when / is on tmpfs. Can verify this by calling blkid on the commandline. However, this error does not occur on a normal, single-boot-partition / on tmpfs configuration, only when using mirroredBoots simultaneously with / on tmpfs.
configuration.nix
(boot properties subset) and hardware-configuration.nix
in this gist: boot section of configurtion.nix, troubleshooting mirroredBoots with / on tmpfs · GitHub
Full configuration.nix
here: https://github.com/byrongibson/nixos-setup/blob/7adfeb218ce4d9acab5c99d6683544e941836b3c/config/configuration.tmpfsroot.zfscrypt.full.z11pa-d8.nix
Metadata
Please run nix-shell -p nix-info --run "nix-info -m"
and paste the result.
- system:
"x86_64-linux"
- host os:
Linux 5.10.48, NixOS, 21.05.1408.9376bf7b342 (Okapi)
- multi-user?:
yes
- sandbox:
yes
- version:
nix-env (Nix) 2.3.12
- nixpkgs:
/nix/var/nix/profiles/per-user/root/channels/nixos