From owner-freebsd-questions@FreeBSD.ORG Tue Aug 21 11:19:05 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E800016A41A for ; Tue, 21 Aug 2007 11:19:05 +0000 (UTC) (envelope-from rakhesh@rakhesh.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.184]) by mx1.freebsd.org (Postfix) with ESMTP id 4E88113C45A for ; Tue, 21 Aug 2007 11:19:05 +0000 (UTC) (envelope-from rakhesh@rakhesh.com) Received: by nf-out-0910.google.com with SMTP id b2so916765nfb for ; Tue, 21 Aug 2007 04:19:03 -0700 (PDT) Received: by 10.78.176.20 with SMTP id y20mr2700113hue.1187695143301; Tue, 21 Aug 2007 04:19:03 -0700 (PDT) Received: from smtp.home.rakhesh.com ( [82.178.132.156]) by mx.google.com with ESMTPS id p30sm1959974hub.2007.08.21.04.19.00 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 21 Aug 2007 04:19:02 -0700 (PDT) Received: from obelix.home.rakhesh.com (obelix.home.rakhesh.com [192.168.17.13]) by smtp.home.rakhesh.com (Postfix) with ESMTP id AB8E450841; Tue, 21 Aug 2007 15:17:16 +0400 (GST) Date: Tue, 21 Aug 2007 15:17:16 +0400 (GST) X-X-Sender: rakhesh@obelix.home.rakhesh.com To: Pieter de Goeje In-Reply-To: <200708211140.11973.pieter@degoeje.nl> Message-ID: <20070821145002.H11603@obelix.home.rakhesh.com> References: <20070821113011.W7559@obelix.home.rakhesh.com> <20070821114033.V8623@obelix.home.rakhesh.com> <200708211140.11973.pieter@degoeje.nl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed From: Rakhesh Sasidharan Cc: freebsd-questions@freebsd.org Subject: Re: NFS export subdirs on different file systems? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Aug 2007 11:19:06 -0000 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/