How do I backup volume pool1/volume2 as pool2/volume2-backup with snapshots?

Status
Not open for further replies.

tofagerl

Contributor
Joined
Aug 26, 2013
Messages
118
I have two or three volumes under pool1 which I would like to duplicate in pool2 - which I am using as a dedicated backup pool. pool1 is a 4-disk raid-z, while pool2 is a 2-disk mirror.

Due to storage concerns I don't want to have snapshots on pool1, but so little of what I have on pool1 is actually worth having a second backup on pool2, that the size snapshots won't be a problem on pool2.

(I also have some stuff only on pool2, for example a time machine backup volume for my macs. But that shouldn't come into this.)

I don't know if I can do this with snapshot tasks in the 9.10 GUI, but I suspect it would be a trivial thing to solve through a cron script - possible even a single line in crontab without using a separate script file.
 

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
Just so you're aware, snapshots don't take up any space if the data they snapshot doesn't change.

You can make the snapshots with the GUI, but you can't replicate them with the GUI. It's pretty easy to do it with a script. For search, the commands are zfs send, zfs receive, and zfs snapshot.
 

tofagerl

Contributor
Joined
Aug 26, 2013
Messages
118
OK, so should I be taking snapshots on pool1 first, then sending it to pool2, and then deleting them from pool1?
 

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
Exactly.

You can automate all the pieces of that with the zfs commands. If you want to get fancier, you could do space checks on the destination pool before sending to make sure it can store it.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
should I be taking snapshots on pool1 first, then sending it to pool2, and then deleting them from pool1?
The disadvantage of this approach is that you will have to send a full snapshot each time. If you keep some snapshots around on pool1, you'll be able to send incremental snapshots to pool2, as long as each dataset has a previous snapshot in common.
 

nojohnny101

Wizard
Joined
Dec 3, 2015
Messages
1,478
I will expand on what @Robert Trevellyan said and say that it seems you don't fully understand the nature of snapshots. As @Nick2253 said, snapshots only take up as much space as the changes do. They are incredibly efficient.

And seeing how you are worried that you don't have enough space to store the snapshots on pool1, does this mean you are operating at over 80% capacity? why don't you want to store the snapshots on pool1?

seems like you want to do something that replication and snapshots will already do but with almost no maintenance on your part. maybe give us more information as to why.
 
Status
Not open for further replies.
Top