Thanks to the community for all the help lately. After having fun with NixOS on Pis and VMs, when Samba stopped working on my Arch plex + backup server for the zillionth time this week I decided to take the plunge and try to convert it to NixOS via NIXOS_LUSTRATE.
The conversion process went okay with a few minor hiccups (GRUB didn’t like my EFI mountpoint at /efi but putting it at /boot/efi and rerunning switch-to-configuration boot seems to have fixed things). EDIT: Now that I think about it, there were also some issues about the zpool previously being on a different system; I think some combination of zpool import -f tank and zpool export tank and zpool import tank got rid of this.
Unfortunately I’m running into some issues with ZFS:
- my non-root ZFS pool doesn’t automatically import at boot
- my ZFS-based Samba share fails
Currently I have commented out all of the automatically generated zfs-relevant mountpoints in my hardware-configuration.nix. I have mountpoint=foo and canmount=on set for all of the datasets. A manual zpool import tank mounts the datasets as expected, albeit with an SMB error: cannot share 'tank/my/share: system error': SMB share creation failed.
Upon reboot the zfs mounts are not mounted. systemctl status zfs-mount seems to have succeeded (no errors). systemctl --failed shows no errors.
Trying to solve the issue, I’m finding some conflicting information regarding legacy mountpoints:
By default, all ZFS pools available to the system will be forcibly imported during boot.
zfs-mount service is enabled by default on NixOS 22.05.
To automatically mount a dataset at boot, you only need to setcanmount=onandmountpoint=/mount/pointon the respective datasets.
This makes it seem like I don’t need legacy mountpoints or references in my hardware-configuration.nix as of 22.05 (I’m running 22.11).
The docs for boot.zfs.extraPools suggest the opposite approach:
Instead, you should set the mountpoint property of ZFS filesystems to
legacyand add the ZFS filesystems to NixOS’sfileSystemsoption
I’m wondering if the SMB error from above is causing an issue? Also not sure how to debug the SMB share problem. I have services.samba enabled and configured (importing my previously working config), and it actually seems to be working (I can import the share from another computer). Why the ZFS error upon zpool import?
Should I just set everything to legacy and go the old-school route? Maybe I have some kind of race condition that’s preventing zfs-mount from working automatically? TIA for any ideas.