From owner-freebsd-fs@freebsd.org Thu Nov 21 12:12:11 2019 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 447091BC8CA for ; Thu, 21 Nov 2019 12:12:11 +0000 (UTC) (envelope-from borjam@sarenet.es) Received: from cu1176c.smtpx.saremail.com (cu1176c.smtpx.saremail.com [195.16.148.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47Jdj61Bn3z4Jgp; Thu, 21 Nov 2019 12:12:09 +0000 (UTC) (envelope-from borjam@sarenet.es) Received: from [172.16.8.16] (unknown [192.148.167.11]) by proxypop02.sare.net (Postfix) with ESMTPA id 8C96E9DCFEE; Thu, 21 Nov 2019 13:12:05 +0100 (CET) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: ZFS snapdir readability (Crosspost) From: Borja Marcos In-Reply-To: <20191120175803.03401c3316fe756cc46f79f1@magnetkern.de> Date: Thu, 21 Nov 2019 13:12:04 +0100 Cc: Mike Tancsa , Alan Somers , freebsd-fs Content-Transfer-Encoding: quoted-printable Message-Id: <3C5DC6DD-C44B-41EE-B7AB-6D8F94E43174@sarenet.es> References: <20191107004635.c6d2e7d464d3d556a0d87465@magnetkern.de> <9B22AD46-BE87-4305-9638-74D23AD4C8CA@sarenet.es> <261FE331-EC5C-48C8-9249-9BCBF887CE38@sarenet.es> <913f7040-6e38-452d-6187-e17fae63b652@sentex.net> <20191120144041.7f916360dc0c69bf509c9bd1@magnetkern.de> <20191120163437.691abd369ab9c0a6d7d45ff2@magnetkern.de> <20191120175803.03401c3316fe756cc46f79f1@magnetkern.de> To: Jan Behrens X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 47Jdj61Bn3z4Jgp X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=none) header.from=sarenet.es; spf=pass (mx1.freebsd.org: domain of borjam@sarenet.es designates 195.16.148.151 as permitted sender) smtp.mailfrom=borjam@sarenet.es X-Spamd-Result: default: False [-5.21 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:195.16.148.0/24]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DMARC_POLICY_ALLOW(-0.50)[sarenet.es,none]; RCVD_IN_DNSWL_NONE(0.00)[151.148.16.195.list.dnswl.org : 127.0.10.0]; IP_SCORE(-2.91)[ip: (-8.14), ipnet: 195.16.128.0/19(-3.73), asn: 3262(-2.71), country: ES(0.04)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:3262, ipnet:195.16.128.0/19, country:ES]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Nov 2019 12:12:11 -0000 > On 20 Nov 2019, at 17:58, Jan Behrens wrote: >=20 >=20 > With "mounting snapshots", I meant mounting snapshots that are already > existent in a ZFS pool. Receiving a snapshot and creating a new > filesystem from it is a different issue. In that case, you can use > "zfs receive -u" and mount the file system manually under a directory = with > a parent directory that is chmod 700, as in option (d). What I mean is, there is no snapshot mount functionality. If you want to = access the contents of a snapshot you either rollback it or you clone it. There is = no mount. Or of course you access the =E2=80=9C.zfs" directory. Which makes me realize that the =E2=80=9C.zfs" directory feature is an = odd anomaly (ie a bloody kludge) in an otherwise really clean and consistent design. Why? 1. There is no accessible facility for the read only mount of a = snapshot. Yet the system mounts them by default. 2. Because of (1) you can=E2=80=99t control where to mount them. They = are mounted there. Period.=20 3. You can=E2=80=99t prevent it. You can hide the .zfs directory but = its=E2=80=99s still there, with the snapshots mounted.=20 > Mounting is not the same as cloning and mounting. But you are right: = If > snapshots are cloned first, you can specify the mountpoint. But then > you are mounting a new file system and not a snapshot technically. > Which brings us back to option (a) never mount snapshots ever ;-) >=20 > Given that we can prohibit the automounting of all snapshots, it would > be a nice workaround which would not have too much overhead. I would rather prefer if that option didn=E2=80=99t exist. Given that it = can=E2=80=99t be removed now because it would surely break someone=E2=80=99s work, the most important = tweak that can be done is to allow the administrator to supress it completely.=20 So, zfs set snapdir=3Ddisabled.=20 Limiting it by uid won=E2=80=99t necessarily be enough as you should = also take into account systems in which different securty enforcement mechanisms are = used. (MAC policies like mls, biba, etc). And adding a generalized way to deal = with this would probably be too complex.=20 Borja.=