From owner-freebsd-fs@freebsd.org Thu May 13 21:44:26 2021 Return-Path: Delivered-To: freebsd-fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 48DDC63016F for ; Thu, 13 May 2021 21:44:26 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fh4tf1crRz3vXX; Thu, 13 May 2021 21:44:26 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from onlyone.not-for.work (onlyone.not-for.work [IPv6:2a01:4f8:201:6350::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: lev/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 0FD5AD814; Thu, 13 May 2021 21:44:26 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from [192.168.134.16] (unknown [94.19.224.8]) (Authenticated sender: lev@serebryakov.spb.ru) by onlyone.not-for.work (Postfix) with ESMTPSA id 3F3CC4972; Fri, 14 May 2021 00:44:24 +0300 (MSK) Reply-To: lev@FreeBSD.org Subject: =?UTF-8?Q?Re=3a_autofs_+_default_/net_map_+_NFS4_=e2=80=94_how_to?= =?UTF-8?Q?=3f?= To: Rick Macklem , freebsd-fs References: <36080caf-4aa1-d262-cb93-9df9b72f884d@FreeBSD.org> From: Lev Serebryakov Organization: FreeBSD Message-ID: <4add2e1e-ecfe-75cb-e2a7-c30c3e3ab50a@FreeBSD.org> Date: Fri, 14 May 2021 00:44:23 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 May 2021 21:44:26 -0000 On 13.05.2021 23:59, Rick Macklem wrote: > You can do the exports lines without "-network..." and then they apply to all subnets. > Not recommended unless you have an external firewall/nat gateway that is blocking > incoming traffic to port#2049. I have different settings (-maproot) for different subnets (both IPv4 and IPv6), not shown (snipped) here for brevity. There is ZFS inheritable property which could be set to the root of FS hierarchy ("/usr/home" and "/usr/ports" in my case), which saves a lot of repetition, but it could be only single-line, so it is not applicable for multiple networks :-( There were patches, but all of them were declined as "incompatible with other systems". > I know nothing about autofs and never use it. (/etc/fstab is your friend;-) Not on Laptop which could see server 50% of the time. It could be "noauto" mounts, but then you need root to mount them and you need to unmount them before leaving home with laptop, or you could have bad and long timeouts later. > I suspect changing your V4: lines to specify "/" may work around this, since the > mount paths then look the same as for NFSv3. And exporting "/" via NFSv3 lines too, as "V4" is only addition to "classic" export lines, and will not work if it will point to non-exported FS. To be honest, I don't understand why NFS export is done on local file system basis, not arbitrary local subtree, on one or several FSes, in 2021. Maybe, it was useful in 1984, but now samba could export any subtree, crossing local FS boundaries or not, from root or from any point in tree. Why NFSv4 server could not do the sameand need to explicitly export each FS in hierarchy?! With ZFS we could have very deep hierarchies. To be honest, I've wanted to add "${HOME}/archive" (for different snapshot retention policy) to each user homedir at one moment in time, but then decided that it is too much, to add twice more lines to /etc/exports. -- // Lev Serebryakov