SOLVED how to nfs share multiple directories on LAN in 11.x

Status
Not open for further replies.

keithg

Explorer
Joined
May 15, 2013
Messages
92
Ok, that must be it. The UI is now becoming strict with this and it was 'loose and fast' before. I created a dataset with my PXE stuff in it and shared it with 192.168.2.0/24 and it created it no problem. I was a bit unclear about this up until today and thank you for the lesson.
Code:
cat /etc/exports
V4: / -sec=sys
/mnt/first_NAS/pxe  -alldirs -maproot="root":"wheel" -network 192.168.2.0/24
...


I will have to re-arrange my NAS a bit to comply with this.

Thanks for the help!
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
After pressing the point about sharing datasets in #7 & #9 above, I failed to take proper notice of the zfs list output you posted in #10 and hence the detour. But you needed to clear out the existing shares anyway before you could proceed, so apart from time, there was no big loss.

Happy NAS-ing.
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
@keithg Forget to say you should nark the thread a solved.

I owe you an apology for going round in circles while trying to help with the issue you had with your nfs shares this week.

Anyone reading this thread will probably think I'm an idiot - and rightly so. I had completely forgotten that when creating NFs shares via the FreeNAS UI there is the (obscure?) option to "click Add extra path to select multiple paths" to add more than one path to a share.

Your original exports file seemed valid for FreeBSD, but looked odd to me for FreeNAS because I had never used that extra path option.

Using my example again shows how it's possible to share both pdir1 and pdir2 without error :

Code:
root@freenas:~ # zfs list | grep nfs	
NasPool/nfs_share_parent								   272K  17.3G	96K  /mnt/NasPool/nfs_share_parent 
NasPool/nfs_share_parent/nfs_share_child1				   88K  17.3G	88K  /mnt/NasPool/nfs_share_parent/nfs_share_child1 
NasPool/nfs_share_parent/nfs_share_child2				   88K  17.3G	88K  /mnt/NasPool/nfs_share_parent/nfs_share_child2 
root@freenas:~ # cd /mnt/NasPool/nfs_share_parent;ls -l 
total 4 
-rw-r--r--  1 chris  chris  2 May  4 12:02 cfile1 
drwxr-xr-x  2 chris  chris  3 May  3 10:02 nfs_share_child1 
drwxr-xr-x  2 chris  chris  2 May  3 09:50 nfs_share_child2 
drwxr-xr-x  2 chris  chris  3 May  4 08:45 pdir1 
drwxr-xr-x  2 chris  chris  2 May  4 08:51 pdir2 
-rw-r--r--  1 chris  chris  0 May  4 08:44 pfile1 
-rw-r--r--  1 chris  chris  0 May  4 08:44 pfile2 
root@freenas:/mnt/NasPool/nfs_share_parent #


Sharing two directories within the same datasets without error.

Code:
root@freenas:~ # cat /etc/exports 
V4: / -sec=sys 
/mnt/NasPool/nfs_share_parent/pdir2 /mnt/NasPool/nfs_share_parent/pdir1  -maproot="root":"wheel" -sec=sys 192.168.0.201 192.168.0.11 192.168.0.22 192.168.0.9
9 
root@freenas:~ # showmount -e localhost 
Exports list on localhost: 
/mnt/NasPool/nfs_share_parent/pdir2 192.168.0.201 192.168.0.11 192.168.0.22 192.168.0.99  
/mnt/NasPool/nfs_share_parent/pdir1 192.168.0.201 192.168.0.11 192.168.0.22 192.168.0.99  
root@freenas:~ # 


This is done by adding /mnt/NasPool/nfs_share_parent/pdir1 as an extra path while creating the share of /mnt/NasPool/nfs_share_parent/pdir2

None of this explains what went wrong, but might be useful for future reference and give you another option for your share configuration.
 
Last edited:

keithg

Explorer
Joined
May 15, 2013
Messages
92
Kris,

One more question. I have rearranged my NAS and things are moving along. I did noticve a message, though, and am wondering what is up.

I get this every day, now. Never seen it before

NAS.griders kernel log messages:
> nfsrv_cache_session: no session
> nfsrv_cache_session: no session
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
Status
Not open for further replies.
Top