Click to See Complete Forum and Search --> : can't nfs mount between linux computers


jerbear
03-01-2004, 07:19 PM
I have 2 linux computers on a primarily Windows domain. The first one is a desktop running Red Hat 8 (kitten) and the second is a laptop with Mandrake 9.2 (3dqrd41). Both seem to be working fine and can see the network, the internet, Windows computers on the network, etc... I have a folder (/home/sharedata) on kitten that is shared to the Windows computers through Samba (no problems there). I have been trying to set up the folder as an nfs share as well so that it can be mounted on 3dqrd41.
I've used the nfs server configuration tool to set it up as a r/w share for any host (temporarily anyway - I'll restrict it if I can actually get it working!). /etc/exports now has the following line:
/home/sharedata/ *(rw,async)
Now I go to the other computer and try to set up the share. Since I want the folder mounted on boot, I have the following in /etc/fstab:
kitten.creol.ucf.edu:/home/sharedata /home/kittendata nfs ro,hard,intr 0 0

The nfs service is running on both machines, but when I try to do "mount /home/kittendata" I get an error that it failed with "reason given by server: Permission denied" /etc/hosts.allow and /etc/hosts.deny are empty on both machines. I began to wonder if there was a deeper network problem.

3dqrd41 can use smbclient and mount shares from windows computers and can even mount kitten's samba share (though that route seem a bit kludgy and I haven't had a lot of luck setting the permissions the way I want them - though I haven't spent much time on it). Also, 3dqrd41 can ping kitten without any problem. Essentially, the laptop seems to be configured properly as far as I can tell. I would have said the same about kitten prior to today (I've only had the laptop a few days now and am just getting through the network configuring). It can connect to the internet and all the windows computers as I would expect. However, when I try to "ping 3dqrd41" it immediately comes back with "unknown host 3dqrd41". I can, however, ping the ip address and get no trouble at all. I have also gone to Windows computers in the office, and they can ping both kitten and 3dqrd41 without difficulty.
I tried adding 3dqrd41 to the /etc/hosts file on kitten along with its current ip address. When I do this the laptop can mount the share. However, I'm hesitant to use this as more than a very short-term solution since we have DHCP on the network and a laptop is somewhat likely to end up with a different ip address.
/etc/resolv.conf on kitten includes the following:
search creol.ucf.edu CREOL
nameserver 132.170.160.11
nameserver 132.170.160.12
nameserver 132.170.240.15

/etc/resolv.conf on 3dqrd41 is nearly identical except that it has "local" in place of "CREOL" and has an extra line "nameserver 127.0.0.1".

Any thoughts on what the problem might be?

Thanks,
JB

happybunny
03-01-2004, 09:01 PM
i would try
service iptables stop
and try again...maybe the firewall is stopping something

sploo22
03-01-2004, 09:15 PM
Try copying resolv.conf from kitten to the other computer and see if you can ping. I don't know, that "CREOL" might be important. :)

jumpedintothefire
03-02-2004, 04:33 AM
Make sure the service portmap is running before you do the nfs mount command.

jerbear
03-02-2004, 06:11 PM
While I appreciate the suggestions thus far, none of them worked. portmap is running on both machines, iptables is off on both machines, and changing the resolv.conf didn't help any. It seems I may be stuck with the /etc/hosts fix for the time being unless anyone else can offer some help.

Thanks,
JB

Darkbolt
03-02-2004, 10:13 PM
make sure you have portmap in /etc/hosts.allow

jerbear
03-03-2004, 07:12 PM
Well, portmap is not it /etc/hosts.deny. According to what I've read anything in hosts.allow will be allowed, anything else in hosts.deny will be denied, and anything else will be allowed. Since both files are empty, it should be allowed. Also, I can mount the drive to the laptop if I have a static entry in the /etc/hosts file, which of course I am loathe to do because of dhcp.

Other thoughts?

Thanks,
JB

happybunny
03-03-2004, 11:40 PM
can you mount the nfs share with ip:/share and not use the name and have it work?

if so, that means all is working mechanically with nfs, the client just has hard time with name resolution.

If you have nothing in hosts.allow or hosts.deny, your right, allow with be allowed.

since you say this will work with an entry in the hosts file on the client, this indicates name resolution.

What is the fully qualified domain name of all the members involved?

happybunny
03-03-2004, 11:41 PM
i am re-reading your posts...it seem to absolutly be name resolution.

Again, check each clients fqd name, or when you go to mount the nfs, use the fqd name of the nfs server.

What are you using for dns?

happybunny
03-03-2004, 11:48 PM
i hate to bother you again, but i am re-re-reading your post.

I too had an issue with the permissions as too whom could access my nfs

As another test, try changing the nfs share and instead of the *, use the actual IP of the client. If this works, this will narrow down the area of the actual problem: client or server.

jerbear
03-04-2004, 06:57 PM
Thanks for the suggestions.
The laptop is 3dqrd41.creol.ucf.edu
The desktop (and nfs server) is kitten.creol.ucf.edu

I tried changing /etc/exports to use the ip address of the laptop (while leaving the ip entry out of /etc/hosts) and I am unable to mount the nfs share to the laptop. I put the entry for the laptop back into /etc/hosts and tried to mount it (ip address in /etc/exports) and it failed again. I changed /etc/exports to accept connections from 3dqrd41.creol.ucf.edu and it succeeded. When I comment out the ip address entry in /etc/hosts it fails again.

Here is an additional interesting test I just tried. The laptop has a wireless card in it. If I turn off the 100BT connection (eth0) and turn on the wireless (eth1) I can mount the nfs share so long as /etc/exports on kitten accepts connections from * or from 3dqrd41.creol.ucf.edu. It doesn't matter if there is an entry in the /etc/hosts file or not. When eth0 is activated again, the share can only be mounted if /etc/exports accepts * or the fqdname for the laptop AND /etc/hosts has the ip address of the laptop.

Time for another test. With the laptop using eth0, I tried giving /etc/hosts on the server an incorrect ip address for the laptop. This won't work. /etc/hosts has to have the correct ip address for the laptop (even with /etc/exports accepting connections from *) while the laptop is using eth0. It seems to work as it should while the laptop is using eth1 though. This is curious since the laptop has much more trouble finding other computers on the domain (for samba and other connections) while it's using the wireless since I think the wireless access points are routed in a significantly different manner (though I don't really know the layout of the network here that well).

Curiouser and curiouser!

JB