I don’t want to create new snapshots on a pool/dataset, but only want Sanoid to prune the existing ones. This pool/dataset is my backup pool. Syncoid handles the transfer of the snapshots here.
I have therefore set autoprune = yes and autosnap = no in sanoid.conf for this pool/dataset.
Strangely enough, sanoid does not recognise the snapshots present in the pool/dataset and does not prune the old ones.
This only works if I set autosnap=yes. Is that how it’s supposed to be? Or am I doing something wrong?
Sanoid only prunes its own snapshots, it never prunes snapshots taken manually or by other application.
There’s a caveat: currently, this means Sanoid only prunes snapshots in the name format Sanoid uses. But if you match that format, Sanoid will prune that snapshot regardless of how it was taken–Sanoid just assumes any snapshot that precisely follows its @autosnap_YYYY-MM-DD_hh:mm:ss_[monthly|daily|weekly] format must be “its” to manage.
Also note that Sanoid follows different pruning policies (as you configure them) for hourlies, dailies, monthlies, and so forth. If you don’t get THAT part right, again, Sanoid will not prune your snapshot because it doesn’t recognize the periodicity and therefore doesn’t know how old it should be or how many of them there should be before destroying the oldest.
With all that said… it SOUNDS like you’re saying Sanoid took the snapshots originally, in which case they would match the naming format and would be handled properly.
It’s possible you bobbled something in your configs–especially since you didn’t mention using a template. Generally speaking, you probably want to just use the included “backup” template and call it a day (or the included “hotspare” template, if incoming replication is hourly instead of daily).