Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Oct 2021 06:33:53 +0100
From:      Steve O'Hara-Smith <steve@sohara.org>
To:        David Christensen <dpchrist@holgerdanske.com>
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:  <YVZM1HnPuwIUQpah@ceres.zyxst.net> <ba54a415-da45-e662-73fe-65702c4131e2@holgerdanske.com> <YVcXsF5NFq2abE%2B7@ceres.zyxst.net> <20211001222816.a36e9acbd4e8829aed3afb68@sohara.org> <809e4f3b-9e59-eb53-5b7d-0bcf7e401cd5@holgerdanske.com> <20211002115440.85c4342a49fe6e4573c37dd0@sohara.org> <daf9ba49-82a3-670c-f59c-745e0c315f18@holgerdanske.com> <20211002205504.9d81ee94caa231ee9b008d6a@sohara.org> <69954781-9e3c-ba96-5f1e-9b4043ecf56c@holgerdanske.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 2 Oct 2021 15:09:23 -0700
David Christensen <dpchrist@holgerdanske.com> 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 <steve@sohara.org>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20211003063353.7415d12917f0e514d433ae1c>