# [solved] nfs configuration help needed

## skorefish

Hello, i 'm tying to setup an nfs share.

on the server site i have open rc, on the client site systemd.

server site

```

ifconfig

enp0s19: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

inet 192.168.2.6  netmask 255.255.255.0  broadcast 192.168.2.255

exportfs -v

/export        <world>(rw,sync,wdelay,hide,crossmnt,no_subtree_check,fsid=0,sec=sys,insecure,root_squash,no_all_squash)

/export/rootDir   <world>(rw,sync,wdelay,hide,no_subtree_check,sec=sys,insecure,root_squash,no_all_squash)

Export list for 192.168.2.6:

/export/rootDir *

/export         *

vi /etc/exports

# /etc/exports: NFS file systems being exported.  See exports(5).

/export/         *(insecure,rw,sync,no_subtree_check,crossmnt,fsid=0)

/export/rootDir  *(insecure,rw,sync,no_subtree_check)

```

client site

```

mount 192.168.2.6:/export/rootDir /mnt/gentoo/ -v

mount.nfs: timeout set for Sat Jun 16 23:03:23 2018

mount.nfs: trying text-based options 'vers=4.2,addr=192.168.2.6,clientaddr=192.168.2.5'

mount.nfs: mount(2): Invalid argument

mount.nfs: trying text-based options 'vers=4,minorversion=1,addr=192.168.2.6,clientaddr=192.168.2.5'

mount.nfs: mount(2): No such file or directory

^C

or 

mount 192.168.2.6:/export/rootDir/ /mnt/gentoo/ -v

mount.nfs: timeout set for Sat Jun 16 23:21:40 2018

mount.nfs: trying text-based options 'vers=4.2,addr=192.168.2.6,clientaddr=192.168.2.5'

mount.nfs: mount(2): Invalid argument

mount.nfs: trying text-based options 'vers=4,minorversion=1,addr=192.168.2.6,clientaddr=192.168.2.5'

mount.nfs: mount(2): No such file or directory

mount.nfs: trying text-based options 'addr=192.168.2.6'

mount.nfs: prog 100003, trying vers=3, prot=6

mount.nfs: trying 192.168.2.6 prog 100003 vers 3 prot TCP port 2049

mount.nfs: prog 100005, trying vers=3, prot=17

mount.nfs: trying 192.168.2.6 prog 100005 vers 3 prot UDP port 51833

mount.nfs: mount(2): Stale file handle

mount.nfs: trying text-based options 'vers=4,minorversion=1,addr=192.168.2.6,clientaddr=192.168.2.5'

mount.nfs: mount(2): No such file or directory

mount.nfs: trying text-based options 'addr=192.168.2.6'

mount.nfs: prog 100003, trying vers=3, prot=6

mount.nfs: trying 192.168.2.6 prog 100003 vers 3 prot TCP port 2049

mount.nfs: prog 100005, trying vers=3, prot=17

mount.nfs: trying 192.168.2.6 prog 100005 vers 3 prot UDP port 51833

mount.nfs: mount(2): Stale file handle

mount.nfs: trying text-based options 'vers=4,minorversion=1,addr=192.168.2.6,clientaddr=192.168.2.5'

mount.nfs: mount(2): No such file or directory

mount.nfs: trying text-based options 'addr=192.168.2.6'

mount.nfs: prog 100003, trying vers=3, prot=6

mount.nfs: trying 192.168.2.6 prog 100003 vers 3 prot TCP port 2049

mount.nfs: prog 100005, trying vers=3, prot=17

mount.nfs: trying 192.168.2.6 prog 100005 vers 3 prot UDP port 51833

mount.nfs: mount(2): Stale file handle

mount.nfs: Stale file handle

```

Last edited by skorefish on Sun Jun 17, 2018 9:11 am; edited 3 times in total

----------

## NeddySeagoon

skorefish,

On the server itself, try the following

```
mkdir /mnt/nfstest

mount -t nfs 192.168.2.6:/export  /mnt/nfstest
```

If that fails, tell us the error. Until this works, you can't mount it anywhere else.

----------

## skorefish

 *Quote:*   

> On the server itself, try the following 

 

hm errors  (clock on server differs)

```

 mount -v -t nfs 192.168.2.6:/export  /mnt/nfstest 

mount.nfs: timeout set for Sat Jun 16 21:45:04 2018

mount.nfs: trying text-based options 'vers=4.2,addr=192.168.2.6,clientaddr=192.168.2.6'

mount.nfs: mount(2): Invalid argument

mount.nfs: trying text-based options 'vers=4,minorversion=1,addr=192.168.2.6,clientaddr=192.168.2.6'

mount.nfs: mount(2): No such file or directory

mount.nfs: trying text-based options 'addr=192.168.2.6'

mount.nfs: prog 100003, trying vers=3, prot=6

mount.nfs: trying 192.168.2.6 prog 100003 vers 3 prot TCP port 2049

mount.nfs: prog 100005, trying vers=3, prot=17

mount.nfs: trying 192.168.2.6 prog 100005 vers 3 prot UDP port 51833
```

client site

```
mount 192.168.2.6:/export /mnt/gentoo/ -v

mount.nfs: timeout set for Sat Jun 16 23:29:41 2018

mount.nfs: trying text-based options 'vers=4.2,addr=192.168.2.6,clientaddr=192.168.2.5'

mount.nfs: mount(2): Invalid argument

mount.nfs: trying text-based options 'vers=4,minorversion=1,addr=192.168.2.6,clientaddr=192.168.2.5'

mount.nfs: mount(2): No such file or directory

mount.nfs: trying text-based options 'addr=192.168.2.6'

mount.nfs: prog 100003, trying vers=3, prot=6

mount.nfs: trying 192.168.2.6 prog 100003 vers 3 prot TCP port 2049

mount.nfs: prog 100005, trying vers=3, prot=17

mount.nfs: trying 192.168.2.6 prog 100005 vers 3 prot UDP port 51833

```

