Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Aug 2007 15:17:16 +0400 (GST)
From:      Rakhesh Sasidharan <rakhesh@rakhesh.com>
To:        Pieter de Goeje <pieter@degoeje.nl>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: NFS export subdirs on different file systems?
Message-ID:  <20070821145002.H11603@obelix.home.rakhesh.com>
In-Reply-To: <200708211140.11973.pieter@degoeje.nl>
References:  <20070821113011.W7559@obelix.home.rakhesh.com> <20070821114033.V8623@obelix.home.rakhesh.com> <200708211140.11973.pieter@degoeje.nl>

next in thread | previous in thread | raw e-mail | index | archive | help

Pieter de Goeje wrote:

> On Tuesday 21 August 2007, Rakhesh Sasidharan wrote:
>>> I have a directory /net/store. This directory is exported to all machines
>>> on my network.
>>>
>>> I have a sub-directory /net/store/photos. That too is exported to all
>>> machines on my network.
>>>
>>> What I want is that when I mount /net/store from another machine, the
>>> contents of /net/store/photos too be visible. Is there any way I can do
>>> that?
>>>
>>> From the manpage and the handbook and Google etc I get the idea that it
>>> might not be possible. Still, asking just in case there are any
>>> round-about ways ... I would assume a scenario like this is common.
>>>
>> Forgot to add: the two directories are imported "dynamically" on the
>> client side. So I can't just make fstab entries on the client side to
>> mount both points. I use AMD to mount /net/store when needed. And I can't
>> for the life of me figure how to make it mount /net/store/photos too when
>> needed -- I dont think that's possible(?) ...
> I have that configuration working.
> In /etc/exports:
> /pub    -alldirs        client
> /pub/video -alldirs     client
> On the client side, I didn't change anything to the configuration of AMD.
> Simply cd'ing to /host/server/pub and then 'cd video' does the right thing. I
> don't think -alldirs is really needed, but it's there for convenience.

Thanks Pieter. The default configuration mounts *all* the exported 
filesystems from host. Which should be fine, just that I don't want it 
that way (and I like complicating matters, I guess! :p).

Using the default way, I can access the exported filesystems as 
/host/server/net/store[/photos] -- which is not what I want. Rather, I 
want to 
access the exported /net/store[/photos] filesystems under the 
/net/store[/photos] mount points of the client -- and I don't want any 
other exported file systems in there either. Kind of like the "host" type 
amd filesystem, but only for a specific branch.

This is something I did come up with:

-----8<-----
/defaults       host!=obelix;type:=nfsopts:=rw,intr,grpid,nosuid
store           type:=auto;fs:=${map};pref:=${key}/
store/*         type:=nfs;rhost:=obelix;rfs:=${path}
-----8<-----

It does what I want -- /net/store/[anything] is mounted from the remote 
host (obelix) -- only problem (and the reason why I didnt go ahead with 
this) being that there's no way to see what all directories are available 
under /net/store. If do a "cd /net/store/music" it will work well; but if 
you do an "ls /net/store" it won't mount "/net/store" and show me what 
subdirs are available. And the "browseable_dirs" option in "amd.conf" does 
not help either coz its an "auto" type filesystem.

I had forgotten about the "host" filesystem type (the default). So thanks 
for pointing it out. Let me see if I can twiddle around and find a 
workaround. :)

Regards,

 				- Rakhesh
                                 http://rakhesh.com/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070821145002.H11603>