Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986
Rep:
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 ...
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)
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986
Rep:
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?
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_ubject_r:bin_t:s0 bin
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986
Rep:
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.