Correct way to send/recv this pool?

Stilez

Guru
Joined
Apr 8, 2016
Messages
529
With the advent of 12, I want to send/recv my old 11.3 pool contents to a new pool, so that I can set updated properties on the pool and its datasets which are more optimal for my current use, as well as leveraging the new features in 12, and so that the data will be written fresh, and unfragmented, as well.

In my old pool, some dataset properties got modified over time, and data in place was not updated of course when they changed. I want to end up with the same data, but to update the ways its physically organised on disk as it's written over. So in effect writing it from scratch, resulting in the same structures as the original pool.

My old 11.3 pool looks something like this:

OLD_POOL
DATASET1 (and snapshots...)
DATASET1A (and snapshots...)
DATASET1B (and snapshots...)
DATASET1B1 (and snapshots...)
DATASET2 (and snapshots...)
DATASET2A (and snapshots...)

I know that zfs recv -o updates dataset and pool properties, but I'm not entirely sure the correct syntax overall. I'm also unsure if I can recursive replicate because not all nested datasets have the same properties.

As the dataset properties differ, do I need to replicate each dataset individually, with the correct -o options for that dataset? (There's only about 8 datasets so this is feasible)

If so, what is the correct send/recv command? (both old and new pool are now mounted on the same v12 server, the old pool is read-only)
 
Last edited:

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
properties of datasets are maintained individually even if sent with the recursive command switch.

zfs send -R OLD_POOL@snapshot | zfs recv NEW_POOL

That assumes you have taken a recursive snapshot of OLD_POOL.

From the Oracle manual on zfs send:
You can use the zfs send –R command to replicate a ZFS file system and all descendent file systems, up to the named snapshot. When this stream is received, all properties, snapshots, descendent file systems, and clones are preserved.

I understand that Open ZFS has kept true to that text.
 

Stilez

Guru
Joined
Apr 8, 2016
Messages
529
properties of datasets are maintained individually even if sent with the recursive command switch.

zfs send -R OLD_POOL@snapshot | zfs recv NEW_POOL

That assumes you have taken a recursive snapshot of OLD_POOL.

From the Oracle manual on zfs send:
You can use the zfs send –R command to replicate a ZFS file system and all descendent file systems, up to the named snapshot. When this stream is received, all properties, snapshots, descendent file systems, and clones are preserved.

I understand that Open ZFS has kept true to that text.
From the zfs recv man page, it *looks* like "-o (option)" overrides the original snapshot or dataset property, but I'm not 100% sure. Have I understood correctly?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
it *looks* like "-o (option)" overrides the original snapshot or dataset property,
Well, yes, that's what it's for... although it would need to be applied to each individual dataset if they aren't all to be the same in a recursive send. I would recommend not using it if the intent is to preserve the original properties (What I had understood your post was asking).
 

Stilez

Guru
Joined
Apr 8, 2016
Messages
529
Well, yes, that's what it's for... although it would need to be applied to each individual dataset if they aren't all to be the same in a recursive send. I would recommend not using it if the intent is to preserve the original properties (What I had understood your post was asking).
Original data, file system structures (links, permissions, etc), snaps, acls, etc to be kept. Data storage properties (that affects how its held on disk, not what the content is), such as special vdevs, compression, hashing choices, atime storage, spacemap block sizes and metaslab per vdev count, all overridden.
 
Top