It's seven years later now, but I eventually can add something. Below the accepted answer, there is a discussion about whether or not zfs receive -F
removes snapshots which don't exist in the source from the target.
From man zfs
(debian buster with ZFS on Linux, vanilla and up-to-date at the time of this writing), in the section about zfs receive
:
-F Force a rollback of the file system to the most recent snapshot before performing the receive operation. If receiving an incremental replication stream (for example, one generated by zfs send -R [-i|-I]), destroy snapshots and file systems that do not exist on the sending side.
According to this, if -F
has given to zfs receive
, snapshots are removed at the target if they are not present in the source if and only if -R
has been specified by the sending side. In this case, not only snapshots, but also file systems are removed at the target if they don't exist at the source.
As an additional remark, if the stream received is a full stream (in contrast to an incremental one), a new file system is created at the target. This is equivalent to destroying the file system at the target first it it exists, and to re-create it, which of course also will remove all existing snapshots and descendant file systems.
From the very same passage in man zfs
:
Creates a snapshot whose contents are as specified in the stream provided on standard input. If a full stream is received, then a new file system is created as well. Streams are created using the zfs send subcommand, which by default creates a full stream.