Backing up a ZFS filesystem across the LAN

Started by RobbieThe1st, September 26, 2011, 07:51:16 AM

Previous topic - Next topic

RobbieThe1st

Ok, so here's the situation:
I have my main PC, with a 1.0TB ZFS raidz pool, and four zfs filesystems on it:
NAME                 USED  AVAIL  REFER  MOUNTPOINT
mainDrive            588G   513G  49.3K  /mainDrive
mainDrive/data      8.21G   513G  8.07G  /mainDrive/data
mainDrive/media     34.2G   513G  34.1G  /mainDrive/media
mainDrive/recovery   546G   513G   546G  /mainDrive/recovery

This system's running Debian x86_64, and a GIT version of zfsonlinux. It's a quad-core, so no power issues here.
I have this system making nightly snapshots of each of the 3 bottom filesystems.

I have my backup server, a P4 3.2ghz system with gigabit ethernet and 3 2TB drives, setup as a 4TB MD raid-5 with EXT4 on it. It's booting off a CF card, which allows me to have no issues whatsoever with the GPT partition tables on my 2TB drives.
Obviously, this system is /somewhat/ underpowered, but it should be fine -- if a bit slow -- for what I want to do.

Now, what I'm trying to do is figure out some way to backup my drive -- and some of those snapshots -- to this backup server.
what I'd like to be able to do is keep a week-old backup on there, copying over snapshots as they reach one week old, and somehow integrating them into the image on that PC. I figure being able to keep snapshots /as snapshots/ on that PC for several months would be nice, but isn't required.
Also, I don't need to be able to mount the drive on that computer, as I shouldn't need it unless the catastrophic happens.
Now, I'm not worried too much about huge amounts of changed data - Files are added fairly often, infrequently changed, and rarely deleted, and the ones which are changed are typically scripts and such, and very small.

So, with that setup in mind, can any of you give me some ideas on how to set this up?
Should I: 1. have a ZFS setup on the backup system and all that entails, or some different solution?
I could, I suppose, setup a large loopback file for ZFS, share that across to my PC via NFS, and do all the ZFS stuff on the PC side, but I don't know if there's a better option.

Also, what's the best way to get the snapshot data over the LAN to the other PC? ssh? netcat? NFS?


Thanks,

-Rob

Pasteris.ttf <- Pasteris is the font used for text in DMFA.

Tapewolf

I'd try sending Fibre a PM - he's used OpenSolaris and might have the ZFS know-how which I lack.

J.P. Morris, Chief Engineer DMFA Radio Project * IT-HE * D-T-E


RobbieThe1st

Fair enough... Who's this Fibre, though? I can't say I recognize the name...

Pasteris.ttf <- Pasteris is the font used for text in DMFA.

Tapewolf

#3
Quote from: RobbieThe1st on September 28, 2011, 08:05:57 AM
Fair enough... Who's this Fibre, though? I can't say I recognize the name...

http://clockworkmansion.com/forum/index.php?action=profile;u=2006
...he tends to lurk a lot, but he certainly knows his stuff.  Whether that extends to ZFS I can't say.

J.P. Morris, Chief Engineer DMFA Radio Project * IT-HE * D-T-E


Fibre

I have ran ZFS on FreeBSD for several years on a few systems and managed backup for them. There are pretty much two main approaches to backups on ZFS, neither clearly better than the other.

The native ZFS approach is to use snapshots and 'zfs send'/'zfs recv'. This is very efficient, preserves snapshots, and gives you all of the advantages of ZFS through your entire storage system. However it requires ZFS on the backup target (either native, or something like your NFS suggestion, though I'd prefer iSCSI over NFS for that). It also requires careful snapshot management on both ends or you can get yourself into big trouble. This is the method I use, and I've been very happy with it. I use daily snapshots transported over SSH to an off-site backup system.

The other option is to treat it like any other generic filesystem, and stick with the traditional backup tool you're using. You won't have snapshots replicated to your backup target, and it's probably not going to be as efficient. However you can obviously use any filesystem on the target, and there is a safety argument there. If you're not committed to ZFS (or not just wanting to play with ZFS on a toy dataset), I'd probably recommend this route, at least to start out.

Hope this gives you something to think about at least, let me know if you have any more questions for me. Would be curious to hear about your eventual setup. :) Looks like things have progressed with ZFS-on-Linux!

RobbieThe1st

I'm going to try the first method, I guess. I did a cursory look at iSCSI, but I'm not sure it'd let me have access to one partition from more than once place(e.g. my PC and the backup server) at the same aproximate time.

As far as whether to go with remote-ZFS, or local ZFS with remote drives, I guess I have to determine whether a P4 has enough capacity to handle it fast enough to mean something.


Also, lets see. ZFS-on-linux: So far, it's seemed great. I actually installed it on my backup server earlier, attempting to get it to work, but it dropped one drive twice(in two days) and I had to export/import the array; I decided that was a problem, and went to a standard MD raid-5.
...I then learned the problem was a loose SATA cable. Turns out, it'd work, but kept having errors. ZFS-on-linux was doing the right thing.

I'll let you know how things go, what sort of speeds I get, etc.


Pasteris.ttf <- Pasteris is the font used for text in DMFA.

ShadesFox

If you go with the traditional backup tools make sure that you do a backup off of a snapshot.  Makes it much easier to get a backup in a consistent state.
The All Purpose Fox

RobbieThe1st

Quote from: ShadesFox on September 30, 2011, 08:19:13 AM
If you go with the traditional backup tools make sure that you do a backup off of a snapshot.  Makes it much easier to get a backup in a consistent state.
That's actually a good point, and something I'd forgotten about. With ZFS, what's the best way to do just that?
Do I need to clone the snapshot into a temporary name, then copy? Or something else?

Pasteris.ttf <- Pasteris is the font used for text in DMFA.

ShadesFox

In ZFS that is just automagic.  You make a snapshot with something like 'zfs snapshot tank/home@backup' and then (I'm assuming that you named the zpool home and have it mounted at /home) there should be a directory called /home/.zfs/snapshot/backup/ that will have the entire contents of /home as it was right when you made the snapshot.  You copy out of that.
The All Purpose Fox