on server:

```
etc/init.d/nfs restart

nfs               |nfs               | * Executing: /lib64/rc/sh/openrc-run.sh /lib64/rc/sh/openrc-run.sh /etc/init.d/nfs stop

nfs               | * Stopping NFS mountd ...

nfs               | * Will stop /usr/sbin/rpc.mountd

nfs               | * Will stop processes of `/usr/sbin/rpc.mountd'

nfs               | * Sending signal 15 to PID 3769 ...                               [ ok ]

nfs               | * Stopping NFS daemon ...

nfs               | * Will stop nfsd

nfs               | * Sending signal 2 to PID 3782 ...                                [ ok ]

nfs               | * Sending signal 2 to PID 3781 ...                                [ ok ]

nfs               | * Sending signal 2 to PID 3780 ...                                [ ok ]

nfs               | * Sending signal 2 to PID 3779 ...                                [ ok ]

nfs               | * Sending signal 2 to PID 3778 ...                                [ ok ]

nfs               | * Sending signal 2 to PID 3777 ...                                [ ok ]

nfs               | * Sending signal 2 to PID 3776 ...                                [ ok ]

nfs               | * Sending signal 2 to PID 3775 ...                                [ ok ]

nfs               | * Unexporting NFS directories ...                                 [ ok ]

nfs               |nfs               | * Executing: /lib64/rc/sh/openrc-run.sh /lib64/rc/sh/openrc-run.sh /etc/init.d/nfs start

nfs               | * Exporting NFS directories ...                                   [ ok ]

nfs               | * Starting NFS mountd ...

nfs               |rpc.mountd: svc_tli_create: could not open connection for udp6

nfs               |rpc.mountd: svc_tli_create: could not open connection for tcp6

nfs               |rpc.mountd: svc_tli_create: could not open connection for udp6

nfs               |rpc.mountd: svc_tli_create: could not open connection for tcp6

nfs               |rpc.mountd: svc_tli_create: could not open connection for udp6

nfs               |rpc.mountd: svc_tli_create: could not open connection for tcp6     [ ok ]

nfs               | * Starting NFS daemon ...                                         [ ok ]

nfs               | * Starting NFS smnotify ...
```

----------

## NeddySeagoon

skorefish,

On OpenRC you need to start the nfsclient service

```
 /etc/init.d/nfsclient start
```

or add it to the default runlevel.

With systemd, you need its similar service started.

For a working nfs mount I get

```
NeddySeagoon_Static ~ # umount /mnt/media

NeddySeagoon_Static ~ # mount -v -t nfs -o ro  192.168.100.55:/mnt/mediatomb /mnt/media

mount.nfs: timeout set for Sat Jun 16 23:01:15 2018

mount.nfs: trying text-based options 'vers=4.2,addr=192.168.100.55,clientaddr=192.168.100.20'

mount.nfs: mount(2): Invalid argument

mount.nfs: trying text-based options 'vers=4,minorversion=1,addr=192.168.100.55,clientaddr=192.168.100.20'

mount.nfs: mount(2): Invalid argument

mount.nfs: trying text-based options 'vers=4,addr=192.168.100.55,clientaddr=192.168.100.20'

mount.nfs: mount(2): Protocol not supported

mount.nfs: trying text-based options 'addr=192.168.100.55'

mount.nfs: prog 100003, trying vers=3, prot=6

mount.nfs: trying 192.168.100.55 prog 100003 vers 3 prot TCP port 2049

mount.nfs: prog 100005, trying vers=3, prot=17

mount.nfs: trying 192.168.100.55 prog 100005 vers 3 prot UDP port 42294

NeddySeagoon_Static ~ # ls /mnt/media/
```

There's no error shown in your post.

----------

## skorefish

```

/etc/init.d/nfsclient status

 * Executing: /lib64/rc/sh/openrc-run.sh /lib64/rc/sh/openrc-run.sh /etc/init.d/nfsclient status

 * status: started

mount -v -t nfs 192.168.2.6:/export  /mnt/nfstest 

mount.nfs: timeout set for Sat Jun 16 22:38:27 2018

mount.nfs: trying text-based options 'vers=4.2,addr=192.168.2.6,clientaddr=192.168.2.6'

mount.nfs: mount(2): Invalid argument

mount.nfs: trying text-based options 'vers=4,minorversion=1,addr=192.168.2.6,clientaddr=192.168.2.6'

mount.nfs: mount(2): No such file or directory

mount.nfs: trying text-based options 'addr=192.168.2.6'

mount.nfs: prog 100003, trying vers=3, prot=6

mount.nfs: trying 192.168.2.6 prog 100003 vers 3 prot TCP port 2049

mount.nfs: prog 100005, trying vers=3, prot=17

mount.nfs: trying 192.168.2.6 prog 100005 vers 3 prot UDP port 47134

```

----------

## NeddySeagoon

skorefish,

What do you see in  /mnt/nfstest?

It should be the same as /export. Its got there by being nfs mounted.

----------

## skorefish

NeddySeagoon,

it's the same, yes. And it seems to work on the client to. 

But mount  --bind / /export/rootDir/ results in

Stale file handle

ok mount -v -t nfs 192.168.2.6:/ /mnt/gentoo 

works but now i have to figure out the user rights

no_root_squash solved it

----------

