Originally posted by iJed:
I've tried everything given here and still I can't seem to get NFS to work. I'm beginning to think there may be some problem with the NFS server on my Linux box so I may try reinstalling it. I also had the intention of moving my Linux box to Slackware 9 at some point so I may just wait until I do that.
Thanks everyone for your help.
It is very unlikely that it is the fault of your Red Hat 8 server... because you can mount the shares just fine on another Linux client. Aside from that... I have been using NFS from Linux (Red Hat in particular) to Mac OS X boxes for years and have never had a problem.
There are several key things to this issue some of which are higlighted by the result you get when trying to mount the share:
1. Is the line on your Mac OS X client in your /etc/hostconfig file set to:
RPCSERVER=-YES-
?
If not change it and reboot.
2. What do you get in response to the command:
rpcinfo -p localhost
?
If you get something like:
rpcinfo: can't contact portmapper: RPC: Remote system error - Connection refused
then your portmapper is not running. You will need to start it. It should have started automatically if you completed step 1. above. To start it manually:
sudo /usr/sbin/portmap
THEN try the command:
rpcinfo -p localhost
You should now get the response:
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
If not then there is something wrong with your Mac OS X client. It is very important that the portmapper works... without it you will not be able to mount NFS shares.
4. If portmap works then the next step is to make sure that firewalling is OFF on both the Mac OS X client and the Linux server. To turn it off on Mac OS X consult the documentation that came with your firewall software.
To turn it off in RedHat Linux (as root):
/sbin/service iptables stop
This should be fairly "safe" since you are on a private subnet and I assume it is firewalled from the big bad internet at the router (or wherever).
5. Clean up your /etc/exports file on the Linux server... make it look like this:
/usr/netshare 192.168.0.0/255.255.255.0(rw)
/pub 192.168.0.0/255.255.255.0(ro,all_squash)
The "insecure" setting is not neccessary.
6. Make sure that /pub has at least permissions drwxr-xr-x on the server (the d just means it is a directory) Check with:
ls -l /
If not then:
chmod 0755 /pub
and check again.
7. Make sure that /usr/netshare has at least permissions drwxrwxrwx on the server:
ls -l /usr
I would recommend that you set it to
drwxrwxrwt (the t is for the "sticky bit"). Using the sticky bit enables your users to save files and prevents others from deleting them. Like this:
chmod 1777 /usr/netshare
8. Re-export the shares.... either:
exportfs -r
or
/sbin/service nfs restart
from the Linux server.
9. Try mounting one of the shares from a Mac OS X client:
mount_nfs -P 192.168.0.10:/pub /mountpoint
where /mountpoint is some dir you created on the Mac OS X client. This is assuming the IP address of the Linux server is 192.168.0.10.
Does that work? Can you do:
ls -l /mountpoint
?
on the client and see what is in /pub on the server? Do you still get the portmap error on the client?
10. If it mounts OK you can check with this command on the client:
mount
It should report something like this:
192.168.0.10:/pub on /mountpoint type nfs (ro,addr=192.168.0.10)
You can also check on the Linux server what is exported and to where with:
cat /proc/fs/nfs/exports
it will list all clients that are currently mounting the exported shares.
11. Last but not least.... as a further troubleshooting tool you can follow this on the server by running the command (as root in a terminal):
tail -f /var/log/messages
(use Ctrl-C to quit).
You should see something like this:
Jun 19 11:29:41 localhost rpc.mountd: authenticated mount request from 192.168.0.5:618 for /pub (/mountpoint)
If for some reason it does NOT work you may see something like this:
Jun 19 11:32:49 localhost portmap[21206]: connect from 192.168.0.5 to getport(nfs): request from unauthorized host
Do you see anything while trying to mount/umount the shares? If so, what?
The tail -f /var/log/messages command is very useful when troubleshooting things on the Linux server side. You should have a terminal open either on the client (to the server via ssh) or directly on the server with that command running all the time while setting these things up.
Once you get this little problem out of the way you may want to try using NIS on the server and clients to clear up permissions problems you will almost certainly run into with shares exported/mounted read-write.
See:
http://bresink.de/osx/nis.html for an excellent HOWTO on that topic.