August 11, 20241 yr I have been using space invader one's ZFS auto snapshot and replication script to back up the contents of my cache drive to a disk on the array for quite some time and it seems to work perfectly. The problem is that I am a complete noob when it comes to ZFS and replication so it was not very clear to me on how to recover from a lost cache drive. I recently replaced my cache drive and while I was able to get everything moved over by just copying the data it didn't copy it as a data set and I had to recreate them and then subsequently delete the backups on the array because the snapshots didn't match and the script wouldn't overwrite them. I tried using the zfs send/receive command to send the latest snapshot back to the cache drive but I kept getting an error. Is anyone able to give me some insight on how to best replicate the data back to my cache drive in the future? Thanks
August 11, 20241 yr Community Expert Do you want to replicate the complete filesystem or just the latest snapshot?
August 11, 20241 yr Author 2 hours ago, JorgeB said: Do you want to replicate the complete filesystem or just the latest snapshot? I am guessing probably the entire filesystem? Would that bring over all the snapshots associated with the dataset? I imagine that if I were to bring over just the latest snapshot it could prevent the auto snapshot and replication scrip from running correctly.
August 12, 20241 yr Community Expert Solution 7 hours ago, RysXr200 said: Would that bring over all the snapshots associated with the dataset? With full replication yes, you can use zfs send -R backup_pool/dataset@last_snapshot | zfs receive pool/dataset If you use large blocks add -L to the send command, dataset should not exist on destination.
August 12, 20241 yr If you remove the @last_snapshot, will it send the entire dataset including all snapshots?
August 13, 20241 yr Community Expert 11 hours ago, foo_fighter said: If you remove the @last_snapshot, will it send the entire dataset including all snapshots? Not sure what you mean, it will replicate the complete filesystem up to the last snapshot specified.
August 13, 20241 yr 6 hours ago, JorgeB said: Not sure what you mean, it will replicate the complete filesystem up to the last snapshot specified. Okay, just to confirm, let's say the old dataset contained 7 daily snapshots and 4 weekly snapshots. If there was a file that changed daily, all 11 versions the file would be accessible in the copied dataset? Or is only one version of that file from the last_snapshot available? Ah, it seems -R will replicate all snapshots up to the @last_snapshot. Edited August 13, 20241 yr by foo_fighter
August 13, 20241 yr Community Expert 25 minutes ago, foo_fighter said: Ah, it seems -R will replicate all snapshots up to the @last_snapshot. Correct
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.