0

I was hoping if you copied the same snapshot twice to the same destination as send | receive that zfs would know it had already done it.

I’m also disappointed that I can send a single snapshot to a dataset, but not send a recursive snapshot, without sending every snapshot ever.

Zfs seems to have an identity crisis.

1 Answer 1

1

I'm assuming that ZFS does not keep track of where snapshots have been sent or where they have been received from. Receiving a snapshot that already appears to exist must therefore be an error as the identically named snapshot doesn't necessarily have anything to do with the snapshot that now is being received (it may have been received from elsewhere, or it may have been locally modified).

You may send snapshots using -R (--replicate) and -I snapshot, as in

zfs send -R -I @earlier tank@latest

This would send all snapshots of the tank dataset between the @earlier snapshot and the @latest snapshot, including descendent file systems.

From zfs-send(8):

-R, --replicate
Generate a replication stream package, which will replicate the specified file system, and all descendent file systems, up to the named snapshot. When received, all properties, snapshots, descendent file systems, and clones are preserved.

If the -i or -I flags are used in conjunction with the -R flag, an incremental replication stream is generated. The current values of properties, and current snapshot and file system names are set when the stream is received. [...]

-I snapshot
Generate a stream package that sends all intermediary snapshots from the first snapshot to the second snapshot. For example, -I @a fs@d is similar to -i @a fs@b; -i @b fs@c; -i @c fs@d. The incremental source may be specified as with the -i option.

3
  • If snapshots are immutable, then they can have a cryptographic hash that fully identifies them. A guid of some sort. The name is not sufficient. I have read the documentation. There are a lot of lumpy semantics. zfs snapshot -r should have a corresponding send. Which is not -R, which sends everything up to the ‘named’ snapshot. The GUID could be calculated during send and retained in the metadata of the received snapshot. There is an overall checksum already calculated during the send. Aug 1, 2022 at 21:09
  • @PeterGoodall The specifics of the implementation of OpenZFS are beyond the scope of this site. If you want OpenZFS developers' input, or want to contribute ideas to the OpenZFS project, I suggest contacting the project using the official OpenZFS mailing lists: openzfs.github.io/openzfs-docs/Project%20and%20Community/…
    – Kusalananda
    Aug 1, 2022 at 21:35
  • Ok thanks- I’ll use the project site. 🙏 Aug 2, 2022 at 23:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .