I have been happily using zfsnap with CentOS and ZFSonLinux in a scripted manner similar to how it is described on the web site, but have run into an issue. Unfortunately backups did not run a few days ago, and now I am stuck in an odd situation. I have a series of incremental backups on my backup ZFS server from my main ZFS server and some newer snapshots on the main server. Unfortunately due to the missed backup and automatic destruction of older snapshots on the main server there is no longer a common snapshot between the two systems to perform an incremental send with. i.e. on backup there is:


and on the main zfs server there is:


Is there any way to get them in sync again or do I have to destroy everything on backup and perform a full(there is not enough room for two full backups)? I tried specifying a send referencing the name of snap4 on the remote backup server from the main server, but as the main server does not have snap 4 it cannot calculate the incremental. I also tried to send snap4 from the backup to the main server, but it appears that the only way to do this would be to do it as a full send(not enough room), and I would need to wipe out existing snapshots. The deleting of all your backup history if you get snapshots mismatched seems pretty inconvenient, is there any solution in this scenario?


As you have no common baseline snapshot in your setup, you will not be able to perform an incremental zfs send any longer. You would need to destroy the dataset in backuppool:

zfs destroy -r backuppool/x

and re-send the most recent snapshot to backuppool

zfs send mainpool/x@6 | [transfer magic] | zfs recv backuppool/x

The deleting of all your backup history if you get snapshots mismatched seems pretty inconvenient, is there any solution in this scenario?

The "solution" is simply to not delete source snapshots unless those snapshots have been verified to have transmitted successfully (i.e. show up in the remote's zfs list -tall output). I have no idea if zfsnap will support you with this, but even if it won't, you could use a shell script performing this kind of a check before letting zfsnap delete anything.

  • Ok thank you very much, I suspected as much but was not sure and couldn't find anything googling. I will have to write something to ensure that a common snapshot is kept. For now I have found the issue in my cron jobs that caused this. ( I delete 0 byte snaps as they are silly, but I deleted one that was used as the latest backup after it was sent) – ak907 Sep 17 '15 at 19:04

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.