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

Mounting the nix store on /nix/ fails but /nix works #78951

Closed
Atemu opened this issue Jan 31, 2020 · 2 comments · Fixed by #95406
Closed

Mounting the nix store on /nix/ fails but /nix works #78951

Atemu opened this issue Jan 31, 2020 · 2 comments · Fixed by #95406
Labels
0.kind: bug 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: nixos

Comments

@Atemu
Copy link
Member

Atemu commented Jan 31, 2020

Describe the bug
A clear and concise description of what the bug is.

I have a separate /nix/ ZFS dataset whose mountpoint I declare in my NixOS config.

However when I try to boot that system, it mounts the root dataset, tries to read something out of the nix store (before it's mounted) and fails, prompting me to reboot or ignore.

  fileSystems."/nix" = {
    device = "Rpool/R/nix";
    fsType = "zfs";
  };

works but

  fileSystems."/nix/" = {
    device = "Rpool/R/nix";
    fsType = "zfs";
  };

doesn't.

To Reproduce
Steps to reproduce the behavior:

  1. Have a separate ZFS dataset for /nix/
  2. Try to mount it on /nix and /nix/ respectively
  3. Observe that /nix gets mounted before anything is read from the nix store while /nix/ isn't

Expected behavior
A clear and concise description of what you expected to happen.

It should behave the same, no matter the trailing slash.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Metadata
Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

 - system: `"x86_64-linux"`
 - host os: `Linux 4.19.98, NixOS, 19.09.1970.6d9a4a615ee (Loris)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.2`
 - channels(root): `"nixos-19.09.1970.6d9a4a615ee"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
@danbst
Copy link
Contributor

danbst commented Feb 15, 2020

I think this is because of NixOS/systemd@49e323d

/nix is handled specially, in particular, it is not unmounted. But /nix/ isn't matched, so it gets unmounted, which breaks everything (because everything lives in /nix/store).

@stale
Copy link

stale bot commented Aug 13, 2020

Hello, I'm a bot and I thank you in the name of the community for opening this issue.

To help our human contributors focus on the most-relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.

The community would appreciate your effort in checking if the issue is still valid. If it isn't, please close it.

If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me". If you'd like it to get more attention, you can ask for help by searching for maintainers and people that previously touched related code and @ mention them in a comment. You can use Git blame or GitHub's web interface on the relevant files to find them.

Lastly, you can always ask for help at our Discourse Forum or at #nixos' IRC channel.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Aug 13, 2020
Atemu added a commit to Atemu/nixpkgs that referenced this issue Dec 16, 2020
@FRidh FRidh closed this as completed in f536901 Jan 3, 2021
Mic92 added a commit to Mic92/nixpkgs that referenced this issue Jan 25, 2021
They are semantically the same as the non-slash version and therefore
are potential source of duplicates.

Also fixes NixOS#78951

Alternative to NixOS#95308
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: nixos
Projects
None yet
3 participants