ZFS send / recv bookmarks not sent

I am using ZFS send/recv – as part of my script – to send datasets from main server to backup server weekly (manual process). Since bookmarks were mentioned on the podcast, I have changed the script to support bookmarks instead, which has been great because I am now able to remove old snapshots without worrying about deletion and having to manage ZFS holds.

I recently moved a ZFS dataset, which is part of my backup script, to my SSD pool. However ZFS send did not preserve bookmarks. In the end, I created a bookmark from the last snapshot I used manually, so hope that works (cannot see why not).

However, bookmarks were not sent when moving the dataset to another pool on the same server. I understand it would not be useful to send bookmarks, but on this rare occasion it was required.

Did I miss the flag to allow bookmarks to be sent:

zfs send -R --raw hddpool/dataset@XYZ | zfs recv ssdpool/dataset

Thank you!

A bookmark is just the transaction group ID of the “before” state. So it is specific to a pool, it is not possible to replicate bookmarks, since each pool will have its own unique transaction group IDs.

A bookmark can only be used as the starting point for replication, the end point must be a snapshot.

If you do not have any snapshots in common between the dataset you moved, and its remote replica, you will have to re-bootstrap the replication. If the dataset you moved to the SSD pool is the destination for replication, it will work just fine.

If you have a snapshot in common between the two, everything will work fine, and you can make new bookmarks, but once you destroy the old snapshot you created a bookmark from, the data is gone, so it isn’t possible to replicate it to another pool.

2 Likes

Thanks for the detailed reply.

For the record, I have run the backup, just now, and it works flawlessly.

Another reason ZFS is awesome.