October 31, 20241 yr I have a question regarding ZFS NFS exports To properly shared ZFS datasets it's required to have the /etc/exports.d/zfs.exports configured for the shares This obviously doesn't persist after a reboot because it's not part of the saveable file system The only way I've got around it so far is to run a user script at array start to run the ZFS commands to populate the file again It works ok but it can fail if there is some race condition if it executes the command before the zfs pool imports So not sure if there is something already implemented I'm missing for this to persist or it would have to be a feature request for NFS shares? If you just manually create a folder in the ZFS pool, the standard NFS shares work, but you lose the ability for snapshots etc which isn't ideal and one of the best points of ZFS
October 31, 20241 yr Would using zfs to manage the shares work for your use case? https://blog.programster.org/sharing-zfs-datasets-via-nfs
October 31, 20241 yr Author Yes that's what I have to do to get it working I mount the NFS shares with the ZFS commands in the user scripts plugin I set it to run at First Array Start Only Those commands create the file /etc/exports.d/zfs.exports If I reboot that file does not persist so the commands need to be run again to add the shares I've done it a few times and it works but if I take it down manually to do something and bring it back up again it won't run and I have to remember to do it Or I'm sure at some point if the plugin breaks with an update or somehow the command runs before the pool is imported it will break it If it could persist somehow by Unraid managing the command itself to run when the pool mounts that would be awesome I'm sure at some point someone else is going to run into this issue
October 31, 20241 yr Author Actually reading that article this stands out "An important thing to bear in mind is that you will need to run the steps below for sharing on every pool/dataset that you wish to share, no matter the hierarchy." With Unraid settings as a ZFS pool you can only export the root pool, it doesn't do any of the datasets Which makes sense why I can see all the folders when I mount the NFS drive that way but can't see any files So I would need an option in Unraid to be able to mount all the datasets as well The way I do it with the script now works because the commands replicates from the top down to all the datasets
February 28, 20251 yr Hi i need this too. The article linked before is great. Do you know if i need to run this every time i restart my server? zfs set sharenfs=on myzfs-pool/dataset/sub-dataset
February 28, 20251 yr 41 minutes ago, shinexx said: Do you know if i need to run this every time i restart my server? Should only be needed once.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.