Servers

ZFS incremental receive fails with 'cannot receive: filesystem exists' after interrupted replication stream

Environment

Environment

Primary: ZFS on Linux zpool 'tank' (kernel 5.15) sending incremental stream to backup host running ZFS on Linux zpool 'tank-backup' over ssh (zfs send | zfs receive). Replication aborted mid-transfer due to network blip.

Symptoms

Symptoms

Subsequent zfs receive command returns 'cannot receive: filesystem exists' and aborts. Replication process exits nonzero; target dataset left intact with older snapshot. No clear 'resume' progress possible.

Observations

Observations

zfs list shows target dataset present with old snapshot set@rep (older than source). zfs recv -t shows no resumable state. zpool and zfs versions on both hosts reported slightly different build dates but same package version. ssh logs show no application-layer errors other than connection reset.

Already attempted

Already attempted

Re-ran the same zfs send | zfs receive command; tried zfs send -i last_complete_snapshot; attempted zfs receive -F (refused as cautious team). Did not destroy target dataset. Consulted zfs recv -s (resume) which lists nothing.

Question

Question

How can I safely resume or repair interrupted ZFS incremental replication without losing current backup dataset? What checks let me decide between resuming, forcing receive, or creating a new target path?

COMMUNITY RESPONSES

Verified community troubleshooting

1 reply
0
nordicbyte Answer
user
Posted 1mo ago • 0 confirmations

First check snapshots on both systems and whether the receiver has resumable state. On source run: 'zfs list -t snapshot -r tank/dataset' and on target: 'zfs list -t snapshot -r tank-backup/dataset' then 'zfs receive -s' (or 'zfs receive -n -t') to see resumable streams. If resumable is present, resume with the receive resume command. If not, avoid -F blind overwrite; receive into a new dataset name (ssh target zfs receive tank-backup/dataset-new) to preserve current backup, then reconcile. Only use 'zfs receive -F' when you have confirmed the target can be safely rolled back and you have a known-good copy. Verifying: compare latest snapshot names and use 'zfs diff' or mount the new dataset to confirm data. Rollback caveat: -F destroys local changes.

Showing 1 of 1 community responses
AI DIAGNOSTICS

Incident analysis

Updated 1mo ago• Trouble ID

Most likely causes

Receiver has an existing dataset with a snapshot name that conflicts with stream contents (partial earlier receive). 85%
Resumable receive state wasn't written on the receiver because the stream was interrupted before resumable flag was set. 60%
Source and target ZFS implementations have minor feature flag or build incompatibility preventing proper resume detection. 35%

Summary

Interrupted ZFS incrementals commonly leave the receiver with a dataset that conflicts with incoming stream state. Causes include source snapshot chain divergence, resumable stream state not present on receiver, differing ZFS implementation behavior, or an earlier partial receive that created the dataset but didn't complete. Key diagnostics are listing snapshots on both sides, checking zfs receive resumable state, verifying snapshot names and GUIDs, and confirming compatible ZFS feature flags/versions. Forcing a receive (-F) will roll back local data to apply the stream but is destructive; creating a new target dataset to receive into preserves existing backup.

Suggested Fixes

Diagnostic step 1
On source: run 'zfs list -t snapshot -r tank/dataset' and note the most recent snapshot name used for send.
Diagnostic step 2
On target: run 'zfs list -t snapshot -r tank-backup/dataset' and confirm which snapshots exist and their timestamps.
Diagnostic step 3
Check for resumable receives on target: 'zfs receive -n -t' (or 'zfs recv -s') depending on ZFS build; if resumable, use 'zfs receive -s' to resume.