FreeBSD NFSv4 Share

thogs

New Member

Reaction score: 1
Messages: 17

Hello everyone,
I am currently having trouble sharing NFSv4 files:

1 -> When trying to mount on macOS, I can access normally.
2 -> However, when I try to access the sharing via cell phone (Kodi, VLC), via wireless, I can't.

My settings are in accordance with: NFSv4 documentation, Exports documentation

/etc/exports:
V4: / -sec=sys
/storageNAS/PublicShare -alldirs -maproot=root
/usr/src/PrivateShare -alldirs -maproot=root


/etc/rc.conf:
Bash:
nfs_server_enable="YES"
nfsv4_server_enable="YES"
 
Last edited:

Lamia

Well-Known Member

Reaction score: 84
Messages: 467

2 -> However, when I try to access the sharing via cell phone (Kodi, VLC), via wireless, I can't.
Look up the error messages in the log files and report them. You may even be able to fix the issue with the hints in the logs.
 
OP
thogs

thogs

New Member

Reaction score: 1
Messages: 17

Look up the error messages in the log files and report them. You may even be able to fix the issue with the hints in the logs.
Understand...
Thanks for the tip!

Another thing, when I try to do NFS from a Linux terminal, I get denied permission.

A question:
For home use, media consumption and more, what would you recommend: NFS or SAMBA?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 8,775
Messages: 33,056

For home use, media consumption and more, what would you recommend: NFS or SAMBA?
Depends on the client. For Windows clients Samba will work a lot better.
 
OP
thogs

thogs

New Member

Reaction score: 1
Messages: 17

Depends on the client. For Windows clients Samba will work a lot better.
Thanks for the answer!
A clean installation of FreeBSD 12.1 RELEASE and, following all the steps of the recording, it is now no longer possible to run NFSv3/4, run in any way
Windows, it seems, does not support SAMBAv4; maybe SAMBAv4 is v4 and v3 at the same time, I haven't really researched it yet, but I will...
My client is macOS, AndroidTV and other devices running Android/iOS.
 
OP
thogs

thogs

New Member

Reaction score: 1
Messages: 17

Of course it does.

The version of Samba has absolutely nothing to do with it.

I understood, that is: I am saying wrong things... Thank you very much for the clarifications.

Another question: I am using ZFS, in this case, should I release some flag for ZFS to support NFS sharing or am I talking nonsense again?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 8,775
Messages: 33,056

I am using ZFS, in this case, should I release some flag for ZFS to support NFS sharing
That shouldn't be needed. As far as I know you only need this if you're going to be using the Windows ACLs on a Samba share. I don't have anything special in smb4.conf, I only use "simple" sharing, no complex ACLs or anything like that. For my shares at home I don't need anything fancy.
 
OP
thogs

thogs

New Member

Reaction score: 1
Messages: 17

That shouldn't be needed. As far as I know you only need this if you're going to be using the Windows ACLs on a Samba share. I don't have anything special in smb4.conf, I only use "simple" sharing, no complex ACLs or anything like that. For my shares at home I don't need anything fancy.
My FreeBSD server is configured as follows, for NFS:
etc/exports:
V4: / -sec=sys
/usr/src/private /storage/public -alldirs -maproot=root


etc/rc.conf:
Bash:
samba_server_enable="YES"
rpcbind_enable="YES"
nfs_server_enable="YES"
nfsv4_server_enable="YES"
However, when I try to set up sharing for some macOS client for example, he says that I don't have permission (permission denied)... :-/
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 8,775
Messages: 33,056

Note that Samba has its own user database (and passwords). As for NFS you get this if you try to mount something that isn't exported or if your NFS client isn't using a privileged port.
 
OP
thogs

thogs

New Member

Reaction score: 1
Messages: 17

I asked for help on the forum, and you're teaching me how it works on FreeBSD, thank you very much!

I don't understand what I'm doing wrong; I've already uploaded all the services needed to run NFS Server, the settings are OK, but I don't understand why the first time I tested NFS, I was able to share with macOS and Linux clients, but now I can't share with anyone else...
 

Peter Eriksson

Member

Reaction score: 36
Messages: 55

1. rpcbind is not needed for NFSv4
2. You also need to run "nfsuserd"

nfsuserd_enable="YES"
nfsuserd_flags="-manage-gids -domain YOURNFSDOMAIN -usertimeout 60 4"

(usertimeout 60 = timeout cached user uid/gid information after 60 minutes, 4 = start 4 'servers' (increase if you have many clients))

3. On the Mac, create a /etc/nfs.conf file:

nfs.client.default_nfs4domain=YOURNFSDOMAIN
nfs.client.mount.options=vers=4,acl,nfc

(Replace "YOURNFSDOMAIN" with some unique string for your site. All NFSv4 server & clients need to have the same string or user & group names will not be correctly handled).

Beware that MacOS' NFS implementation has a number of problems. If you ever try to use "sec=krb5" it _will_ cause your Mac to spontaneously reboot (when the kerberos ticket expires). But since you are using sec=sys you are safe from that bug atleast.
 
Top