NFS Sharing of /

daBee

Active Member

Reaction score: 7
Messages: 190

Hi folks.

NFS up and running, but the /etc/exports file has me stumped. I want to share the whole / so I inserted this directive:

Code:
# /etc/exports
/ -alldirs hq.local
/home   -alldirs        192.168.1.4
/home/rich/     -network 192.168.1.4
The last 2 directives were added later to see if I could get it to share properly. I'd like to have my text editor have access (read + write) to my files. Currently with the top directive, / is indeed shared, but home directory is giving me permissions issues.

Anybody know what I'm doing wrong here? BTW the hosts file has proper resolution to hq.local. Any help appreciated.

Cheers
 

Oko

Daemon

Reaction score: 768
Messages: 1,620

You have not posted enough details for us to troubleshoot your problem but for starters sharing any directory owned by root requires exporting things in so called "unsafe" mode. That should never be done in practice. Before we go any further you have to tell us if you are using NFSv3 or NFSv4 as they differ in configuration (personally I can't stand NFSv4 championed by Linux people and adopted only by FreeBSD of all BSDs). Secondly ZFS is NFS aware. Great. There are two different ways to export ZFS data sets. One is "old fashion" way which you are doing. Another is via ZFS tunables. How do you syncronize accounts? Are you using NIS or LDAP server? This is just a server side info that you have to provide us with.

On the client side you have to tell us what OS (Linux distro) are running client machines? OS X had some ugly NFS client bugs but that should have being fixed 5-6 years ago.
 
OP
OP
daBee

daBee

Active Member

Reaction score: 7
Messages: 190

I'm on a LAN for one person. I am using ZFS. I don't synchronize accounts as there is one. My client is OSX. Nothing unsafe about exporting root in this case, because there is nobody else here. I also tried exporting my home directory, but that isn't showing up either. I've not read about old fashioned or new fashioned. I'm trying to export as much as I can so I can stay out of pico and just run to my local editor over filesharing. If there is an option for clearer config, then I'd take it.

I wanted to export root because of the files in /etc/, but also my own scripts in /home/rich/. I believe I am using NFS4.
 

ANOKNUSA

Aspiring Daemon

Reaction score: 372
Messages: 675

Oko is right, in that you need to provide information on the complete configuration: the exports file, the contents of rc.conf on each system, the output of showmount -e <server>, how you try to mount the export, and what error message you get when trying to mount it.

I think you might be using NFSv3 (which is definitely the simpler and more manageable of the two). I believe the FreeBSD NFS daemons automatically choose the protocol based on the syntax used in your configuration files. Based only on what we know so far, the first thing I would try is to map your / export to the DHCP IP address assigned to the client. (I don't actually know what "hq.local" means, and my search hasn't turned up anything telling.) You should also remove the first of those two lines referring to /home, as it might conflict with the second; and since /home is a symlink, give the absolute path in the second export: /usr/home/rich.
 
OP
OP
daBee

daBee

Active Member

Reaction score: 7
Messages: 190

OK, sorry for the delay. Here is that info. It's simple as there's only the FreeBSD server and my OSX workstation where I want to mount this volume.

Code:
[Tue Apr 25 04:27:32 rich@neb ~] showmount -e server
RPC: Unknown host
showmount: can't do exports rpc
Pertinent /etc/rc.conf

Code:
nfs_server_enable=YES
mountd_enable=YES
Code:
[Tue Apr 25 04:35:33 rich@neb ~] rpcinfo -p localhost
   program vers proto   port  service
    100000    4   tcp    111  rpcbind
    100000    3   tcp    111  rpcbind
    100000    2   tcp    111  rpcbind
    100000    4   udp    111  rpcbind
    100000    3   udp    111  rpcbind
    100000    2   udp    111  rpcbind
    100000    4 local    111  rpcbind
    100000    3 local    111  rpcbind
    100000    2 local    111  rpcbind
    100005    1   udp    813  mountd
    100005    3   udp    813  mountd
    100005    1   tcp    813  mountd
    100005    3   tcp    813  mountd
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100003    2   tcp   2049  nfs
    100003    3   tcp   2049  nfs
Code:
# RF mods in /etc/exports
#/ -alldirs hq.local
/usr/home/rich/         -network        192.168.1.4
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 6,926
Messages: 28,850

Code:
[Tue Apr 25 04:27:32 rich@neb ~] showmount -e server
RPC: Unknown host
showmount: can't do exports rpc
You're supposed to replace <server> with the name or IP address of the server.


Code:
dice@maelcum:~ % showmount -e molly
Exports list on molly:
/usr/src                           192.168.10.0 
/storage/media                     192.168.10.0
/usr/obj                           192.168.10.0
 
OP
OP
daBee

daBee

Active Member

Reaction score: 7
Messages: 190

Sorry, it's late/early.

Code:
[Tue Apr 25 05:05:06 rich@neb ~/RF_scripts] showmount -e localhost
Exports list on localhost:
/usr/home/rich/                    192.168.1.4
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 6,926
Messages: 28,850

Ok, that shows that /usr/home/rich/ is allowed to share to a client with IP 192.168.1.4.
 
OP
OP
daBee

daBee

Active Member

Reaction score: 7
Messages: 190

I'm rebooting to see what shows up. OK I can't mount anything.

Code:
Port Scanning host: 192.168.1.23

    Open TCP Port:     22             ssh
    Open TCP Port:     111            sunrpc
    Open TCP Port:     908
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 6,926
Messages: 28,850

What are the errors?
 
OP
OP
daBee

daBee

Active Member

Reaction score: 7
Messages: 190

Code:
"There was a problem connecting to the server 'neb.local'.  You do not have permissions to access this server."
Used a link nfs://username:password@neb.local/home/rich/
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 6,926
Messages: 28,850

NFS doesn't use usernames/passwords.
 
OP
OP
daBee

daBee

Active Member

Reaction score: 7
Messages: 190

Tried nfs://192.168.1.23 and nfs://192.168.1.23/home/rich, both nothing.

Code:
Port Scanning host: 192.168.1.23
    Open TCP Port:     22             ssh
    Open TCP Port:     111            sunrpc
    Open TCP Port:     908
    Open TCP Port:     2049           nfsd
Port Scan has completed…
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 6,926
Messages: 28,850

Only a client with IP address 192.168.1.4 is allowed to mount it.
 
OP
OP
daBee

daBee

Active Member

Reaction score: 7
Messages: 190

Yep, that's what I'm sitting on. Is there an NFS log somewhere?

Update: Found it.

Code:
Apr 25 05:07:39 neb mountd[563]: mount request denied from 192.168.1.4 for /
Apr 25 05:07:39 neb mountd[563]: mount request denied from 192.168.1.4 for /
Apr 25 05:07:55 neb mountd[563]: mount request denied from 192.168.1.4 for /usr/home/rich
Apr 25 05:07:55 neb mountd[563]: mount request denied from 192.168.1.4 for /usr/home/rich
Apr 25 05:08:21 neb kernel: Limiting closed port RST response from 207 to 200 packets/sec
Apr 25 05:08:24 neb last message repeated 3 times
Apr 25 05:13:28 neb mountd[563]: mount request denied from 192.168.1.4 for /usr/home/rich
Apr 25 05:13:52 neb last message repeated 3 times
Apr 25 05:16:06 neb mountd[563]: mount request denied from 192.168.1.4 for /
Apr 25 05:16:28 neb last message repeated 3 times
Apr 25 08:45:56 neb mountd[563]: mount request denied from 192.168.1.4 for /
Apr 25 08:45:56 neb mountd[563]: mount request denied from 192.168.1.4 for /
Apr 25 08:46:12 neb mountd[563]: mount request denied from 192.168.1.4 for /usr/home/rich
Apr 25 08:46:12 neb mountd[563]: mount request denied from 192.168.1.4 for /usr/home/rich
Apr 25 08:47:41 neb kernel: Limiting closed port RST response from 207 to 200 packets/sec
Apr 25 08:47:59 neb last message repeated 15 times
Apr 25 08:51:36 neb mountd[563]: mount request denied from 192.168.1.4 for /
Apr 25 08:51:36 neb mountd[563]: mount request denied from 192.168.1.4 for /
Apr 25 08:51:43 neb mountd[563]: mount request denied from 192.168.1.4 for /usr
Apr 25 08:51:43 neb mountd[563]: mount request denied from 192.168.1.4 for /usr
Apr 25 08:51:47 neb mountd[563]: mount request denied from 192.168.1.4 for /usr/home
Apr 25 08:51:47 neb mountd[563]: mount request denied from 192.168.1.4 for /usr/home
Apr 25 08:51:51 neb mountd[563]: mount request denied from 192.168.1.4 for /usr/home/rich
Apr 25 08:51:53 neb last message repeated 3 times
Apr 25 08:52:31 neb mountd[563]: mount request denied from 192.168.1.4 for /
Apr 25 08:52:31 neb mountd[563]: mount request denied from 192.168.1.4 for /
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 6,926
Messages: 28,850

Try adding this flag to mountd(8):
Code:
     -n      Allow non-root mount requests to be served.  This should only be
             specified if there are clients such as PC's, that require it.  It
             will automatically clear the vfs.nfsrv.nfs_privport sysctl flag,
             which controls if the kernel will accept NFS requests from
             reserved ports only.
 
OP
OP
daBee

daBee

Active Member

Reaction score: 7
Messages: 190

Where would I put that? The only time I'm calling mountd is in rc.conf and only to turn it on.
 
OP
OP
daBee

daBee

Active Member

Reaction score: 7
Messages: 190

OK, i'm confused. I have a server and a client. The FreeBSD is the server. My OSX workstation is the client. Correct?

Two of those directives above in the first code were there. Another attempt in the morning. I appreciate all this.
 
Top