LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   nfs times out (https://www.linuxquestions.org/questions/ubuntu-63/nfs-times-out-696186/)

comforteagle 01-09-2009 05:15 PM

nfs times out
 
I'm trying to get nfs running on two ubuntu intrepid machines

following the instructions here:
http://czarism.com/easy-peasy-ubuntu...s-file-sharing

is there any reason, with iptables flushed!!! & being able to telnet -ports 111, 2049, to the server from client , that I should get:
Code:

mount.nfs: mount to NFS server '10.252.99.223' failed: timed out, retrying
mount.nfs: mount to NFS server '10.252.99.223' failed: timed out, giving up


I cannot find an answer explaining this.

dkm999 01-09-2009 10:35 PM

In order to get another machine to respond to your NFS mount request, that machine must be running a daemon named nfsd. On many systems, this is not started by default, so unless you have made a change to the default configuration for this daemon, it is probably not running.

To find out, on the target machine, do this:
Code:

#netstat -atnp
Check that the daemon rpcbind is listening on TCP port 111. Then check that nfs daemon threads are running:
Code:

#ps aux|grep nfsd
There should be several lines indicating that nfs daemon threads are running (in the kernel).

If these are not running, you have found your problem. Start them up:
Code:

#/etc/init.d/nfs start
and then do whatever configuration your machine supports to make nfs start up on boot. This might be a graphical UI to configure services, or it might be a command-line sequence. My preference is to use the command-line chkconfig style of daemon control, but then I am an unreconstructed old codger.

If these services are already running, you should check the file /etc/exports on the target machine to make sure that it is willing to offer the part of the file system you are looking for as an NFS export. If you change the contents of this file, remember to let the system know about it:
Code:

#exportfs -a

comforteagle 01-10-2009 07:51 AM

thanks, but not it. yet.
 
Quote:

Originally Posted by dkm999 (Post 3403174)
In order to get another machine to respond to your NFS mount request, that machine must be running a daemon named nfsd. On many systems, this is not started by default, so unless you have made a change to the default configuration for this daemon, it is probably not running.

To find out, on the target machine, do this:
Code:

#netstat -atnp
Check that the daemon rpcbind is listening on TCP port 111. Then check that nfs daemon threads are running:
Code:

#ps aux|grep nfsd
There should be several lines indicating that nfs daemon threads are running (in the kernel).

If these are not running, you have found your problem. Start them up:
Code:

#/etc/init.d/nfs start
and then do whatever configuration your machine supports to make nfs start up on boot. This might be a graphical UI to configure services, or it might be a command-line sequence. My preference is to use the command-line chkconfig style of daemon control, but then I am an unreconstructed old codger.

If these services are already running, you should check the file /etc/exports on the target machine to make sure that it is willing to offer the part of the file system you are looking for as an NFS export. If you change the contents of this file, remember to let the system know about it:
Code:

#exportfs -a

Thanks you so much for taking the time to reply with such detail!

netstat -atnp|grep 111
reveals: tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 4588/portmap

Also, ps aux|grep nfs reveals:
Code:

root    17094  0.0  0.0  7496  828 pts/0    S+  13:45  0:00 grep nfs
root    31521  0.0  0.0      0    0 ?        S<  02:36  0:00 [nfsd4]
root    31522  0.0  0.0      0    0 ?        S    02:36  0:00 [nfsd]
root    31523  0.0  0.0      0    0 ?        S    02:36  0:00 [nfsd]
root    31524  0.0  0.0      0    0 ?        S    02:36  0:00 [nfsd]
root    31525  0.0  0.0      0    0 ?        S    02:36  0:00 [nfsd]
root    31526  0.0  0.0      0    0 ?        S    02:36  0:00 [nfsd]
root    31527  0.0  0.0      0    0 ?        S    02:36  0:00 [nfsd]
root    31528  0.0  0.0      0    0 ?        S    02:36  0:00 [nfsd]
root    31529  0.0  0.0      0    0 ?        S    02:36  0:00 [nfsd]

So that's running.

/etc/exports contents:
Code:

/mnt/testing 10.252.174.175(rw,sync,no_root_squash,no_subtree_check)
seems fine.

I've also
exportfs -a, and restarted both nfs-kernel-server & nfs-common services, to no avail.

Further I've added the client machine to the server's /etc/hosts file, just in case.

Result: timed out, failed.

Now what? (Thanks for your help!)

dkm999 01-10-2009 01:15 PM

The mystery deepens.

I guess the next things I would look at are these:
1. Is mountd running on your client machine? (It may be called rpc.mountd).
2. Are there any complaints in the syslog (probably /var/log/messages)?

If mountd is running, and there are no relevant complaints, I guess that the next step might be to try to trace the interaction using tcpdump, so that we can see where the transaction breaks down. In case you are not familiar with this program, it will trap selected IP packets and report them for you. In this case, I would first set it up on the client machine
Code:

# tcpdump -nn -xX -s 256 host 10.252.99.223
When you attempt the mount, the result should be a sequence of packet exchanges between your client and the server. If, as I guess, there is only one packet trapped, then go to the server, and repeat the experiment there, to see what the server is actually seeing (of course, you will have to change the address in the tcpdump command to trap interactions with the client). It is possible that the packets are not actually going where you expect them to go, and that the server is not seeing them. This would cause the timeout for certain.

Good luck.

fragos 01-10-2009 02:45 PM

Here's the setup that works for me:

I use NFS between my Desktop and Laptop as my server. Both being on the same LAN. On the server there must be an /etc/exports with the following. Replace the fields in {} with your information. In my example I'm giving access to the entire home folder tree. This scheme works with any mix of 8.04 and 8.10. There can be multiple entries giving more clients permission.

/home/{Laptop user} {Desktop hostname}.local(rw)

This allows the Desktop to access the home folder of the laptop. Prior to Ubuntu 8.04 you need to run "sudo exportfs -rv" for the system to read /etc/exports. New versions do this for you at boot.

On the Desktop create a folder to mount to. In my case I placed that folder in my home folder.

On the Desktop side I run

sudo mount {Laptop hostname}.local:/home/{Laptop user} /home/{Desktop user}/{folder to mount to}

To un-mount I run

sudo umount {Laptop hostname}.local:/home/{Laptop user} /home/{Desktop user}/{folder to mount to}

You can extrapolate what to do from this working example. I chose not to use fstab to mount and wrote a couple of bash scripts that supply the parameters to the mount and umount commands.


All times are GMT -5. The time now is 11:17 PM.