High Level Description
So I currently have a convoluted ZFS setup and want to restructure it, reusing some of the existing hardware.
I know that the recommended way of doing something like this is to backup all data, destroy the old pools, create the new ones and restore the data, the question is on how to best do this
The Setup and Details
My current setup consists of 3×1TB and 3×4TB drives set up in the following way Two of the 4TB drives are each formatted in one 1TB and one 3TB Partition.
media_pool
is a raidz1 pool consisting of 5×1TB disks/ partitions (-> 4TB Avaiable, 3.26TB used)three_t_pool
is a mirror consisting of the 2 3TB partitions (-> 3TB Avaiable, 1.93TB used)non_redundant
is a pool just consisting of one 4TB drive (1.07TB used)
Each of those pools has exactly one encrypted dataset spanning the entire pool.
media_pool/media_encrypted
, three_t_pool/backups
, and non_redundant/nr_encrypted
.
My future setup will retire the 1TB drives and add a 12TB drive as follows:
media_and_backups
a raidz1 pool consisting of the 3 4TB drives and a 4TB partition of the 12TB drive ((4-1)×4TB = 12TB avaiable)non_redundant_foo
the remaining 8TB of the big drive.
And encrypted datasets
media_and_backups/media_encrypted
, media_and_backups/backups
, and non_redundant_foo/nr_encrypted
.
(Although keeping the media and backup datasets separate is not a must if this would complicate things)
Now my migration process would probably look like this (With all 7 drives connected to the same machine):
- Format the 12TB drive in the desired 4 and 8TB partitions
- backup the data of the exiting pools/datasets to the 8TB partition
- destroy the old three pools, create the
media_and_backups
pool and corresponding datasets (media_and_backups/media_encrypted
,media_and_backups/backups
), restore them from backup - [Optionally even move the
nr_encrypted
data tomedia_and_backups
, destroy the filesystem on the 8TB partition create a new pool there and restore thenr_encrypted
dataset to there]
But like I mentioned above the part where I'm unsure about is the backup and restore progress
- One naïve method I can think of is to just use rsync, create a folder for each dataset, sync-in all the data, create the pools and datasets I desire and rsync back to those.
- One obvious disadvantage would be that the data would be decrypted on backup and reencrypted on restore
- It just feels wrong how would I for example recognize in-transfer data corruption
zfs send
andzfs receive
seems to be the way to go. But... how would I actually do that?- I read the answer to ZFS send/recv full snapshot but there are some key differences between my setup and theirs:
- They directly create the new pool on the new server I want to first store the backup and then later restore it on the same server
- I have three datasets from three different pools i want to store on the same pool
- Also there's the thing about the available storage: the 8TB (= 7.28TiB) should be enough to hold the 3.26+1.93+1.07=6.26TiB of used data, but of course a 8TB pool would not be able to host 4+3+4TB worth of datasets
- I read the answer to ZFS send/recv full snapshot but there are some key differences between my setup and theirs:
- So I think I should
zfs send
the current datasets into one big file each (or somehow split those into blocks) on the 8TB pool, then when that's done destroy the old pools and create the new ones andzfs recv
from the files to the pools
Is this the best way of doing this, or is there a better/ recommened way?
Or any best practicies for using zfs send
/ zfs receive
.
If I do it this way are there any caveats to watch out for?