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

ZFS dataset with specified non-legacy mount point does not automount #27183

Closed
0xABAB opened this issue Jul 6, 2017 · 7 comments
Closed

ZFS dataset with specified non-legacy mount point does not automount #27183

0xABAB opened this issue Jul 6, 2017 · 7 comments
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md

Comments

@0xABAB
Copy link
Contributor

0xABAB commented Jul 6, 2017

Issue description

I expected to see all the mount points associated with all ZFS datasets to be mounted at boot. In this case that means that doing ls /a where zpool/a is non-empty would return files.

systemctl list-unit-files | grep zfs
zfs-mount.service                      enabled  
zfs-share.service                      enabled  
zfs-sync-zpool.service                 enabled  
zfs-zed.service                        enabled  
zfs-import.target                      linked   
zfs.target                             enabled  
zpool/a          1G  1T  1G  /a

zfs-import.target status according to systemd tools was dead and that's not supposed to happen.

This code is rather suspicious:

# Remove provided services as they are buggy
        rm $out/etc/systemd/system/zfs-import-*.service

@

# Remove provided services as they are buggy

The zfs-import service is the service which seems to be related in all the reports surrounding this issue and seems a critical component, which cannot just be deleted.

17.03.git.81fceb2 (Gorilla)

@Mic92 (since it appears you worked most recently on the code)

@Mic92
Copy link
Member

Mic92 commented Jul 7, 2017

We do not support non-legacy mounts at the moment as they rely on the assumption that hardware is immediately available instead of using event-based mechanism provided by udev like all other filesystems on linux. This might be fixed by openzfs/zfs#4943
Since zfs mountpoints are not included in fstab, it also breaks horrible if non-zfs mounts are on top of a zfs dataset, since mount or the systemd's mount generator cannot interfere proper hierarchical dependencies.
That being said there is a generator required before we can turn this on, because this can result in unbootable systems due race conditions between zfs and mountpoints on top of that. If you really insist on using this feature please implement it yourself, we cannot guarantee stability for the general case.

@CMCDragonkai
Copy link
Member

Being able to use non-legacy mountpoints would definitely make ZFS alot easier to use on NixOS especially when creating ephemeral datasets and subdatasets for various version controlled workspaces.

@Mic92
Copy link
Member

Mic92 commented Apr 26, 2018

zfsonlinux has implemented a systemd generator now in zfs master: openzfs/zfs#7329
It is not yet integrated into nixos.

@Thunderbottom
Copy link
Member

any updates on having the zol systemd generator integrated into NixOS?

@kayg04
Copy link

kayg04 commented Feb 10, 2019

So, one possible workaround for using zfs native mounts is adding only the root filesystem mountpoint to /etc/nixos/hardware-configuration.nix (just so it doesn't throw an error) and rebuilding your system with zfs datasets (including the root dataset) set to native mounts.

@stale
Copy link

stale bot commented Jun 3, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 3, 2020
@Mic92
Copy link
Member

Mic92 commented Jun 3, 2020

I opened a new more actionable issue: #89396 which solves the problem.

@Mic92 Mic92 closed this as completed Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Projects
None yet
Development

No branches or pull requests

5 participants