# NFS -- Connection Refused

## Evilguru

I am trying to share a few directories on my Debian machine with my Gentoo machine. Not too hard, I thought. So on my Debian computer I apt-get'ed all of the packages needed and set my /etc/exports to be:

```

# /etc/exports: the access control list for filesystems which may be exported

#               to NFS clients.  See exports(5).

/usr 192.168.0.2(async,no_subtree_check,rw)

```

And rebooted. On my Gentoo (192.168.0.2) machine I installed nfs-utils and did

```

genware / # /etc/init.d/portmap start

 * Caching service dependencies ...                                                    [ ok ]

 * Starting portmap ...                                                                [ ok ]

```

Now I tried (as root):

```

genware freddie # mount 192.168.0.4:/usr /home/freddie/Test

mount: RPC: Remote system error - Connection refused

```

I have no idea what is wrong, or what is causing it. The nfs article on the gentoo wiki did not really help, and neither did google. So, does anyone have any ideas about what it could be? Or more importantly, what I can do to fix it?

Thanks for all of your help, Freddie.

----------

## avendesora

This might sound stupid, but are all the NFS / RPC services started on the server (debian)?

Do you have a firewall running on either machine that could block NFS traffic?

----------

## Evilguru

I am quite sure that the server is running, just to make sure I did:

```

slugserv:/etc/init.d# ./nfs-common restart

Stopping NFS common utilities: statd.

Starting NFS common utilities: statd.

slugserv:/etc/init.d# ./nfs-kernel-server restart

Stopping NFS kernel daemon: mountd nfsd.

Unexporting directories for NFS kernel daemon...done.

Exporting directories for NFS kernel daemon...done.

Starting NFS kernel daemon: nfsdslugserv:/etc/init.d# ./portmap restart

Stopping portmap daemon: portmap.

Starting portmap daemon: portmap.

slugserv:/etc/init.d#
```

and on my client (gentoo) pc I did

```

genware freddie # /etc/init.d/portmap restart

 * Saving portmap table ...                                                            [ ok ]

 * Stopping NFS mountd ...                                                             [ ok ]

 * Stopping NFS daemon ...                                                             [ ok ]

 * Unexporting NFS directories ...                                                     [ ok ]

 * Stopping NFS statd ...                                                              [ ok ]

 * Unmounting RPC pipefs ...                                                           [ ok ]

 * Stopping portmap ...                                                                [ ok ]

 * Starting portmap ...                                                                [ ok ]

 * Reloading portmap table ...                                                         [ ok ]

 * Mounting RPC pipefs ...                                                             [ ok ]

 * Starting NFS statd ...                                                              [ ok ]

 * Starting NFS daemon ...                                                             [ ok ]

 * Starting NFS mountd ...                                                             [ ok ]

```

But when I try to mount I still get the same error.

There are no firewalls or anything like that between the two computers.

----------

## Evilguru

Through the process of elimination I have concluded that it is the server that it at fault. On my Gentoo PC I decided to make a share of /home/freddie for 192.168.0.5 (an old Ubuntu PC). Then ssh'ed into the Ubuntu PC and mounted it, worked fine (so I know that the ubuntu pc is cool with mounting nfs shares). Then, on the same PC I tried to mount the share on my Debian PC, guess what? Connection refused with the RPC error like thing.

So, while this is probably not the right place to be asking anymore (afterall the problem is with Debian), I would be very grateful if you could still have a go at helping me as that Debian lot scare the pants off of me!

----------

## Gooserider

This is ancient, and hopefully you've solved the problem by now, but I just had a similar problem and found a solution that wasn't very obvious from the symptoms.  I thought it would be worth mentioning it for the benefit of anyone searching the forums for NFS solutions.

Apparently some distro's have the portmapper configured by default to only listen to "localhost"   :Twisted Evil:  This means that you can start everything and it looks fine on the server, but if you try to connect from the client and mount the file system, or even see what file systems are available, you get "RPC: Connection Refused" errors.

The solution is to find the portmap configuration file (this can be a challenge, as config files are one of the things that different distro's put in different places   :Rolling Eyes:  ) on the server, and probably it wouldn't hurt to double check it on the client, and make sure there isn't a line in there that mentions localhost or 127.0.0.1.  If there is, just comment it out, there doesn't seem to be a need for a different line, and then restart the portmapper.

I wrote a slightly more detailed blurb on this in the NFS Gentoo Wiki article.

Gooserider

----------

