# nfs server freezes

## kwiqsilver

I have my /home directory nfs exported from one box to another (both run gentoo 1.4 installed the last week of March). When ripping CDs to the nfs mounted /home dir on the client, the nfs connection will just stop (my guess is it's the huge traffic). I can ssh, ping, and ftp between the boxes, but anything like "ls /home", or trying to log in as a normal user on the client freezes, waiting for a response from the server, I presume.

Neither box will shut down properly because of the NFS error.

I've looked through the client's /var/log directory and found nfs timeout error entries, but on the server, I can't find any log entry that helps.

Does anybody have an idea of what's going on here, or some advice to point me in the right direction?

Thanks.

----------

## plate

Resurrecting this thread with high hopes that either you have gotten it fixed by now and can tell me what's wrong, or somebody else jumps on the occasion and makes this dreadful thing go away.   :Cool: 

My problem is very similar to yours, I'm serving /usr/portage/distfiles from my main desktop as a central repository. The adjacent lesser desktop never had problems, it sees the directory as if it was on its own filesystem, but my notebook chokes on a simple emerge operation. See for yourself:

'mount /usr/portage/distfiles' works quickly and without error message. My line in /etc/fstab:

```
daimyo.zok.jp:/usr/portage/distfiles    /usr/portage/distfiles  nfs     noauto,rsize=8192,wsize=8192,timeo=14,intr      0 0

```

Output of 'df':

```
daimyo.zok.jp:/usr/portage/distfiles

                      17429852  11931296   5498556  69% /usr/portage/distfiles

```

Output of 'mount' (IP address scrambled on purpose  :Razz: ):

```
daimyo.zok.jp:/usr/portage/distfiles on /usr/portage/distfiles type nfs (rw,rsize=8192,wsize=8192,timeo=14,intr,addr=xxx.yyy.zzz.205,addr=xxx.yyy.zzz.205)

```

That's about the only anomaly I can see, two identical IP addresses at the end of that line. What happens next is that I can do 'ls /usr/portage/distfiles' and see the content of the NFS-mounted directory just fine, but when I do an emerge, this is as far as I get before it freezes:

```
emerge mm-sources

Calculating dependencies ...done!

>>> emerge (1 of 1) sys-kernel/mm-sources-2.6.0_beta3-r2 to /

```

And then it's dead. As in nothing moves. Can't even kill it with ctrl-c. If I kill the terminal session (one hell of a trick in itself), I still can't umount.

Any ideas? I've got identical NFS on both machines:

```
*  net-fs/nfs-utils

      Latest version available: 1.0.5-r1

      Latest version installed: 1.0.5-r1

      Size of downloaded files: 259 kB

      Homepage:    http://nfs.sourceforge.net/

      Description: NFS client and server daemons

```

----------

## neysx

I once had to use the nolock option when mounting nfs volumes.

Without it, the only way out was to kill rpciod from another console. Ctrl-C would not work.

Simply add nolock in the list of options in your fstab or add it on your cmd line mount -o rw,nolock....

From the depths of my memory I think you need portmap to be started before you mount anything, but the scripts do handle that properly, don't they ?

I am not using it anymore and I also share my distfiles across several machines and also have a home-built cluster of C3 with root-over-nfs and have no problem with nfs.

Hth.

----------

## plate

Thanks! Much luckier with nolock. Haven't tried it on a heavier package yet, but emerge does MD5 checksums and unpacks files from a remote NFS-mounted /usr/portage/distfiles now. I suspect this has something to do with my WLAN card in the notebook, since I don't need nolock on the other desktop.

Speaking about scripts, all I have in /etc/runlevels/default is nfs. Any idea what nfsmount and netmount could be needed for?

----------

## neysx

 *plate wrote:*   

> Thanks! Much luckier with nolock. Haven't tried it on a heavier package yet, but emerge does MD5 checksums and unpacks files from a remote NFS-mounted /usr/portage/distfiles now. I suspect this has something to do with my WLAN card in the notebook, since I don't need nolock on the other desktop.
> 
> Speaking about scripts, all I have in /etc/runlevels/default is nfs. Any idea what nfsmount and netmount could be needed for?

 

Glad I could help.

/etc/init.d/nfs is to start the nfs server

/etc/init.d/nfsmount will only mount nfs volumes referenced in fstab and load portmap (need portmap in dependencies) automatically

/etc/init.d/netmount will mount all network fs (coda,nfs,ncpfs,smbfs) referenced in fstab but not nfs if portmap has not been started beforehand. Actually it does load portmap if you have nfs mount points that should be automounted (i.e. not with option noauto)

Your problem might be that you are mounting your nfs distfiles from the command line and portmap had not been started.

----------

## plate

Thanks for wrapping this up for me. When it comes to NFS I have this mental block, possibly due to my first job assignment more than a decade ago when our Unix sysadmin struggled with an obscure PC-NFS (and lost, mostly).   :Laughing: 

 *undeuxtroisout wrote:*   

> Your problem might be that you are mounting your nfs distfiles from the command line and portmap had not been started.

 

I find that rather unlikely because I stopped and started all services manually before testing it again, and still had the exact same error. Never mind, nolock did the trick.

----------

## plate

Or so I thought.   :Crying or Very sad:  Apparently it's rather picky about what works and what doesn't. Emerging the world today worked just fine for the first three packages from the NFS-mounted /usr/portage/distfiles directory (bash, elfutils, prelink), but stalled on the fourth: 

```
>>> emerge (4 of 5) sys-kernel/mm-sources-2.6.0_beta3-r3 to / 
```

is the last line that gets displayed before the xterm hangs.

Any idea why it's the kernel sources it chokes on? Size? The biggest tarball is 33 MB... Permissions? They're all identical 644. Coincidence? No error has been logged on either machine, by the way, just a successful rpc.mountd message stating that there's been an authenticated mount request, half an hour earlier (before I started the emerge).  I'm really scratching my head over this one.   :Shocked: 

----------

## neysx

It would be nice to know if it is your client or your server which causes problems. Is your other box able to see your /usr/portage/distfiles through NFS after this one hangs ?

Have you checked with another kernel ? net card kernel options ?

Have tried to export some directory from your other box to connect to it ?

Your problem could be linked to your WLAN card.

Maybe you could try the following options when mounting:

rsize=1024,soft,timeo=75,retrans=1

to reduce to block size which migh be a good idea on error-prone net and to have timeouts faster if they occur

If all fails with NFS, could you try smbfs ?

I could not help with samba, I am not using it as I live in a 100% windown-free environment.

----------

## plate

Hey, you're my new hero. Next time I'm in Groningen prepare for a drink or two.  :Very Happy: 

Must be the WLAN connection, I suppose. Tuning NFS down to the settings you suggested did it - took forever and had me worried for a bit, but worked. What do you think, is that because of "soft" instead of "intr", the reduced rsize/wsize or the timeout?

In any case, thanks a lot. In the long run that doesn't save me from putting Samba on this machine, too, though: Even our FreeBSD fileservers run Samba, so why shouldn't I...   :Razz: 

----------

## neysx

Glad I could help.

A smaller rsize means less chance of corrupted packets and those that need to be resent are smaller and timeouts being detected faster means less lost time.

http://www.sallyobriens.nl/groningenindex.htm is the place  :Wink: 

Looks like you are based in a great location yourself.

----------

## TheCoop

thanks, this solved the problem of my entire wireless connection locking up when i tried to use nfs, specifically /usr/portage/distfiles and /media (music files) mounted over nfs. Thanks!

----------

