LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-19-2018, 11:10 AM   #1
LeFrnk
LQ Newbie
 
Registered: Sep 2018
Posts: 2

Rep: Reputation: Disabled
NFS4 does (not) mount locally depending on multiple entries in /etc/exports


I have a /etc/exports on a machine 192.168.122.1 like this:
Code:
/mnt/platte 192.168.122.0/24(rw,sync,no_root_squash,no_subtree_check,fsid=0) 127.0.0.1(rw,sync,no_root_squash,no_subtree_check)
So, from client 192.168.122.2 I can mount the 192.168.122.1:/ share. Works. (See / cause of fsid=0)

But locally, on the nfs server machine 192.168.122.1 I cannot mount 127.0.0.1:/mnt/platte

Code:
# mount -t nfs4 127.0.0.1:/mnt/platte /mnt/test
mount.nfs4: mounting 127.0.0.1:/mnt/platte failed, reason given by server: No such file or directory
(Of course 127.0.0.1:/ doesn't mount either, but that's desired behavior.)

Then, when I edit /etc/exports removing the remote export like this:
Code:
/mnt/platte 127.0.0.1(rw,sync,no_root_squash,no_subtree_check)
Then I do a restart of nfs process.
Now I can locally mount the 127.0.0.1:/ share. Why that? Isn't that strange?!

showmount -e always shows the expected correct stuff.

Last edited by LeFrnk; 09-19-2018 at 11:11 AM.
 
Old 09-19-2018, 02:27 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
So the first question is why are you trying to make it a local NFS4 mount to the exporting server rather than simply creating a symbolic link to the local filesystem? e.g.
ln -s /mnt/platte /mnt/test

Alternatively you could do a loop back mount locally.

Assuming you have a reason to use an NFS4 mount rather than a symbolic link on the export server, 192.168.122.1, why bother with 127.0.0.1 if you've exported with the IP 192.168.122.1. You could mount on client 192.168.122.1 from server 192.168.122.1 just as you did on client 192.168.122.2 from server 192.168.122.1.
 
Old 09-19-2018, 04:12 PM   #3
LeFrnk
LQ Newbie
 
Registered: Sep 2018
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks. Mounting via public IP does work locally, indeed.

Why I do this:
I somehow wanted to make sure there are no conflicts, when I am changing files in a shared directory from remote and locally at the same time.
My hope was, if all changes go through NFS4, the NFS server takes care of that.
I was afraid that changing files under NFS's ass would perhaps result in conflicts.
Can that be ruled out?
 
Old 09-21-2018, 01:56 PM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
File locking in NFS4 is not as robust as you suggest so I don't think you'll get benefit using NFS4 locally over symbolic links.

You might want to read through this thread.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Cannot mount nfsv4 exports xq10907 CentOS 10 09-01-2017 12:11 AM
[SOLVED] exports works for NFS3 but not NFS4 Meson Linux - Server 1 07-26-2013 02:39 PM
nfs4 - mount.nfs4: access denied by server while mounting edwin11 Linux - Networking 1 12-07-2010 10:06 AM
NFS4 mount is read-only? larold Linux - Enterprise 1 07-13-2010 12:45 PM
[SOLVED] can't mount via NFS4 rmahn Linux - Server 4 09-10-2009 08:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration