From owner-freebsd-questions@freebsd.org Sat Oct 2 22:09:29 2021 Return-Path: Delivered-To: freebsd-questions@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 B91E36AB185 for ; Sat, 2 Oct 2021 22:09:29 +0000 (UTC) (envelope-from dpchrist@holgerdanske.com) Received: from holgerdanske.com (holgerdanske.com [184.105.128.27]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "xray.he.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HMLk03Jrcz3Hs3 for ; Sat, 2 Oct 2021 22:09:28 +0000 (UTC) (envelope-from dpchrist@holgerdanske.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=holgerdanske.com; s=nov-20210719-112354; t=1633212564; bh=lSu4VTPH1S2oQsHM58i0TEpbnzQkj/1BERbwekq01/8=; h=Received:Message-ID:Date:MIME-Version:User-Agent:Subject: Content-Language:To:References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; b=ffhuv8bYbLkdPwHEHi8X43549EoK9k62o+DaYSnXmpW6K3N8db9u62L6+ZA0PTZnc PFsLAGHW/rrOSjAiBuhrgzqCLvQ25UOexw3Vk4gjEgk4LxESJRbCyv3dKy7/4z7nxC hkl8aHnw/k530qes8cKpRc+i2GcG0C6jlgx8QEJ2gV+US/jntHRPgR8Zm705gftJZq t/fsJR4JGHf58VBP3x7cLfHOAE77kdPn4sOgGqD01N0UzF7UYTAPlBdHJgVdXIlpEc INKMwFMA445HuWaP1/lSwEZ2pKURGjnf6tLbJMXdJrBY7ggL3qI8r6xEneevDHX43t OJBhwQLzhfqb8SjtjOkf7NNGJ5XrwHG3AZqssNz4SW3x5pYNIMocNPEbjSQdO0a+3M 4L4luUnlcdJK+jVDBC5zTxxrlezYRNImbyiYqormjpffCP2UyHxlrh9bTB+65IcF/t MwWAtQZ2okKfCiDFRyq4fWaaTOlH/OMp7dcnFhos6Vg63E+xFb6QuyxaVejsp7kOn2 eLikkYkyG0LyRbr9DqBHn85mg0BvE1L+L+Iw4Z5kRwOevK2UYlESE4MM/wgeWvJYZN yZXnaOY0hXC0NiKLWFunCXlu39mmuXv/4Gbl6OF9ls6vqtdKAjtY6ml6ugVBrQC46e 608XLBnn7fx5+B/fxuwDicf8= Received: from 99.100.19.101 (99-100-19-101.lightspeed.frokca.sbcglobal.net [99.100.19.101]) by holgerdanske.com with ESMTPSA (TLS_AES_128_GCM_SHA256:TLSv1.3:Kx=any:Au=any:Enc=AESGCM(128):Mac=AEAD) (SMTP-AUTH username dpchrist@holgerdanske.com, mechanism PLAIN) for ; Sat, 2 Oct 2021 15:09:24 -0700 Message-ID: <69954781-9e3c-ba96-5f1e-9b4043ecf56c@holgerdanske.com> Date: Sat, 2 Oct 2021 15:09:23 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.2 Subject: Re: zfs q regarding backup strategy Content-Language: en-US To: freebsd-questions@freebsd.org References: <20211001222816.a36e9acbd4e8829aed3afb68@sohara.org> <809e4f3b-9e59-eb53-5b7d-0bcf7e401cd5@holgerdanske.com> <20211002115440.85c4342a49fe6e4573c37dd0@sohara.org> <20211002205504.9d81ee94caa231ee9b008d6a@sohara.org> From: David Christensen In-Reply-To: <20211002205504.9d81ee94caa231ee9b008d6a@sohara.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HMLk03Jrcz3Hs3 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=holgerdanske.com header.s=nov-20210719-112354 header.b=ffhuv8bY; dmarc=pass (policy=none) header.from=holgerdanske.com; spf=pass (mx1.freebsd.org: domain of dpchrist@holgerdanske.com designates 184.105.128.27 as permitted sender) smtp.mailfrom=dpchrist@holgerdanske.com X-Spamd-Result: default: False [-4.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[holgerdanske.com:s=nov-20210719-112354]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+a]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; DKIM_TRACE(0.00)[holgerdanske.com:+]; DMARC_POLICY_ALLOW(-0.50)[holgerdanske.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:184.104.0.0/15, country:US]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-questions]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2021 22:09:29 -0000 On 10/2/21 12:55, Steve O'Hara-Smith wrote: > On Sat, 2 Oct 2021 11:23:30 -0700 > David Christensen wrote: > >> I have found that ZFS is very carefully engineered, and that any issues >> I encounter are invariably PEBKAC. So, there must be compelling reasons >> why 'altroot' is a pool property and why 'altroot' is not persistent. >> Similar, the absence of property manipulation options for the 'zfs send' >> and 'zfs receive' commands. > > I know exactly what you mean, trying to do this feels like trying to > force the mechanism to do something it wasn't designed for. The only > trouble I have with that is that I can't figure out what use case it was > designed for. > >> So, between zpool 'altroot', dataset 'canmount', and suitable scripting, >> it might be possible to achieve your goal: > > Yes likely, I have a design doc I tinker with occasionally trying > to chart a path to perfection, altroot is neat but a pool for each archive > is not nice that means lots of smallish vdevs for flexibility. Might not be > too bad at that, easy to expand at least. Assuming I can create a ZFS pool from one or more ZFS volume datasets (?), here is an idea: 1. Create a large 'archive' pool. Say, 10 TB. 2. Within the archive pool, create many small volumes. Say, 100 volumes of 100 GB each. 3. For each source, create a 'archive-source' pool using the 'zpool create -R' option and one or more volumes as required for capacity. 4. From the archive server, replicate datasets from their respective source pools to their corresponding archive-source pools using the 'zfs receive -u' option. 5. Upon receipt of a replica dataset, save the 'canmount' property (for restore). If it is 'on', set it to 'notauto'. 6. Upon receipt of a replica dataset, save the 'readonly' property (for restore). If it is 'off', set it to 'on'. 7. Mount or do not mount the replica datasets, as desired. 8. On shutdown, export all archive-source pools. 9. On boot, import all archive-source pools using the 'zpool import -R' option, and then mount or do not mount replica datasets. The most obvious problem is if the system crashes between #4 and #5. On subsequent boot, AIUI all previously active pools will be automatically imported (e.g. without 'altroot') and all datasets with 'canmount=on' will be mounted (according to 'mountpoint'). If two or more datasets are mounted at the same mount point, the results could be bad. 'bootpool' and 'zroot' are likely cases. The FreeBSD installer allows me to set the root pool name at install time, so I prepend the base hostname. I use serialized names when creating data pools. But I have not dared to rename boot pools, as I assume 'bootpool' is hard-coded into the bootloader chain (?). Can the boot pool ('bootpool') be renamed on FreeBSD? David