SOLVED Unable to create multiple NFS shares from different directories within the same dataset

Status
Not open for further replies.

Ruhe

Cadet
Joined
Nov 7, 2014
Messages
2
Is it wrong to create multiple NFS share from the same dataset if they're being created from different directories?
For example, my dataset path is /mnt/volume0/unix and I'm trying to create shares for these two folders:
  • /mnt/volume0/unix/containers/gitlab
  • /mnt/volume0/unix/containers/minecraft
I want to use different user mappings for each share and the same authorized networks for them both, but am unable to do so as I receive this error message:
  • The network 192.168.1.0/0 is already being shared and cannot be used twice for the same filesystem
So as a work-around I specified the second share with a specific IP address instead of a network and now when I try to create any more shares I get this error message:
  • The network 0.0.0.0/0 is already being shared and cannot be used twice for the same filesystem
I can see this bug report was filed and fixed about a month ago and that some commits were made to the sharing form code. Am I really not supposed to create multiple NFS exports from the same dataset at all?
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Is it wrong to create multiple NFS share from the same dataset if they're being created from different directories?
It's certainly not a best practice for any share.

Judging by the error message, using child datasets will solve your problem.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
You should not be sharing the same location twice at the same time. That's why you got the warning. The permissions should control who and what access the given user has.

So to go a step above what Ericloewe said, I'd call it working around what shouldn't be worked around.

NFS shares don't really have "names" like CIFS shares do. With CIFS you specify locations based on the server IP, then share name, and then subfolders (if necessary). So going to //server/share1 is totally acceptable and may mount to /mnt/tank/share1. You could even have //server/shareone go to the same location. But NFS uses the actual logical location though. So you will always be going to /mnt/tank/share1. There will be no "share name" like CIFS has. There is no using alternative names, or anything of the sort (minus some hackery/trickery with hard links and other stuff, which you clearly shouldn't be doing yet). There is no reason at all to have multiple shares because the location you will go to for the share wil be the same... /mnt/tank/share1. If you choose to share out /mnt/tank/share1 in NFS, it will *always* be available at /mnt/tank/share1 and nowhere else. So there is no reason at all to try to share out another location.

Not to sound like I'm bashing your head in, but there's no reason you need to have multiple shares for different users. And whatever you think you are trying to accomplish by having two "shares" point to the same location, I can assure you it is doing no such thing. :P

So I have no clue what you are trying to do, what you think you are doing, but you are definitely doing nothing but doing really weird bat-sh*t crazy stuff with NFS from my perspective. :P
 

Ruhe

Cadet
Joined
Nov 7, 2014
Messages
2
Thank you for the explanation. It looks like I'm trying to do CIFS stuff with NFS. I wanted to share two different folders that have different permissions with different mapall arguments -- something like I would do a windows share.

I figured out how to get all the CIFS bits worked out and so far it looks like I got what I wanted. I guess I was just using the wrong tool.
 

neils

Dabbler
Joined
Oct 29, 2012
Messages
46
You should not be sharing the same location twice at the same time. That's why you got the warning. The permissions should control who and what access the given user has.

So to go a step above what Ericloewe said, I'd call it working around what shouldn't be worked around.

NFS shares don't really have "names" like CIFS shares do. With CIFS you specify locations based on the server IP, then share name, and then subfolders (if necessary). So going to //server/share1 is totally acceptable and may mount to /mnt/tank/share1. You could even have //server/shareone go to the same location. But NFS uses the actual logical location though. So you will always be going to /mnt/tank/share1. There will be no "share name" like CIFS has. There is no using alternative names, or anything of the sort (minus some hackery/trickery with hard links and other stuff, which you clearly shouldn't be doing yet). There is no reason at all to have multiple shares because the location you will go to for the share wil be the same... /mnt/tank/share1. If you choose to share out /mnt/tank/share1 in NFS, it will *always* be available at /mnt/tank/share1 and nowhere else. So there is no reason at all to try to share out another location.

Not to sound like I'm bashing your head in, but there's no reason you need to have multiple shares for different users. And whatever you think you are trying to accomplish by having two "shares" point to the same location, I can assure you it is doing no such thing. :p

So I have no clue what you are trying to do, what you think you are doing, but you are definitely doing nothing but doing really weird bat-sh*t crazy stuff with NFS from my perspective. :p

What if I want to export the same path read-only to some set of hosts but read-write to another set of hosts? What's best practice for that?
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
What if I want to export the same path read-only to some set of hosts but read-write to another set of hosts? What's best practice for that?
I'd advise you to write up your situation in a new thread. Your question is basically unrelated to this (old) thread.
 
Status
Not open for further replies.
Top