From owner-freebsd-fs@FreeBSD.ORG Tue Dec 29 01:25:12 2009 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F36B6106568B for ; Tue, 29 Dec 2009 01:25:11 +0000 (UTC) (envelope-from ticso@cicely7.cicely.de) Received: from raven.bwct.de (raven.bwct.de [85.159.14.73]) by mx1.freebsd.org (Postfix) with ESMTP id 80B078FC13 for ; Tue, 29 Dec 2009 01:25:10 +0000 (UTC) Received: from cicely5.cicely.de ([10.1.1.7]) by raven.bwct.de (8.13.4/8.13.4) with ESMTP id nBT1P9lQ061646 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 29 Dec 2009 02:25:09 +0100 (CET) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (cicely7.cicely.de [10.1.1.9]) by cicely5.cicely.de (8.14.2/8.14.2) with ESMTP id nBT1P6HA070100 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 29 Dec 2009 02:25:06 +0100 (CET) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (localhost [127.0.0.1]) by cicely7.cicely.de (8.14.2/8.14.2) with ESMTP id nBT1P1oV071201 for ; Tue, 29 Dec 2009 02:25:06 +0100 (CET) (envelope-from ticso@cicely7.cicely.de) Received: (from ticso@localhost) by cicely7.cicely.de (8.14.2/8.14.2/Submit) id nBT1OisK071200 for freebsd-fs@freebsd.org; Tue, 29 Dec 2009 02:24:44 +0100 (CET) (envelope-from ticso) Date: Tue, 29 Dec 2009 02:24:44 +0100 From: Bernd Walter To: freebsd-fs@freebsd.org Message-ID: <20091229012443.GF43739@cicely7.cicely.de> References: <20091228225228.GA1114@donald.home.tols.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091228225228.GA1114@donald.home.tols.org> X-Operating-System: FreeBSD cicely7.cicely.de 7.0-STABLE i386 User-Agent: Mutt/1.5.11 X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED=-1.8, AWL=0.013, BAYES_00=-2.599 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on spamd.cicely.de Subject: Re: zfs sharenfs to multiple subnets - found a dirty looking hack X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ticso@cicely.de List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2009 01:25:12 -0000 On Mon, Dec 28, 2009 at 11:52:28PM +0100, Marco van Tol wrote: > Hi there, > > I would like to refer to a thread in this list about zfs exporting to > multiple subnets using sharenfs. The thread I mean is this one: > http://lists.freebsd.org/pipermail/freebsd-fs/2008-September/005158.html > I wasn't subscribed at the time, so I'm just referencing to the thread. > > I was testing and needed to also export a filesystem to multiple subnets, > and found something out that may or may not be allowed. > > What happens is you start to type > zfs set sharenfs=" > and don't close the double quote. The result on the following lines will > literally make it to /etc/zfs/exports, and make it work as desired. > > A full session would look like: > (Bear with me for typo's, I didn't copy-paste) > > zfs set sharenfs="-maproot=root -network 10.0.0.0/24 > > /path/to/mountpoint -maproot=root -network 192.168.0.0/24 > > /path/to/mountpoint -maproot=root -network 172.16.0.0/24" pool0/space > > This translates to an /etc/zfs/exports like: > ----< cut here >---- > /path/to/mountpoint -maproot=root -network=10.0.0.0/24 > /path/to/mountpoint -maproot=root -network=192.168.0.0/24 > /path/to/mountpoint -maproot=root -network=172.16.0.0/24 > ----< cut here >---- > > The resulting "zfs get sharenfs" looks like: > ----< cut here >---- > pool0/space sharenfs -maproot=root -network=10.0.0.0/24 > /path/to/mountpoint -maproot=root -network=192.168.0.0/24 > /path/to/mountpoint -maproot=root -network=172.16.0.0/24 local > ----< cut here >---- > > This all makes it work so that it exports the pool to multiple subnets, > possibly with their own properties. > > Question is however, how desirable is it that this works? ;-) The really cool thing about using zfs property instead of manual exports line is the ability to inherit export options, but since you need to write the path into the argument... It would be nice however if the export-file creator would parse the newline and automatically prepend the path to each line. -- B.Walter http://www.bwct.de Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.