'ZFS send recursive failing on datasets without the specified snapshot
I have a situation in my current zfs pool that I do not quite understand and also cannot reproduce in a testing environment.
I am trying to send an incremental and recursive snapshot to another a backup system. Let's call the 'from' snapshot x and the 'to' snapshot y. The send fails saying that a certain dataset does not have the y snapshot. Which is correct, because the dataset was created after the y snapshot was created, so it has neither the x nor the y snapshots.
The command and the full error (with substituted names) are:
zfs send -Ri pool1@x pool1@y | zfs receive -F pool2
cannot send pool1@y recursively: snapshot pool1/dataset3@y does not exist
cannot receive: failed to read from stream
In reality pool1 and pool2 have the same name, but are on different machines.
I kind of expect zfs to skip this dataset in its entirety. I cannot reproduce this problem in a testing environment I made with the commands below:
zpool create pool1 sdb
zpool create pool2 sdc
zfs create pool1/dataset1
zfs create pool1/dataset2
zfs snapshot -r pool1@snapshot1
zfs send -R pool1@snapshot1 | zfs receive -F pool2
zfs snapshot -r pool1@snapshot2
zfs create pool1/dataset3
zfs send -Ri pool1@snapshot1 pool1@snapshot2 | zfs receive -F pool2
Does anyone know what I am missing here and how I should solve it?
Thanks in advance.
Solution 1:[1]
My understanding of the error message is that you can't send it recursively because snapshot 'y' of dataset 'dataset3' does not exist, so zfs can't send what partially doesn't exist.
In your scenario you could take another snapshot:
zfs snapshot -r pool1@z
Then you can send the incremental snapshot from x to z:
zfs send -Ri pool1@x pool1@z | zfs receive -F pool2
By doing this you will skip over the snapshot 'y' and your backup system will have snapshots 'x' and 'z'.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Jacobdness |
