mount_nfs

Hi.

I'm trying to use mount_nfs(8) to another server that is on another end of a VPN line. This is for database purpose only not file distribution. But when I use mount_nfs //(server ip):/(share path)/ /mnt/(destination folder/ I get a permission denied.

I have used sudo -s so I have root access. I've mounted nullfs between users and that works great but that's internally. but externally it won't work. What am I missing.

Can anyone help me?

Halfe
 
By default only @root can mount filesystems. It doesn't matter if it's NFS, nullfs or anything else. It's the act of mounting that requires root access.
 
Last edited by a moderator:
So what do I do wrong.

How can I type in login credentials of the other server so I can connect.
 
Halfe said:
How can I type in login credentials of the other server so I can connect.
You can't. There is no authentication in NFS. The client that does the mounting has to be @root.

And you also need to remove those two slashes in front of the hostname, it's not used. The correct command is something like this:
mount_nfs myserver:/some/exported/dir /my/local/dir
 
Last edited by a moderator:
Code:
[root@DAVID] ~# mount_nfs 192.168.0.200:/Storage1 /mnt/MEDIA3/users/htpc/Media/Eventyrveien/
[tcp] 192.168.0.200:/Storage1: Permission denied
 
Ah, that just shows that it failed to use TCP. It's mounted but using UDP instead. NFS can operate on both UDP and TCP but the server may prefer one or the other.
 
Code:
mount_nfs -o udp 192.168.0.200:/Storage1 /mnt/MEDIA3/users/htpc/Media/Eventyrveien/


When using UDP I get this error:

Code:
[udp] 192.168.0.200:/Storage1/Media: RPCPROG_NFS: RPC: Program not registered
 
In that case it may be failing because of restrictions on the export. What does showmount -e 192.168.0.200 show?
 
Code:
showmount -e 192.168.0.200                                    
Exports list on 192.168.0.200:
/mnt/Storage4/Media                192.168.0.0 192.168.0.14
/mnt/Storage3/Media                192.168.0.0 192.168.0.14
/mnt/Storage2/Media                192.168.0.0 192.168.0.14
/mnt/Storage1/Media                192.168.0.0 192.168.0.14
 
It looks like it allows access from the 192.168.0.0/24 network and 192.168.0.14 specifically. But you may want to verify that. What IP address does the client have?
 
The client is on another IP segment using an Ipsec tunnel. so it have 10.0.2.10. So basically I have to set up permission from my IP on the server?

Both are running FreeNAS 9.2.1.
 
Yes, the exports(5) file will need to allow access from that network segment. That's the reason why it's giving you a "permission denied". You have the "wrong" IP address according to NFS. It doesn't matter much what IP addresses are used on the tunnel, it's the client's own IP address that's important.
 
So if I insert my client's IP address that is 10.0.2.10 on the server on the other side of the tunnel that have 192.168.0.200 that will work. I just have to edit the exports list.

How do I do that?
 
No idea how to do that on FreeNAS. But yes, you need to add the 10.0.2.10 address to the server's exports(5) file. FreeNAS may have a nice editor for that, I don't know.
 
Halfe said:
Can you show me how to do that from SSH?
Sure, as @root just vi /etc/exports or ee /etc/exports (use ee(1) if you're not familiar with vi(1)). If you changed that file you need to tell NFS to re-read it: pkill -HUP nfsd && pkill -HUP mountd. Verify with the showmount(8) command to see if it's set correctly.
 
Last edited by a moderator:
Keep in mind that my instructions are guaranteed to work on FreeBSD, FreeNAS may not have everything FreeBSD has or it may be in a different location.
 
Halfe said:
Can you show me how to do that from SSH?
FreeNAS and BSD are almost the same

No, they are not. FreeNAS has a web-based config, and many FreeBSD commands have been removed. If you try to do things as it if were FreeBSD, it may break the FreeNAS configuration.
 
Back
Top