Questions about zfs send and snapshots

New to OpenZFS on OS X (Or ZFS in general)? Ask your questions here!

Questions about zfs send and snapshots

Postby Sharko » Sat Apr 28, 2018 11:26 am

So, I'm in the process of replacing my spinning disks with an SSD, and I have a question about whether it is possible to either to transfer responsibility for a send from disk A to disk C, or else reverse the direction of a send.

Here is the scenario: I have a zpool 'tank' that is the master now, and I've been sending snapshots of dataset 'tank/ZHOME' to a pool on a backup disk 'ELITE'. They're just monthly snapshots (originally quarterly), so there are about a dozen of them that now exist on both the tank/ZHOME dataset, and the ELITE/ZHOME dataset. So far, so good.

Now I want to replace the spinning disks that host the 'tank' zpool with an SSD, but I would like to be able to continue to send snapshots from the new SSD to the same backup dataset 'ELITE/ZHOME'. Is it as simple as:

- make one final snapshot @April2018 on the tank/ZHOME
- zfs send @April2018 incrementally to 'ELITE/ZHOME'
- zfs send @April2018 (full send, not incremental) to SSD/ZHOME
- swap hardware around, switch my user directory to SSD/ZHOME
- do some work for a few weeks
- now take snapshot on SSD/ZHOME@May2018
- zfs send -i @April2018 SSD/ZHOME@May2018

That last line is intended to send incremental between the April snapshot and the new May snapshot, even though April was originally sourced from a different pool; in other words, does a receiving pool keep track of the unique ID of the originating pool, and refuse to accept any snapshot updates from any other pool? Or does a snapshot have a unique ID that travels along with it across sends, and allow it to accept an incremental snapshot send from a different source than the original, so long as the snapshot is preserved?

Another scenario that tests similar concepts: currently I'm doing sends from tank/ZHOME to ELITE/ZHOME; if I do a send from ELITE/ZHOME to SSD/ZHOME can I later turn around the direction, and do incremental sends back from SSD/ZHOME to ELITE/ZHOME as my ongoing backup strategy?

Thanks for your thoughts.
Sharko
 
Posts: 230
Joined: Thu May 12, 2016 12:19 pm

Re: Questions about zfs send and snapshots

Postby macz » Sun Apr 29, 2018 8:57 am

don't take this as gospel

but I am pretty sure that the pool name does not factor in if you are incrementing a dataset


when you do a send / receive to the SSDs to replicate the origin dataset.. as long as you also include at lest one additional snapshot in the send (or all of them) you should be good.

bottom line.. when the dataset lands on the SSDs, in order for it to increment to the existing backup.. its meta has to be the same and it has to have matching existing snapshot to increment off of.

but don't quote me on it.. you should test the flow with a small test dataset first..

"50% of the time.. it works everytime .... "
macz
 
Posts: 53
Joined: Wed Feb 03, 2016 4:54 am

Re: Questions about zfs send and snapshots

Postby lundman » Mon Apr 30, 2018 9:35 pm

It will work yes, if you send a snapshot over to a new pool, you can send incremental using it from new pool to the 3rd host fine. You can very easily test it by hand, create a new dataset, copy a file into it, and go through the process.

This will work with snapshots, not bookmarks. Not that many people use bookmarks.
User avatar
lundman
 
Posts: 1335
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: Questions about zfs send and snapshots

Postby macz » Tue May 01, 2018 4:00 am

@lundman

yeah.. but that snapshot that you send has to include the previous snapshots that match the last snapshot used to make the send to the backup right..

ie

you make a snap in sept and send it to your backup.. so the current backup is sept.

if you then decided to snap in oct and send it to a new pool.. say pool b.. that snapshot has to include, and then send, the sept snapshot or it will fail an incremental to the backup pool

you can't do an incremental to the sept backup from an oct snapshot unless that snapshot also included the 'matching' sept snapshot that is the basis for the latest backup receive ..

if that makes sense .. ?
macz
 
Posts: 53
Joined: Wed Feb 03, 2016 4:54 am

Re: Questions about zfs send and snapshots

Postby macz » Tue May 01, 2018 4:03 am

they way I would do it would be to..

snap -R pool a... send incremental to backup

send that same snapshot full to the new pool... B

offline the original pool (just in case, keep it until confirming new data and incremental backups work)

touch a file on pool b

snapshot -R pool B

incremental send to backup... mount read only and check that touched file on the backup updated...
macz
 
Posts: 53
Joined: Wed Feb 03, 2016 4:54 am


Return to Absolute Beginners Section

Who is online

Users browsing this forum: No registered users and 8 guests