# Loosing NFS connection

## Raniz

I'm running a local server with a number of directories that I share via NFS.

Though, after a couple of minutes all my shares stop working and I have to remount them.

What could be causing this?

----------

## mayday147

You will have to post more details, like your logger messages and stuff.

----------

## Raniz

Where can I find my logs?

----------

## Raniz

Don't know if the output from nfsstat can help:

```
Server rpc stats:

calls      badcalls   badauth    badclnt    xdrcall

125613     843291     0          843291     0

Server nfs v2:

null       getattr    setattr    root       lookup     readlink

0       0% 9008    7% 6495    5% 0       0% 8004    6% 2       0%

read       wrcache    write      create     remove     rename

1066    0% 0       0% 53396  42% 1160    0% 57      0% 0       0%

link       symlink    mkdir      rmdir      readdir    fsstat

0       0% 0       0% 132     0% 0       0% 397     0% 45896  36%

Server nfs v3:

null       getattr    setattr    lookup     access     readlink

0       0% 0       0% 0       0% 0       0% 0       0% 0       0%

read       write      create     mkdir      symlink    mknod

0       0% 0       0% 0       0% 0       0% 0       0% 0       0%

remove     rmdir      rename     link       readdir    readdirplus

0       0% 0       0% 0       0% 0       0% 0       0% 0       0%

fsstat     fsinfo     pathconf   commit

0       0% 0       0% 0       0% 0       0%

Client rpc stats:

calls      retrans    authrefrsh

0          0          0

Client nfs v2:

null       getattr    setattr    root       lookup     readlink

0       0% 0       0% 0       0% 0       0% 0       0% 0       0%

read       wrcache    write      create     remove     rename

0       0% 0       0% 0       0% 0       0% 0       0% 0       0%

link       symlink    mkdir      rmdir      readdir    fsstat

0       0% 0       0% 0       0% 0       0% 0       0% 0       0%

Client nfs v3:

null       getattr    setattr    lookup     access     readlink

0       0% 0       0% 0       0% 0       0% 0       0% 0       0%

read       write      create     mkdir      symlink    mknod

0       0% 0       0% 0       0% 0       0% 0       0% 0       0%

remove     rmdir      rename     link       readdir    readdirplus

0       0% 0       0% 0       0% 0       0% 0       0% 0       0%

fsstat     fsinfo     pathconf   commit

0       0% 0       0% 0       0% 0       0%
```

----------

## mayday147

 *Raniz wrote:*   

> Where can I find my logs?

 

/var/log/messages or /var/log/everything/current .

----------

## gymer

Try using nfs v3 instead of v2

----------

## Raniz

Here's the most recent about nfs in /var/log/messages:

```
Dec 21 18:02:38 Megatron nfs_statfs: statfs error = 5

Dec 21 18:02:40 Megatron nfs_statfs: statfs error = 5

Dec 21 18:02:42 Megatron nfs_statfs: statfs error = 5
```

How do I change to V3?

----------

## mayday147

 *Raniz wrote:*   

> How do I change to V3?

 

From the kernel , I guess.

----------

## gymer

make sure your kernels are compiled with v3 support.

Then mount them with v3 see man mount

or put them in your fstab like

```

defaults,rsize=8192,wsize=8192,hard,vers=3,lock

```

thats how i mount mine

----------

## Raniz

V3 changed nothing... But I found some more messages in my log:

```
Dec 22 01:33:59 Megatron RPC: garbage, exit EIO

Dec 22 01:33:59 Megatron nfs_statfs: statfs error = 5

Dec 22 01:34:01 Megatron RPC: garbage, exit EIO

Dec 22 01:34:01 Megatron nfs_statfs: statfs error = 5

Dec 22 01:34:03 Megatron RPC: garbage, exit EIO

Dec 22 01:34:03 Megatron nfs_statfs: statfs error = 5
```

----------

## endu

i have a simillar issue with NFS

i have a fileserver and i mount a share with MP3s to listen to them. after 1-30 minutes i see in dmesg of the client multiple of the following entries

```
RPC: garbage, exit EIO

RPC: garbage, exit EIO

RPC: garbage, exit EIO

RPC: garbage, exit EIO
```

and the connection gets lost. i have to remount it. on the server, i didn't notice anything special in the logs.

i'm using the kernel linux-2.6.9-gentoo-r13 on the client and linux-2.6.8-gentoo-r10 on the server side.

the share is mounted like this:

```
lush:/mnt/disks/5 on /mnt/disks/5 type nfs (rw,noatime,rsize=8192,wsize=8192,hard,vers=3,nolock,addr=192.168.1.6)
```

does someone has a hint to find out the cause of this?

----------

## Raniz

I don't know what solved it... But it's gone now...

Could be the upgrade of nfs-utils.

----------

