Skip to content
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

Fails with mkdir: cannot create directory: No such file or directory #154

Open
tmarkov opened this issue Dec 2, 2023 · 5 comments · May be fixed by #193
Open

Fails with mkdir: cannot create directory: No such file or directory #154

tmarkov opened this issue Dec 2, 2023 · 5 comments · May be fixed by #193

Comments

@tmarkov
Copy link

tmarkov commented Dec 2, 2023

I use impermanence with the following config:

  # Impermanence
  environment.persistence."/persist/system" = {
    directories = [
      "/etc/nixos" # bind mounted from /persist/system/etc/nixos to /etc/nixos
      "/etc/NetworkManager"
      "/etc/secureboot"
      "/var/log"
      "/var/lib"
    ];
    files = [
      "/etc/machine-id"
      "/etc/ssh/ssh_host_ed25519_key"
      "/etc/ssh/ssh_host_ed25519_key.pub"
      "/etc/ssh/ssh_host_rsa_key"
      "/etc/ssh/ssh_host_rsa_key.pub"
    ];
  };

When installing on a new system, I create a partition, mount it on /persist, and run nixos-install. However. this fails because when impermanence tries to create the persistence directories, it fails with No such file or directory errors.

I have fixed it like this - I'm nit sure though if this is a problem with impermanence or if I'm doing something wrong.

@Frontear
Copy link

Frontear commented Dec 5, 2023

Are you sure your /persist directory exists at the time of root creation? You should ensure "/persist" is loaded and mounted before impermanence gets to it, otherwise bind mounts fail.

@WayneHarsman
Copy link

Got the same issue here. Before running nixos-install the /mnt/persist/system directory is basically empty. Install script fails to create directory if the root of target path does not exist. Also this causes further complications during first boot since the system tries to mount binds for the non-existent directories and this halts the whole boot process. Tmarkov's solution looks like the proper fix for that.

@visualphoenix
Copy link

@talyz i tracked down the MVP of the nixos-anywhere provisioning issue - seems to be related to /etc/ssh keys not existing until the first boot... this issue lists similar keys being persisted... the MVP of the issue is https://github.com/visualphoenix/nixos-anywhere-disko-impermanence-mvp

@talyz
Copy link
Collaborator

talyz commented Jun 23, 2024

@visualphoenix That sounds like a different issue than this. Could you open a new one for it?

@talyz
Copy link
Collaborator

talyz commented Jun 23, 2024

#193 should have a proper solution for this, hopefully. Please try it out!

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 a pull request may close this issue.

5 participants