From owner-freebsd-current@FreeBSD.ORG Wed Mar 5 17:27:22 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 136F31065672 for ; Wed, 5 Mar 2008 17:27:22 +0000 (UTC) (envelope-from swhetzel@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.153]) by mx1.freebsd.org (Postfix) with ESMTP id 8338D8FC17 for ; Wed, 5 Mar 2008 17:27:21 +0000 (UTC) (envelope-from swhetzel@gmail.com) Received: by fg-out-1718.google.com with SMTP id 16so1423662fgg.35 for ; Wed, 05 Mar 2008 09:27:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=ua22/HYn9igCBK/2y4olQSNAqrqd2tyTyMK/C1Z1mzs=; b=bbCzQVaKapPsR+TmK4ZdSagqjGMCiPOteB/3igmVt3sVcBWEwgxA5CV3z0yybJg5SEXMxtfeNiudL+27Pq9DfUzhU62Usy+X9zScROfNrPNoIFRfeeIdO0wa1V9Wz2BPSH3iQVNzz4Delpx6cmXgpaYzr6J906Xl6Voi2+QfGfE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=sH//hiSnSmTFPC+tcjoa/yzN+LxrTodLWsan1DouGolqySfiD7mf9FhKlSji9cBqRLGeJM1DXM3TlZruwzY9w7bdb3XHNo550KCj8Y9r3qfHLBhqtAoUrikv+0qe9XkNaI4XkAoU+D3SMOLNZWChATfZzfuCNpToNBaARDUG32c= Received: by 10.86.80.5 with SMTP id d5mr3303964fgb.57.1204738039481; Wed, 05 Mar 2008 09:27:19 -0800 (PST) Received: by 10.86.95.7 with HTTP; Wed, 5 Mar 2008 09:27:19 -0800 (PST) Message-ID: <790a9fff0803050927p2ea00523sd259adff06e98cde@mail.gmail.com> Date: Wed, 5 Mar 2008 11:27:19 -0600 From: "Scot Hetzel" To: "Michael Jung" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080304233327.B19039@woozle.rinet.ru> <790a9fff0803041838m2e9e124fnfc2560fde62f0e08@mail.gmail.com> <20080305094125.G19039@woozle.rinet.ru> Cc: Pawel Jakub Dawidek , marck@rinet.ru, current@freebsd.org Subject: Re: ZFS sharenfs and NFS options X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2008 17:27:22 -0000 On 3/5/08, Michael Jung wrote: > When does /etc/zfs/exports get written? > It gets updated when you change the sharenfs property of a zfs filesystem. > Should you have to HUP mountd after adding the nfs share via "zfs set > sharenfs=....."? it doesn't make any difference for me. > > Should showmount -e show the zfs exported NFS share? > showmount will show the zfs exported NFS share that is added to /etc/zfs/exports: hp010# zfs set sharenfs=on myzpool/test hp010# showmount -e Exports list on localhost: /myzpool/test Everyone hp010# zfs inherit sharenfs myzpool/test hp010# showmount -e Exports list on localhost: > (root@zega) /etc/zfs# zfs get sharenfs tank/export1 > NAME PROPERTY VALUE > SOURCE > tank/export1 sharenfs -maproot=root -alldir -network 10.0.0.3 -mask > 255.255.255.255 local > (root@zega) /etc/zfs# > > (root@zega) /etc/zfs# cat /etc/zfs/exports > > # !!! DO NOT EDIT THIS FILE MANUALLY !!! > > > (root@zega) /etc/zfs# > > (root@zega) /etc/zfs# showmount -e > Exports list on localhost: > /export0 10.0.0.3 > (root@zega) /etc/zfs# > > (root@zega) /etc/zfs# uname -a > FreeBSD zega.mikej.com 7.0-STABLE FreeBSD 7.0-STABLE #2: Sun Mar 2 > 20:39:38 UTC 2008 mikej@zega.mikej.com:/usr/obj/usr/src/sys/ZEGA > i386 > (root@zega) /etc/zfs# > > NOTE****** /export0 is exported via /etc/exports > > Needless to say, I'm not able to mount export1 on 10.0.0.3 when I share > it via the "zfs set sharenfs" command. > > exporting the ZFS mount point via /etc/exports works fine. > Make sure that zfs_enable="YES" is in rc.conf, restart /etc/rc.d/mountd, then the mountd command will use both /etc/exports and /etc/zfs/exports. So to do nfs with ZFS, all you need to do is: 1. add zfs_enable="YES" to /etc/rc.conf 2. restart mountd (i.e. /etc/rc.d/mountd restart) 3. add your zfs shares: zfs sharenfs=on myzpool/test1 zfs sharenfs="-maproot=root -alldir -network 10.0.0.3 -mask 255.255.255.255" myzpool/test2 NOTE: sharenfs=on creates a nfs share that is available to everyone. You should now be able to mount the zfs nfs filesystems on other systems or locally. mount -t nfs myserver:/myzpool/test1 /mnt Unlike /etc/exports, zfs nfs shares are available immediately, no need to restart mountd. Scot