Re: NFS export subdirs on different file systems?




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/
_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: NFS
    ... >> The NFS server can see the exports are in the same FS so why does it ... has been supplanted by mount --bind anyway. ... client imports several of these exports, ... msdos-type filesystems this is true. ...
    (uk.comp.os.linux)
  • Re: disksuite and dual attached multipak?
    ... >>filesystems using one of the hosts. ... >>able to mount those mirrors onto the other host? ... then mount it up on the other host. ...
    (comp.unix.solaris)
  • Re: recent nfs change causes autofs regression
    ... If the user asks for a new mount that is read-write, ... get it - ie we should not re-use the old client handles, ... everything needs to have the same flags), THOSE PEOPLE, who want the NEW ... or deleted on the server are now extended to also include the ...
    (Linux-Kernel)
  • Re: nfsmnthelp holding up server nfsd?
    ... client to mount a filesystem increments BADCALLS a bunch. ... the server to watch nfs request, only 1 or two nfs requests come ...
    (comp.unix.aix)
  • Re: NFS UDP mounts on RELENG_6?
    ... >> afterwards the access to the filesystem on the client stalls. ... >> as I mount the FS with a TCP mount everything works as expected. ... >> The mounts worked fine on UDP when the server was 5.4-STABLE. ... > I just copied some files from a NFS Server running ...
    (freebsd-stable)