NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.34k stars 14.3k forks source link

nix store on nilfs2 does not work out of the box #65548

Open xaverdh opened 5 years ago

xaverdh commented 5 years ago

I tried using nilfs2 as file system for the nix store, and found that I had to manually add initrd.kernelModules = [ "nilfs2" ] to my system configuration to make it work.

Expected behavior The filesystem type should be auto detected and the kernel module injected into the initrd without having to manually specify it.

Metadata Please run nix run nixpkgs.nix-info -c nix-info -m and paste the result.

xaverdh commented 5 years ago

Somewhat related, the nilfs_cleanerd garbage collection daemon appears to not get started when the filesystem is mounted from the initrd. Probably because the mount helper is bypassed?

xaverdh commented 5 years ago

Ok, I attempted to add a module for nilfs2. What I can't figure out, is how to make nilfs_cleanerd run in a sane way. It should get started by mount, but isn't? Even if started explicitly from initrd, that doesn't seem to survive (is that expected?).

lheckemann commented 5 years ago

that doesn't seem to survive (is that expected?).

Yes: https://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons/ So either:

xaverdh commented 5 years ago

Ah, thanks for the reference! I'm not quite sure if it needs to run form initrd. It better run from initrd if there is a chance that the root filesystem becomes full and the system needs to write stuff for booting... not sure how realistic that is. Otherwise it should be fine to run in a systemd service after startup. There is one additional issue with e.g. the nix store though: nilfs_cleanerd will only run on an rw mount. Not sure what the right approach is here, maybe the solution doesn't have to be in the official module. People with that setup can just add an additional rw mount..

xaverdh commented 5 years ago

Ok, so I think mounting the filesystem rw on a separate mount point is a good solution. If I find a better one, I will file another pr. In the meantime I would consider #65748 to be quite useful on its own.

lheckemann commented 5 years ago

The read-only /nix/store mount is generally just a bind mount piggy-backing on the read-write / or /nix mount, and shouldn't break it I think (and for writing to the store, nix remounts it read-write in a separate mount namespace).

nixos-discourse commented 4 years ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/github-was-purchased-by-microsoft/313/57

stale[bot] commented 4 years ago

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.

bangzek commented 2 years ago

This issues stil exist in 21.11

rapenne-s commented 2 years ago

Still exist as of today in nixpkgs-unstable