2011-09-26 11:03:18

by Sreeram B S

[permalink] [raw]
Subject: NFS mounts and its propagation

Hi,
I am Sreeram. This question is related to NFS.
I have a typical scenario. Please assume that there are 3 machines
M1, M2, M3. Each of them are having directories /tmp/abc in them. All
the NFS permissions are set appropriately.
Now, a user mounts M2's /tmp/abc on M1's /tmp/abc by issuing mount
command on M1. Mount is successful.
Then the user mounts M3's /tmp/abc on M2's /tmp/abc by issuing
mount command on M2. Mount successful.
Now I would expect the contents of M3's /tmp/abc to be shown as
output of 'ls' issue on M1. But this is not happening. I am unable to
comprehend the reason. Could you please guide me?

According to me, the contents of M3 should have shown up in M1's
'ls' command, because the /tmp/abc of M1 is nothing but a *live*
reflection of /tmp/abc of M2. So whatever changes are done to M2's
/tmp/abc should be reflected on M1. Here, M2's /tmp/abc is mounting M3's
/tmp/abc and so this change should be reflected on M1's /tmp/abc as
well. But this isn't happening.

Kindly suggest if I am incorrect in my understanding or usage.
The command I am using is:

On M1: mount -t nfs M2:/tmp/abc /tmp/abc
On M2: mount -t nfs M3:/tmp/abc /tmp/abc

Regards,
Sreeram


2011-09-28 23:03:03

by Venkateswararao Jujjuri

[permalink] [raw]
Subject: Re: NFS mounts and its propagation



On 09/26/2011 04:03 AM, Sreeram B S wrote:
> Hi,
> I am Sreeram. This question is related to NFS.
> I have a typical scenario. Please assume that there are 3 machines M1,
> M2, M3. Each of them are having directories /tmp/abc in them. All the
> NFS permissions are set appropriately.
> Now, a user mounts M2's /tmp/abc on M1's /tmp/abc by issuing mount
> command on M1. Mount is successful.
> Then the user mounts M3's /tmp/abc on M2's /tmp/abc by issuing mount
> command on M2. Mount successful.
> Now I would expect the contents of M3's /tmp/abc to be shown as output
> of 'ls' issue on M1. But this is not happening. I am unable to
> comprehend the reason. Could you please guide me?

What are you seeing instead? Are you seeing M2's contents on M1?
Did you try to change the order of the experiment? i.e First mount M3 on
M2 and then mount M2 on M1? Just curious to see if there is any change
in the behavior.

Thanks,
JV

>
> According to me, the contents of M3 should have shown up in M1's 'ls'
> command, because the /tmp/abc of M1 is nothing but a *live* reflection
> of /tmp/abc of M2. So whatever changes are done to M2's /tmp/abc should
> be reflected on M1. Here, M2's /tmp/abc is mounting M3's /tmp/abc and so
> this change should be reflected on M1's /tmp/abc as well. But this isn't
> happening.
>
> Kindly suggest if I am incorrect in my understanding or usage.
> The command I am using is:
>
> On M1: mount -t nfs M2:/tmp/abc /tmp/abc
> On M2: mount -t nfs M3:/tmp/abc /tmp/abc
>
> Regards,
> Sreeram
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>



2011-09-29 00:10:22

by Myklebust, Trond

[permalink] [raw]
Subject: Re: NFS mounts and its propagation




On Wed, 2011-09-28 at 16:02 -0700, Venkateswararao Jujjuri wrote:
>
> On 09/26/2011 04:03 AM, Sreeram B S wrote:
> > Hi,
> > I am Sreeram. This question is related to NFS.
> > I have a typical scenario. Please assume that there are 3 machines M1,
> > M2, M3. Each of them are having directories /tmp/abc in them. All the
> > NFS permissions are set appropriately.
> > Now, a user mounts M2's /tmp/abc on M1's /tmp/abc by issuing mount
> > command on M1. Mount is successful.
> > Then the user mounts M3's /tmp/abc on M2's /tmp/abc by issuing mount
> > command on M2. Mount successful.
> > Now I would expect the contents of M3's /tmp/abc to be shown as output
> > of 'ls' issue on M1. But this is not happening. I am unable to
> > comprehend the reason. Could you please guide me?
>
> What are you seeing instead? Are you seeing M2's contents on M1?
> Did you try to change the order of the experiment? i.e First mount M3 on
> M2 and then mount M2 on M1? Just curious to see if there is any change
> in the behavior.

As Bruce said, re-exporting of NFS-mounted filesystems is not supported
by the Linux server.

Just mount M3's contents directly onto M1, or use a NFSv4 referral (man
5 exports0.

Trond
--
Trond Myklebust
Linux NFS client maintainer

NetApp
[email protected]
http://www.netapp.com