-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
Can not nixos-install a system with system.etc.overlay.enable = true
#319533
Comments
Could it be that the |
Also weird that |
This is still present in latest NixOS unstable, it can be reproduced by going into the minimal installer and making a simple flake configuration with the following (in addition to normal stuff like filesystems bootloader etc.): {
system.etc.overlay = {
enable = true;
mutable = false;
};
boot.initrd.systemd.enable = true;
services.userborn.enable = true;
users.users.foobar = {
isNormalUser = true;
extraGroups = [ "wheel" ];
initialPassword = "foobar";
};
} Doing a Broken installer logsinstalling the boot loader... remounting /etc... mktemp: failed to create directory via template ‘/mnt/tmp.IT2ZwvUdyW/nixos-etc-m etadata.XXXXXXXXXX’: No such file or directory mount: /nix/store/58wzhs5xx51zyghmawm1l5s0kbn3mlwp-etc-metadata.erofs: can't fin d in /etc/fstab. mktemp: failed to create directory via template ‘/mnt/tmp.IT2ZwvUdyW/nixos-etc.X XXXXXXXXX’: No such file or directory mount: bad usage Try 'mount --help' for more information. mount: overlay: can't find in /etc/fstab. findmnt: can't read /proc/mounts: No such file or directory Moving mount Mounting beneath top mount Success | move-mount.c: 443: main: Invalid number of arguments 1 umount: failed to parse /proc/self/mountinfo: No such file or directory umount: : umount failed: No such file or directory. rmdir: failed to remove '': No such file or directory findmnt: can't read /proc/mounts: No such file or directory Activation script snippet 'etc' failed (1) Error: Failed to parse os-release From my understanding, some part of I have found that it can be kinda worked around by doing this:
Then running Almost-working installer logsbuilding the flake in path:/tmp/etc/nixos?lastModified=1731562727&narHash=sha256 -IVvqimmdY/4mDWtUSVaV11oafe7xUmZQZhe8mphCptM%3D... installing the boot loader... remounting /etc... mktemp: failed to create directory via template ‘/mnt/tmp.HXdCRHTu4x/nixos-etc-m etadata.XXXXXXXXXX’: No such file or directory mount: /nix/store/58wzhs5xx51zyghmawm1l5s0kbn3mlwp-etc-metadata.erofs: can't fin d in /etc/fstab. mktemp: failed to create directory via template ‘/mnt/tmp.HXdCRHTu4x/nixos-etc.X XXXXXXXXX’: No such file or directory mount: bad usage Try 'mount --help' for more information. mount: overlay: can't find in /etc/fstab. Moving mount Mounting beneath top mount Success | move-mount.c: 443: main: Invalid number of arguments 1 umount: /etc: not mounted umount: : no mount point specified. rmdir: failed to remove '': No such file or directory Activation script snippet 'etc' failed (1) Initializing machine ID from random generator. Created "/efi/EFI". Created "/efi/EFI/systemd". Created "/efi/EFI/BOOT". Created "/efi/loader". Created "/efi/loader/entries". Created "/efi/EFI/Linux". Copied "/nix/store/319jgkg1cbmgz076yq2pxpnxpd526cjg-systemd-256.7/lib/systemd/bo ot/efi/systemd-bootaa64.efi" to "/efi/EFI/systemd/systemd-bootaa64.efi". Copied "/nix/store/319jgkg1cbmgz076yq2pxpnxpd526cjg-systemd-256.7/lib/systemd/bo ot/efi/systemd-bootaa64.efi" to "/efi/EFI/BOOT/BOOTAA64.EFI". Random seed file /efi/loader/random-seed successfully written (32 bytes). Successfully initialized system token in EFI variable with 32 bytes. Created EFI boot entry "Linux Boot Manager". warning: the group 'nixbld' specified in 'build-users-group' does not exist remounting /etc... mktemp: failed to create directory via template ‘/mnt/tmp.HXdCRHTu4x/nixos-etc-m etadata.XXXXXXXXXX’: No such file or directory mount: /nix/store/58wzhs5xx51zyghmawm1l5s0kbn3mlwp-etc-metadata.erofs: can't fin d in /etc/fstab. mktemp: failed to create directory via template ‘/mnt/tmp.HXdCRHTu4x/nixos-etc.X XXXXXXXXX’: No such file or directory mount: bad usage Try 'mount --help' for more information. mount: overlay: can't find in /etc/fstab. Moving mount Mounting beneath top mount Success | move-mount.c: 443: main: Invalid number of arguments 1 umount: /etc: not mounted umount: : no mount point specified. rmdir: failed to remove '': No such file or directory Activation script snippet 'etc' failed (1) remounting /etc... mktemp: failed to create directory via template ‘/mnt/tmp.HXdCRHTu4x/nixos-etc-m etadata.XXXXXXXXXX’: No such file or directory mount: /nix/store/58wzhs5xx51zyghmawm1l5s0kbn3mlwp-etc-metadata.erofs: can't fin d in /etc/fstab. mktemp: failed to create directory via template ‘/mnt/tmp.HXdCRHTu4x/nixos-etc.X XXXXXXXXX’: No such file or directory mount: bad usage Try 'mount --help' for more information. mount: overlay: can't find in /etc/fstab. Moving mount Mounting beneath top mount Success | move-mount.c: 443: main: Invalid number of arguments 1 umount: /etc: not mounted umount: : no mount point specified. rmdir: failed to remove '': No such file or directory Activation script snippet 'etc' failed (1) setting root password... passwd: Cannot determine your user name. Setting a root password failed with the above printed error. You can set the root password manually by executing `nixos-enter --root '/mnt'` and then running `passwd` in the shell of the new system. It looks like it failed. But if you reboot... it boots fine! (and make sure to From a bit of digging looks like the offending script is here, and it's compounded by some other bug that requires |
I ran into this as well, a few observations:
Not sure yet, but I suspect that the move-mount logic might not work as expected in the mount namespace? Happy on hints & tricks on how to check that effectively. I think this is an important issue as I think it must affect at least everyone who's using etc.overlay.enable & nixos-install in tandem? It's not clear to me whether our custom code here works properly and whether it's worth it to avoid a dependency on composefs. etc activation log (failing move-mount)
|
@andre4ik3 I think your example works because you are using EFI boot with systemd-boot which doesn't require /etc for installation. So it succeeds to install your NixOS closure and bootloader. It then fails to complete activation and do things like setting a root password. It's still blocking installation for users who i.e. boot with grub or require the activation during installation to succeed for some reason (such as setting a root password) |
@phaer I was able to hack around this in the installer, however I think the changes are quite invasive (adding environment variables and command line flags to master...andre4ik3:nixpkgs:andre4ik3-fix-nixos-install-overlay I think the "proper" solution would be to split installation of bootloader from system activation? Then the activation scripts wouldn't need to run until the first boot, but the bootloader would still be installed. |
I proposed a potential fix in #364239 |
Describe the bug
After #319524 bricking my machine I'm trying to
nixos-install
now. Howevernixos-install
also doesn't work.Steps To Reproduce
set
system.etc.overlay.enable = true
inconfiguration.nix
and runnixos-install
Expected behavior
NixOS-install succeeds
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Notify maintainers
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Add a 👍 reaction to issues you find important.
The text was updated successfully, but these errors were encountered: