Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] nfs configuration help needed
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
skorefish
Apprentice
Apprentice


Joined: 21 Jun 2015
Posts: 285

PostPosted: Sat Jun 16, 2018 9:00 pm    Post subject: [solved] nfs configuration help needed Reply with quote

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

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

server site
Code:

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
Code:

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
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54220
Location: 56N 3W

PostPosted: Sat Jun 16, 2018 9:19 pm    Post subject: Reply with quote

skorefish,

On the server itself, try the following

Code:
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.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
skorefish
Apprentice
Apprentice


Joined: 21 Jun 2015
Posts: 285

PostPosted: Sat Jun 16, 2018 9:32 pm    Post subject: Reply with quote

Quote:
On the server itself, try the following


hm errors (clock on server differs)
Code:

 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

Code:
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:
Code:
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 ...
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54220
Location: 56N 3W

PostPosted: Sat Jun 16, 2018 10:03 pm    Post subject: Reply with quote

skorefish,

On OpenRC you need to start the nfsclient service
Code:
 /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
Code:
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.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
skorefish
Apprentice
Apprentice


Joined: 21 Jun 2015
Posts: 285

PostPosted: Sat Jun 16, 2018 10:32 pm    Post subject: Reply with quote

Code:

/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
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54220
Location: 56N 3W

PostPosted: Sat Jun 16, 2018 10:37 pm    Post subject: Reply with quote

skorefish,

What do you see in /mnt/nfstest?
It should be the same as /export. Its got there by being nfs mounted.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
skorefish
Apprentice
Apprentice


Joined: 21 Jun 2015
Posts: 285

PostPosted: Sun Jun 17, 2018 6:53 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum