nix-community / impermanence

Modules to help you handle persistent state on systems with ephemeral root storage [maintainer=@talyz]
MIT License
1.09k stars 80 forks source link

Kernel panic resulting from a possible precedence issue #77

Closed jmc-figueira closed 2 years ago

jmc-figueira commented 2 years ago

Hi!

I was previously using impermanence pinned to commit 58558845bc68dcf2bb32caa80564f7fe3f6cbc61 and, having seen the recent improvements to the module, decided to update to commit ff540dbe20556f6119d80f5c79796a0698a4ee38.

Unfortunately, somewhere in between, possibly due to the addition of #44, I believe that the /etc/NIXOS file, which I currently have configured to be persisted, as it is stated to be necessary for NixOS to recognize its own root partition, became involved in a precedence issue, where it causes NixOS to panic due to its potentially premature loading. The following screenshot exemplifies this occurrence (sorry for the poor quality but, as I do not have systemctl logs persisted, I am unable to directly copy the relevant log lines):

image

What occurs after the /etc/NIXOS clash is that systemd is not found and the boot process is aborted.

I apologize for the vagueness of my explanation, but I am at a loss as to what else may be the root cause of this issue, as well as any potential workarounds.

maydayv7 commented 2 years ago

/etc/NIXOS is automatically generated, and needn't be persisted. Works perfectly fine for me that way

etu commented 2 years ago

I believe that the /etc/NIXOS file, which I currently have configured to be persisted, as it is stated to be necessary for NixOS to recognize its own root partition, became involved in a precedence issue, where it causes NixOS to panic due to its potentially premature loading.

Where is this stated to be a necessary file? I'm running all my systems on tmpfs as root and ZFS for persistence mounted in where needed. I've never even looked at this file before.

talyz commented 2 years ago

Yeah, the /etc/NIXOS file is automatically created on boot by the setup-etc.pl script, so you don't need to persist it. However, the kernel panic is a bug that should be fixed. It probably occurs because the script exits with an error when a conflicting file is found. I'll fix that.

talyz commented 2 years ago

Can you try out #84 and see if it solves your issue?