Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Help with ZFS replication

Featured Replies

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

Solved by JorgeB

  • Community Expert

Do you want to replicate the complete filesystem or just the latest snapshot?

  • 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.  

  • 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.

  • Author

Thanks that seems to have worked perfectly.

If you remove the @last_snapshot, will it send the entire dataset including all snapshots?

 

  • 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.

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 by foo_fighter

  • 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.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.