NFS will not mount

I'm having issues with NFS, it was working fine, and then suddenly stopped. I can't mount the NFS shares any more, I'be goofing around for hours now but can't figure out why it's not working.

Whenever I try to mount I get these messages:
Code:
[tcp6] localhost:/usr/ports: RPCPROG_NFS: RPC: Remote system error - Protocol not supported
[tcp] localhost:/usr/ports: Permission denied
[tcp] localhost:/usr/ports: Permission denied

Even with this simple /etc/exports file it doesn't work anymore:
Code:
/usr/ports/ -ro

I've got this in /etc/rc.conf
Code:
rpcbind_enable="YES"
nfs_client_enable="YES"
nfs_server_enable="YES"
nfs_server_flags="-u -t -n 20"
nfs_reserved_port_only="YES"
mountd_flags="-r"

Still looks like it's exported though
Code:
# showmount -e
Exports list on localhost:
/usr/ports/                        Everyone

In /var/messages I get these errors:
Code:
Jul  2 10:34:45 kitbuild001 mountd[486]: mount request denied from 127.0.0.1 for /usr/ports
Jul  2 10:35:22 kitbuild001 last message repeated 2 times

I can't mount these shares from other servers or even localhost:
Code:
mount -o tcp localhost:/usr/ports test
[tcp6] localhost:/usr/ports: RPCPROG_NFS: RPC: Remote system error - Protocol not supported
[tcp] localhost:/usr/ports: Permission denied
[tcp] localhost:/usr/ports: Permission denied

I know you're not supposed use symlink in the path and stuff so I've checked for that. I've tried sharing different directories and etc. I don't think it's really a permission problem either, but who knows...

Please help, it's driving me nuts!
 
I've done that (and restarted nfsd as well, rebooted, reloaded the exports file (/etc/mountd onereload). Nothing did anything.
 
First path in an exports entry must be a file system mount point, not any random directory.
For you case to work, /usr/ports must be by itself a separate file system.
Instead, you may use something like:
/usr /usr/ports -ro
assuming /usr is a separate file system (which usually is).
Read man page for exports.
After modifying /etc/exports, you don't really need to restart mountd.
You can simply run this command as root:
kill -HUP `cat /var/run/mountd.pid`
 
First path in an exports entry must be a file system mount point, not any random directory.
That's incorrect, it's not necessary to share an entire filesystem, that would be inconvenient. Besides it was working before w/o needing to put the /usr in front. What you cannot do however is have several lines sharing the same directory. Anyways, I tried just to be safe, but still samme error.
After modifying /etc/exports, you don't really need to restart mountd.
I don't, I just reload the config
Code:
/etc/rc.d/mountd onereload
So I'm still stuck...
 
I assume you're just testing setup locally with nfs client & server on same physical box.

Try
Code:
rpcinfo -s 127.0.0.1
you should see services: rpcbind, mountd, nfs, nlockmgr (and probably status too, though I'm not certain it's required for nfs)

Also check TCP wrappers to make sure you're not blocking the traffic in /etc/hosts.allow and verify entry in /etc/hosts

You're not blocking traffic in the firewall somehow are you?

Stick with dotted decimal IP addresses.

My /usr/ports is owned by root:wheel. Not sure about yours. I'm not sure I would export something owned by root. Maybe for easier debugging try and export your own home directory. It should be owned by you. In /etc/exports
Code:
/home        -alldirs        127.0.0.1
If you can mount your own home then maybe you've got permission issues with ports tree.

And consider changing your mount point as kiyolee suggested.

When you get it running and involve more than 1 box, double-check uid numbers match on both/all boxes. I think this is still a requirement, though if not, someone will likely correct the statement.
 
It's working again - for some reason. I haven't really changed anything. Rebooted a couple of times, restarted nfsd, mountd and rpcbind...and it's working. Kinda annoying really since I don't know what caused the problem.

Anyhow, the exports line looks like this now, and yes, working :)
Code:
/usr/src /usr/obj /usr/ports -ro -maproot=root -network 10.0.0.0 -mask 255.0.0.0

Thanks for all the help/suggestions!

qsecofr: You're right, rpcbind, mountd, nfs is running, but not nlockmgr
 
Back
Top