Skip to content

Conversation

@longregen
Copy link

@longregen longregen commented Oct 30, 2025

Occasionally, systemd tries to mount /nix/store as soon as they see that /dev/sda partition table changes. I observed sometimes that if systemd tries to mount /dev/sda2 while systemd-repart is modifying the device, then a boot failure happens:
20251030_015552

This is not the case always; but when it happens, the user is prompted to go to the recovery console.
20251030_015516

This small change prevents /sysroot/nix/store from getting mounted before systemd-repart is done. I'm not very well versed in systemd/initrd, but looks like the chain of requirements that causes this issue starts with "initrd-fs.target" asking for "rw-etc.service" which asks for "sysroot-nix-store.mount"; and "sysroot.mount" is definitely a requirement for "systemd-repart" according to https://github.com/NixOS/nixpkgs/blob/nixos-25.05/nixos/modules/system/boot/systemd/repart.nix#L185

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant