I’m putting this here to help others but also so I can find how I cloned a zfs pool from one server to another at a later point in time (as in: in a few years).
Situation:
I have three servers: old
, new
and backup
.
old
is being backed up (using sanoid/syncoid) to backup
locally, plus an online backup destination.
The old
server is getting long in the tooth (coming up to running continuously 8 years soon), has a raidz2 6x6TB spinning (data/home) pool, and consumes quite a bit of power. I had to replace one of the disks inside it’s warranty period and I recently had to replace another of the disks as it started spitting UNCorrectable errors.
Local backups are pulled to backup
using my rpi pull backup HOWTO.
Enter new
server. raidz2 6x4TB SSD, more memory, faster CPU and overall half the power consumption. Nice.
Problem (at least for me):
I’d like to clone (for the lack of better words) the pool setup from old
to new
so I can continue to have backup
pull snapshots as if nothing happened. This server is the server you have always looked at. You will proceed (Jedi-mind-trick/hand-wave)
All the documentation for ZFS and sanoid/syncoid describes things in more detail (far more, actually) that I really want.
zfs send
and zfs receive
man pages are not your friends. The syncoid
man page/POD is better, but you need a couple of tries to get it right.
First, temporarily enable root ssh access on the new
server. Step two is to use syncoid
to copy data over:
root@old:# syncoid --skip-parent --recursive --no-sync-snap --sshkey=/root/.ssh/$KEYFILE --sshcipher=aes128-ctr --compress=none tank root@new:tank
Then wait the appropriate amount of hours. The final step is to run a zpool scrub
to confirm that the pool on new
is in good shape before destroying the old
pool.
I picked the aes128-ctr
cipher by testing the transfer performance of scp -c $cipher new:file .
between the old
and new
servers in question. They are on a 10GbE LAN, so bandwidth is more expendable than CPU cycles.
Cipher | BW [MB/s] |
---|---|
3des-cbc | 12.8 |
aes128-cbc | 142.2 |
aes192-cbc | 137.5 |
aes256-cbc | 133.0 |
aes128-ctr | 145.6 |
aes192-ctr | 134.5 |
aes256-ctr | 131.6 |
aes128-gcm | 139.0 |
aes256-gcm | 128.9 |
chacha20-poly1305 | 82.7 |