LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Trouble mounting nfs file system (https://www.linuxquestions.org/questions/linux-server-73/trouble-mounting-nfs-file-system-603668/)

bbyoung 12-01-2007 12:18 AM

Trouble mounting nfs file system
 
When I try to do an nfs mount I always get a message that the connection is refused. See the mount command output below.

[root@hostname ~]# mount -v hostname.my.local:/backup /media/backupdir
mount: no type was given - I'll assume nfs because of the colon
mount: trying 192.168.151.20 prog 100003 vers 3 prot tcp port 2049
mount: Unable to connect to 192.168.151.20:2049, errno 111 (Connection refused)
mount: mount to NFS server 'hostname.my.local' failed: System Error: Connection refused.

I think I have the nfs server configured correctly, but cannot figure out why the mount is failing. I'm client and server on the same machine, so I'm not even leaving my own workstation on the network. A tcpdump on lo interface shows the portmapper request and returns a tcp/2049 port reply. Next I see the SYN frame to initiate the tcp/2049 connection and then a RST,ACK from the server in response to this SYN frame. I can't figure out why the server process will not accept the TCP connection. What am I missing?

Micro420 12-01-2007 01:59 AM

what distro are you using? any firewalls running? do you have RPC packages installed? Do you have NFS packages installed? What does /etc/exports say? showmount -e? /etc/services? There are a lot of things to check. This is like asking why won't your car start ...

bbyoung 12-01-2007 09:05 AM

Sorry about lack of info. Let me try to answer the questions you pose.
Distro=fedora 7, no firewalls, RPC and NFS packages are installed

rpcbind, rpc.statd, rpc.mountd, rpc.quotad, nfsd, and nfsd4 processes are running

nfsd, exportfs, lockd, nfs_acl, auth_rpcgss, and sunrpc kernel modules are loaded.

/etc/exports files has only the following line:
/backup # -sync *(rw) # hostname.my.local(rw) hostname.my.local(rw)
Note I've tried many different exports file options and have finally added the # to comment the remainder of the line in order to just take defaults for troubleshooting.

showmount -e is:
Export list for hostname.my.local:
/backup *

exportfs -v output:
[root@hostname ~]# exportfs -v
exportfs: No host name given with /backup (ro,sync,wdelay,hide,nocrossmnt,secure,root_squash,no_all_squash,no_subtree_check,secure_locks,acl,a nonuid=65534,anongid=65534), suggest *(ro,sync,wdelay,hide,nocrossmnt,secure,root_squash,no_all_squash,no_subtree_check,secure_locks,acl, anonuid=65534,anongid=65534) to avoid warning
/backup <world>(ro,wdelay,root_squash,no_subtree_check)

ls -ld /backup /media/backupdir
drwxrwxrwx 2 root root 4096 2007-11-30 20:46 /backup
drwxr-xr-x 2 root root 4096 2007-11-30 22:26 /media/backupdir

rpcinfo -p output:
program vers proto port service
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
100000 4 0 111 portmapper
100000 3 0 111 portmapper
100000 2 0 111 portmapper
100011 1 udp 717 rquotad
100011 2 udp 717 rquotad
100011 1 tcp 720 rquotad
100011 2 tcp 720 rquotad
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100005 1 udp 32848 mountd
100005 1 tcp 34920 mountd
100005 2 udp 32848 mountd
100005 2 tcp 34920 mountd
100005 3 udp 32848 mountd
100005 3 tcp 34920 mountd
100024 1 udp 32849 status
100024 1 tcp 45615 status

Hopefully this is more detailed info to assist in answering the question.

Thanks for your response.

Micro420 12-01-2007 11:31 AM

Do you happen to be using SELinux? ls -lZ /backup? What does /var/log/messages say after the connection is refused? You're trying to connect another machine, right? Not your localhost?

bbyoung 12-01-2007 06:04 PM

Not sure about SELinux, but I think I may be using it. Seem to recall it was a default selection during the install. Also there is a /selinux dir and doing ls -lZ /backup lists extra information that I'm not familiar with

I have mostly been attempting connections from/to the localhost using the fqdn (not host localhost), but have made one attempt from a separate hosts with the same results. As for name resolution, no DNS just /etc/hosts files. This question is interesting, though. NFS "should" be able to connect on the same host as well as external hosts shouldn't it? Aren't the client and server daemons separate?

Nothing interesting at all in /var/log/messages from the connection, but there is a message when nfs starts that I haven't been able to figure out either.
/var/log/messages snippet:
Dec 1 00:00:59 hostname nfsd[3934]: nfssvc: writing fds to kernel failed: errno 98 (Address already in use)
Dec 1 00:00:59 hostname nfsd[3934]: nfssvc: writing fds to kernel failed: errno 98 (Address already in use)


ls output below:
[root@hostname ~]# ls -lZ /backup
-rw-r--r-- root root testfile

[root@hostname ~]# ls -lZ /
drwxrwxrwx root root backup
drwxr-xr-x root root system_u:object_r:bin_t:s0 bin

...

rwxr-x--- root root system_u:object_r:default_t:s0 root
drwxr-xr-x root root system_u:object_r:bin_t:s0 sbin
drwxr-xr-x root root system_u:object_r:file_t:s0 selinux

...

drwxr-xr-x root root system_u:object_r:usr_t:s0 usr
drwxr-xr-x root root system_u:object_r:var_t:s0 var

Thank you again for continuing to help me with this.

bbyoung 12-01-2007 10:00 PM

I did some research on SElinux. Yes it's installed, but it's disabled.

[root@hostname /]# sestatus -v
SELinux status: disabled

Micro420 12-01-2007 10:40 PM

I honestly have no idea what else the problem could be. So you are sure the firewall is off? What does iptables -L show? /media/backupdir is empty, right? Anything in your /etc/hosts.deny file?

I've never done a localhost NFS mount so I'm not sure if it works or not.

bbyoung 12-03-2007 08:25 PM

KERNEL PROBLEM!!!!

Rebooted back to my previous kernel and everything is fine. I haven't used NFS in my job because of the real and perceived security issues. I have used NFS but it's been several years since I last used it. I knew I wasn't a complete idiot, though.

Kernel version 2.6.23.1-10 from the FC7 package kernel.x86_64.2.6.23.1-10.fc7 seems to have nfs broken. I went back to kernel version 2.6.22.9-91 and after a quick look nfs appears to be working. I'll do more testing of course. Should have known better than to update to a cutting edge kernel.

Again thanks for taking the time to converse and help.


All times are GMT -5. The time now is 11:42 AM.