Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I 1:1 replicate a pool without datasets (same name, mount on target)? #85

Closed
Catfriend1 opened this issue Jul 4, 2021 · 8 comments

Comments

@Catfriend1
Copy link

Hi,

I've successfully used zfs-autobackup to create snapshots at the source pool and replicate them to the target pool.

My source looks like this:

zfs get all | grep mountpoint

pool0                      mountpoint            /pool0                default

My target looks like this:

backup                                    mountpoint            /backup/vm-fs01/pool0          received
backup/vm-fs01                            mountpoint            /backup/vm-fs01/pool0/vm-fs01  inherited from backup
backup/vm-fs01/pool0                      mountpoint            /backup/vm-fs01/pool0          local

I'd like to replicate the current pool0 state from the source to the target, then remove all snapshots, datasets so I'll end up with the current state as /pool0 at the target.

pool0                      mountpoint            /pool0                default

How could I go about this using zfs-autobackup?

Is there an alternative way to convert the existing, replicated last snapshot into the "root /pool0", removing the rest from the target?

Target snapshot state:

zfs list -t snapshot

NAME                                       USED  AVAIL  REFER  MOUNTPOINT
backup/vm-fs01/pool0@fs02-20210704153546   328K      -   813G  -

Thank you.

@psy0rz
Copy link
Owner

psy0rz commented Jul 5, 2021

I think this is related to #41 ?

Keep in mind that the main pool0 cant be replicated, since you have to create it manually on the target in the first place.

@psy0rz
Copy link
Owner

psy0rz commented Jul 5, 2021

Try using --strip-path 1

@psy0rz psy0rz closed this as completed Jul 5, 2021
@Catfriend1
Copy link
Author

@psy0rz Thanks, will try it.

Btw. zfs send (snapshot) | ssh ip zfs recv -F pool0 can replicate the whole pool "as is" to the target pool root.

@psy0rz
Copy link
Owner

psy0rz commented Jul 5, 2021

You're right. So in that case the strip-path might be not enough for you, since it doesnt receive the root-dataset of a pool, only the sub-datasets.

@psy0rz
Copy link
Owner

psy0rz commented Jul 5, 2021

Since your name is Catfriend1, check out this project of mine: https://github.com/psy0rz/meowton/wiki :)

@Catfriend1
Copy link
Author

@psy0rz Pretty cool cat gadget :-)! 🐱

@psy0rz
Copy link
Owner

psy0rz commented Feb 23, 2022

@psy0rz Thanks, will try it.

Btw. zfs send (snapshot) | ssh ip zfs recv -F pool0 can replicate the whole pool "as is" to the target pool root.

Since this is an issue for multiple people, i now improved stripping and added the --force (-F) option.

Also updated the documentation to explain how 1:1 replication works:

https://github.com/psy0rz/zfs_autobackup/wiki#making-source-and-target-paths-look-the-same

@psy0rz
Copy link
Owner

psy0rz commented Feb 23, 2022

pip install zfs-autobackup==v3.1.2-rc2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants