[zfs-discuss] Incremental snapshot cannot be received "cannot restore to XXXXX: destination already exists"

Richard Elling richard.elling at richardelling.com
Mon Dec 11 15:40:45 EST 2017


> On Dec 11, 2017, at 9:41 AM, Phil Harman via zfs-discuss <zfs-discuss at list.zfsonlinux.org> wrote:
> 
> It doesn’t work because the snapshot already exists AND it is needed for the incremental receive to work.
> 
> I suspect the blogger didn’t test their example. But in any case, the rename approach is rather clumsy.
> 
> Better solutions generally include date and time in the snapshot name, so there’s no need to rename anything, and it’s much easier to know exactly what you’re sending (and what is required to receive it).

Even better solutions include metadata as user properties and don’t mangle the name.
Indeed, the date and time are redundant with existing metadata.

> 
> It’s a very simple matter to find the “newest common snapshot” between sender and receiver (when deciding what to send and what not to destroy).

yep, and this is a required feature of any comprehensive automated send/receive solution
 — richard

> 
> On 11 Dec 2017, at 15:40, explosive <explosive.tom at gmail.com <mailto:explosive.tom at gmail.com>> wrote:
> 
>> Thanks Phil, renaming both the source and destination snapshots has made it work.
>> Can you explain why I need to rename the snapshot on the usb drive as well? The tutorials that I found only seem to show the source snapshot being renamed. (e.g. https://bipedu.wordpress.com/2015/12/24/incremental-backup-of-freenas-zfs-volume-on-external-drive/ <https://bipedu.wordpress.com/2015/12/24/incremental-backup-of-freenas-zfs-volume-on-external-drive/>)
>> 
>> On 9 December 2017 at 12:13, Phil Harman <phil.harman at gmail.com <mailto:phil.harman at gmail.com>> wrote:
>> Your initial receive created backup_usb_2tb_1/audio at usb_backup. You need to rename that too before the incremental receive will work.
>> 
>> > On 9 Dec 2017, at 11:38, explosive via zfs-discuss <zfs-discuss at list.zfsonlinux.org <mailto:zfs-discuss at list.zfsonlinux.org>> wrote:
>> >
>> > Hi,
>> >
>> > I have a zfs pool (named "marvin") on my home server. I want to send individual snapshots of various volumes from marvin to a USB external drive that I have created as a pool ("backup_usb_2tb_1").
>> >
>> > I have create snapshots and sent them to the usb drive as so:
>> >
>> > zfs snapshot marvin/audio at usb_backup
>> > zfs send marvin/audio at usb_backup | zfs receive -dF backup_usb_2tb_1
>> >
>> > which has created the snapshot on the backup pool as (backup_usb_2tb_1/audio at usb_backup)
>> >
>> > I have then renamed the snapshot on my main pool:
>> >
>> > zfs rename marvin/audio at usb_backup marvin/audio at usb_backup_old
>> >
>> > and tried to send the incremental changes:
>> >
>> > zfs send -i marvin/audio at usb_backup_old marvin/audio at usb_backup | zfs receive -Fd backup_usb_2tb_1
>> >
>> > but I get this error message: "cannot restore to backup_usb_2tb_1/audio at usb_backup: destination already exists"
>> >
>> > I have also tried without "-F" on zfs recv but I get the same message.
>> > Any ideas what I am doing wrong?
>> >
>> > Thanks,
>> > Tom
>> >
>> > _______________________________________________
>> > zfs-discuss mailing list
>> > zfs-discuss at list.zfsonlinux.org <mailto:zfs-discuss at list.zfsonlinux.org>
>> > http://list.zfsonlinux.org/cgi-bin/mailman/listinfo/zfs-discuss <http://list.zfsonlinux.org/cgi-bin/mailman/listinfo/zfs-discuss>
>> 
> _______________________________________________
> zfs-discuss mailing list
> zfs-discuss at list.zfsonlinux.org
> http://list.zfsonlinux.org/cgi-bin/mailman/listinfo/zfs-discuss

--

Richard.Elling at RichardElling.com
+1-760-896-4422



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.zfsonlinux.org/pipermail/zfs-discuss/attachments/20171211/c0712f1c/attachment.html>


More information about the zfs-discuss mailing list