How to migrate ZFS pool to another ?

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

qwrty

New Member
Jul 18, 2018
21
3
3
Hello everyone,

what's the best and easiest way to migrate a RAIDZ pool to another ?
I'm running 8x6To RAIDZ1 and I would like to migrate the content to a new RAIDZ1 pool (8x12To)
Both datasets are localon the same host.

zfs send and recv ?

Thank you
 

CyklonDX

Well-Known Member
Nov 8, 2022
784
255
63
Yes, but create a snapshot first.
(so zfs snashot then snd/rcv, the send/receive only works on snapshots.)

You can also run rsync -rptgovc, if you changed segment size, block size, compression etc - this might be better approach. Or you can just do scp or mv/cp
 

qwrty

New Member
Jul 18, 2018
21
3
3
Thank you.

I don’t have played so much with snapshot.
Only at the beginning but my pool was not big.
But admit my pool contain 30To of data, which size will have my snapshot ?

Auto answer: Size will be zero, but if I made change, size will change according to the file which will be add/delete after the snapshot.

Snapshot keep pool settings (block size, compression, etc...) and replicate it to the new one if i use snd/rcv ?
 
Last edited:

CyklonDX

Well-Known Member
Nov 8, 2022
784
255
63
i'm not sure, but i think this transfer keeps properties like compression, blocksize etc.
 

gea

Well-Known Member
Dec 31, 2010
3,141
1,182
113
DE
i'm not sure, but i think this transfer keeps properties like compression, blocksize etc.
ZFS sends data uncompressed and recsize is inherited also from destination parent filesystem (or can be forced on zfs receive). Compared to rsync zfs send is faster on an initial send and much faster on incremental syncs (zfs send can sync Petabyte filesystems under high load with a minute delay). On Solaris based systems with Windows ntfs alike SMB ACL, only zfs send can preserve ACL as extended ZFS properties (using Windows SID instead Unix uid/gid), rsync can not.

You can preserve some properties like encryption with a raw send (Open-ZFS not native ZFS).

To send, create a snapshot and send to a ZFS destination filesystem,
Sending and Receiving ZFS Data - Oracle Solaris ZFS Administration Guide

ex
zfs send tank/data@snap1 | zfs recv pool2/ds01

If you simply want to go from 6Z disks to 12T disks, you can also replace disk by disk. After last replacement you can use the new capacity when autoexpand is enabled.

btw
With such a capacity I would use Z2
 
Last edited:

qwrty

New Member
Jul 18, 2018
21
3
3
Yes, I know the trick with autoexpand, but it's a very long process, I dont like it.

I go with snd & rcv:

zfs snapshot tank1@backup
zfs send tank1@backup | pv | zfs receive -F tank2 (-F to force erase the filesystem to the target if fs already exist)

Regarding Z2 vs Z1, there is no important data, so dont really care if I loose the pool, all data can be re downloaded, so I prefer capacity.

Thank you :)
 
Last edited:

ericloewe

Active Member
Apr 24, 2017
293
128
43
30
Yes, I know the trick with autoexpand, but it's a very long process, I dont like it.

I go with snd & rcv:

zfs snapshot tank1@backup
zfs send tank1@backup | pv | zfs receive -F tank2 (-F to force erase the filesystem to the target if fs already exist)

Regarding Z2 vs Z1, there is no important data, so dont really care if I loose the pool, all data can be re downloaded, so I prefer capacity.

Thank you :)
You can replace all the disks at once, and since you seem to have enough room for a whole separate pool...
 

qwrty

New Member
Jul 18, 2018
21
3
3
Like I said, it's a very long process (scrubing at each disk change), and involve a very high stress for the HDD.
I dont like it, i prefer delete and recreate pool, as my pool contain only bigfile,the copy to the new pool is very fast.
24To copied in only 9 hours with the send and rcv.