From owner-freebsd-questions@freebsd.org Sun Oct 3 05:34:01 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 BF32A6B1A7E for ; Sun, 3 Oct 2021 05:34:01 +0000 (UTC) (envelope-from 4250.82.1d4d400067a7aee.053bff58f8bdaaf481f57820a41076cd@email-od.com) Received: from s1-b0c6.socketlabs.email-od.com (s1-b0c6.socketlabs.email-od.com [142.0.176.198]) (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 4HMXZw2wgSz4TG9 for ; Sun, 3 Oct 2021 05:34:00 +0000 (UTC) (envelope-from 4250.82.1d4d400067a7aee.053bff58f8bdaaf481f57820a41076cd@email-od.com) DKIM-Signature: v=1; a=rsa-sha256; d=email-od.com;i=@email-od.com;s=dkim; c=relaxed/relaxed; q=dns/txt; t=1633239240; x=1635831240; h=content-transfer-encoding:content-type:mime-version:references:in-reply-to:message-id:subject:cc:to:from:date:x-thread-info; bh=xUhF34+7+YZki4DwPYDsomNiENic1ReSMeqBrNq5VgQ=; b=tslY4Mr5q+Eh1ZXZhfDbrU7yDXqLpek2WWnqbk/r8xZDc4DBP8U8+4ha2n2dvl7ApFDzIyA26uXxQROvltp8m8q6LNA9a2FS1YLkMD1Pgc44xCJ3jLNUBKJH/qqYOshbCgrEN5QQd4EF5M3RlN7cuFDoP4RDO6jonoYnYEempbM= X-Thread-Info: NDI1MC4xMi4xZDRkNDAwMDY3YTdhZWUuZnJlZWJzZC1xdWVzdGlvbnM9ZnJlZWJzZC5vcmc= Received: from r2.us-east-1.aws.in.socketlabs.com (r2.us-east-1.aws.in.socketlabs.com [142.0.191.2]) by mxsg2.email-od.com with ESMTP(version=Tls12 cipher=Aes256 bits=256); Sun, 3 Oct 2021 01:33:59 -0400 Received: from smtp.lan.sohara.org (EMTPY [185.202.17.215]) by r2.us-east-1.aws.in.socketlabs.com with ESMTP(version=Tls12 cipher=Aes256 bits=256); Sun, 3 Oct 2021 01:33:58 -0400 Received: from [192.168.63.1] (helo=steve.lan.sohara.org) by smtp.lan.sohara.org with smtp (Exim 4.94.2 (FreeBSD)) (envelope-from ) id 1mWu8K-000G6n-IY; Sun, 03 Oct 2021 06:33:56 +0100 Date: Sun, 3 Oct 2021 06:33:53 +0100 From: Steve O'Hara-Smith To: David Christensen Cc: freebsd-questions@freebsd.org Subject: Re: zfs q regarding backup strategy Message-Id: <20211003063353.7415d12917f0e514d433ae1c@sohara.org> In-Reply-To: <69954781-9e3c-ba96-5f1e-9b4043ecf56c@holgerdanske.com> References: <20211001222816.a36e9acbd4e8829aed3afb68@sohara.org> <809e4f3b-9e59-eb53-5b7d-0bcf7e401cd5@holgerdanske.com> <20211002115440.85c4342a49fe6e4573c37dd0@sohara.org> <20211002205504.9d81ee94caa231ee9b008d6a@sohara.org> <69954781-9e3c-ba96-5f1e-9b4043ecf56c@holgerdanske.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd12.1) X-Clacks-Overhead: "GNU Terry Pratchett" Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HMXZw2wgSz4TG9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=email-od.com header.s=dkim header.b=tslY4Mr5; dmarc=none; spf=pass (mx1.freebsd.org: domain of 4250.82.1d4d400067a7aee.053bff58f8bdaaf481f57820a41076cd@email-od.com designates 142.0.176.198 as permitted sender) smtp.mailfrom=4250.82.1d4d400067a7aee.053bff58f8bdaaf481f57820a41076cd@email-od.com X-Spamd-Result: default: False [-2.70 / 15.00]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[email-od.com:s=dkim]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:142.0.176.0/20]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[sohara.org]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[email-od.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[142.0.191.2:received]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[steve@sohara.org,4250.82.1d4d400067a7aee.053bff58f8bdaaf481f57820a41076cd@email-od.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[142.0.176.198:from]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:7381, ipnet:142.0.176.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[steve@sohara.org,4250.82.1d4d400067a7aee.053bff58f8bdaaf481f57820a41076cd@email-od.com]; MAILMAN_DEST(0.00)[freebsd-questions]; DWL_DNSWL_NONE(0.00)[email-od.com:dkim] 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: Sun, 03 Oct 2021 05:34:01 -0000 On Sat, 2 Oct 2021 15:09:23 -0700 David Christensen wrote: > Assuming I can create a ZFS pool from one or more ZFS volume datasets > (?), here is an idea: I don't think you can create a pool on top of zvols, I couldn't get it to work last time I tried. > 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. Why not just split the drives into 100GB partitions with gpart rather than attempting to nest zpools ? > 3. For each source, create a 'archive-source' pool using the 'zpool > create -R' option and one or more volumes as required for capacity. Also record the root mount for use at boot time. > 4. From the archive server, replicate datasets from their respective > source pools to their corresponding archive-source pools using the 'zfs > receive -u' option. Once you have altroot working then you want the dataset mounted - read only though. > 5. Upon receipt of a replica dataset, save the 'canmount' property (for > restore). If it is 'on', set it to 'notauto'. No need. > 6. Upon receipt of a replica dataset, save the 'readonly' property (for > restore). If it is 'off', set it to 'on'. Yes. It is also necessary to check to see whether the target pool has enough space and if not throw a few more logs on the fire. > 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. This is where the boot script to restore the altroot settings comes in - but it has to run before zfs attempts the mounts. -- Steve O'Hara-Smith