From owner-freebsd-questions@FreeBSD.ORG Thu Jul 21 14:36:52 2005 Return-Path: X-Original-To: questions@FreeBSD.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9191416A436; Thu, 21 Jul 2005 14:36:52 +0000 (GMT) (envelope-from NKoch@demig.de) Received: from server.absolute-media.de (server.absolute-media.de [213.239.231.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id ABF8843D5D; Thu, 21 Jul 2005 14:36:30 +0000 (GMT) (envelope-from NKoch@demig.de) Received: from localhost (unknown [127.0.0.1]) by server.absolute-media.de (Postfix) with ESMTP id 333958BB17; Thu, 21 Jul 2005 16:36:28 +0200 (CEST) Received: from server.absolute-media.de ([127.0.0.1]) by localhost (server [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 05196-03; Thu, 21 Jul 2005 16:36:23 +0200 (CEST) Received: from firewall.demig (p50839136.dip0.t-ipconnect.de [80.131.145.54]) by server.absolute-media.de (Postfix) with ESMTP id 5EC478853A; Thu, 21 Jul 2005 16:36:23 +0200 (CEST) Received: from ws-ew-3 (ws-ew-3.w2kdemig [192.168.1.72]) by firewall.demig (8.13.4/8.13.1) with SMTP id j6LEZqaV034217; Thu, 21 Jul 2005 16:35:52 +0200 (CEST) (envelope-from NKoch@demig.de) From: "Norbert Koch" To: "Sergey Matveychuk" Date: Thu, 21 Jul 2005 16:35:51 +0200 Message-ID: <000001c58e01$7e7908e0$4801a8c0@ws-ew-3.W2KDEMIG> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 In-Reply-To: <42DF9F80.8060705@FreeBSD.org> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2120.0 X-Virus-Scanned: by amavisd-new X-Virus-Scanned: by amavisd-new at absolute-media.de Cc: questions@FreeBSD.org Subject: RE: /etc/exports - a strange restriction 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: Thu, 21 Jul 2005 14:36:52 -0000 > Norbert Koch wrote: > >>/usr/tinderbox -ro -alldirs -maproot=0:0 localhost > >> > > As far as I know, it is a restriction of the nfs specification. > > If you only want to export a single directory, you could e.g. > > use mount_null/mount_nullfs(8). > > Well, in my example remote host is localhost. But if I need to share > files on a network? I think I don't understand your problem here: /usr -ro -alldirs -maproot=0:0 -network 192.168.0.0 -mask 255.255.0.0 for an export into the local network 192.168.0.0/16. /usr -ro -alldirs -maproot=0:0 192.168.1.2 for an export to a specific host. > I've made a quick look at RFC1813 but could not find this restriction. > But why this restriction anyway for? It's very unconvenient. I am no nfs expert. May be it is not a specification restriction but an implementation restriction. But all references I found about /etc/exports always speak about exporting a file system, not a directory. And that seems to be so for other operating systems too. So if I understand you right, this may work (for FreeBSD 5.x): # mkdir /tinderbox # mount_nullfs /usr/tinderbox /tinderbox # echo '/tinderbox -ro -alldirs -maproot=0:0 any_local_or_remote_host' > /etc/exports An other way to export /usr/tinderbox and all sub-directories is to specify _all_ of them in /etc/exports but w/o the -alldirs switch, e.g.: /usr/tinderbox /usr/tinderbox/dirA /usr/tinderbox/dirB -ro -maproot=0:0 any_host See also the FreeBSD handbook chapter about nfs. Norbert