Backing up data FROM FreeNAS

Status
Not open for further replies.

sirjorj

Dabbler
Joined
Jun 13, 2015
Messages
42
Greetings.
I have been running my FreeNAS server for a few months now. Coming from a QNAP box, this has so far been a great experience - much faster, much higher capacity, an extra drive of redundancy, and lower power consumption!

When I had my QNAP box running, I had a shell script on it that was basically some rsync calls that would backup the most important NAS data to a hard drive that was attached in an external docking bay connected to the NAS by E-SATA or USB. The drive itself was formatted by the QNAP box (etx3 or something) and every few weeks/months, I would attach it and run the script to update my backups. The drive would then reside in a fireproof safe.

My question is what is the FreeNAS way of doing this? Basically the same thing? If so, what is the preferred filesystem for the external cold storage drive and how do I format it? Or is there a better way? I seem to recall reading a post somewhere once comparing rsync to some ZFS-based equivalent that showed how much better the ZFS version was because it would recognize moved files and not have to delete/recopy them.

What are my options?

Thanks
jorj
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
what is the preferred filesystem for the external cold storage drive and how do I format it?
ZFS, using the Storage tab in the GUI.
Or is there a better way?
Depends on your requirements. The ZFS-based equivalent is achieve by snapshots and replication.
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
I do exactly what you did, except with FreeNAS and a ZFS formated external disk.
Using a ZFS formated disk you can verify your backup disk(s) using ZFS scrubs.

For my backup senerio, I use 100% command line with FreeNAS. Makes it easier to
cut and paste, as well as script. Others do pure GUI, and some do combination. My
suggestion is come up with a procedure you are comfortable with, test it and document
it carefully.

One comment. For me, I wanted a specific set of ZPool features that was compatible
with ZFS on Linux. Thus, I did not use the FreeNAS GUI to create my pool. I think I
made the pool on Linux, then tested on FreeNAS. Works great and I can perform
restores with either FreeNAS or my various Linux computers, (desktop, netbook or
miniture media server).
 

freenas-supero

Contributor
Joined
Jul 27, 2014
Messages
128
Just to bring an idea to OP, this is something I've been myself contemplating for several months now and I am just about to pull the trigger on this: buy a used 1U server on ebay (as cheap as possible, 16GB RAM, quad core at most) with 4x 3.5in hard drive caddies, and 4x 4TB drives mounted as a single RAIDZ2 pool. Once every 3 or 4 months, I would insert the drives in the backup server, power it up, let freenas mount the pool and a single NFS share (or something better/more convenient with ZFS), then from the freenas box, start a rsync call or a snapshot (or whatever would work best). After backup is done, shutdown the backup server, remove the 4 drives from it and store them offsite.

This is just an idea, and I am wondering how well this would work?
 

sirjorj

Dabbler
Joined
Jun 13, 2015
Messages
42
Thanks for the feedback and suggestions.

I'm guessing a "ZFS-formatted disk" is just a 1-disk pool?

In the case where you do have a ZFS-formatted disk that you occasionally plug in to sync your off-site backup, what does the syncing? One suggestion here mentions "snapshots and replication". How does that work? Would work as well? Are there any documents or tutorials that detail how to do this?

Thanks
jorj
 

freenas-supero

Contributor
Joined
Jul 27, 2014
Messages
128
Im really gonna weigh-in carefully here because I am learning same thing as you, but I'd think a pool replication and snapshot is meant to integrally backup the pool to another location, for failover purposes or clustering? Im sure for backup its also ideal but overkill IMO, especially for home usage. I would not care for replicating my pool because first I like the idea of restarting fresh should something bad enough happen and I needed to restore, and second, I would not backup everything due to too much data (14TB)...

For me the best way would be to backup via rsync the files I need to backup, and restore also with rsync. Im not sure how I would implement this between my freenas server and my future backup server, but I think the best way would be to have a script on the backup server that would mount the proper NFS share from the freenas server, and rsync the files over...

Backup could be done the other way around. Perhaps something in a jail on the freenas server would also work? I would not implement a scripted solution in freenas for fear of breaking something up or interfering with the freenas OS. I hope that make sense. In a nutshell, I believe each thing has its purpose...

For the 1-disk pool, I dont see the benefit of that other than offering CRC. Failure wise, you get nothing. I think a small pool of 4 drives is much better, more money but at least if a drive fails, you have redundency, and ZFS offers you checksum for bitrot protection and such..
 

sirjorj

Dabbler
Joined
Jun 13, 2015
Messages
42
On the QNAP NAS, I would drop an internal WD Green drive into a SATA dock that had USB and E-SATA ports on the back. The dock was connected to the NAS by an E-SATA cable. The NAS would auto-mount the drive to the same mount point (probably as long as no other drives were attached.) I would shell into the NAS and run a shell script that resided on the NAS itself. This script would call a shell script that resided on the drive in the dock (my way to make sure I am not rsync-ing to a destination that is just a directory due to mounting issues). The script on the drive was just an rsync command for each directory on the NAS that I wanted backed up to the drive.

I am perfectly fine with this solution on my FreeNAS NAS - only difference being USB port instead of SATA. My biggest question is how to format the external drive and what filesystem to use? With the QNAP, i think it was ext3 or something. With FreeNAS, would I be best going with a more generic filesystem (UFS, ext, ex-fat) so the data could be readable on a different machine? If so, what all filesystems does FreeNAS support?

jorj
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
If you are going to plug it into freenas, make it ZFS. 1 disk is ok.

As for replication vs rsync, replication is done at a dataset level and rsync can be a little more granular and go down to a folder. Replication will copy the exact dataset, to include all snapshots, rsync is limited to just copying the data.
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
...
For the 1-disk pool, I dont see the benefit of that other than offering CRC. Failure wise, you get nothing.
...

The 1-disk ZFS Pool does offer things;
  1. Checksums for bitrot detection, at the file level
  2. Scrubs let you check all the used disk blocks
  3. Metadata redundancy, (so if a Metadata block goes bad, likely no data lost)
  4. For critical ZFS datasets, use "copies=2" for data redundancy even on 1 disk pool. This also increases Metadata redundancy to 3 copies.
  5. Builtin data compression
  6. Linux supports ZFS quite well, (I am using Linux right now with ZFS as my RootFS). But Linux has less than ideal support for UFS.
All that said, if you can do 2 or more disks in your backup set and use some Pool redundancy,
(Mirror, RAID-Z{1,2,3}), more power to you.

I just cheaped out by using a left over 750GB for the non-media file's backup. And a brand
new Seagate 8TB SMR Archive disk for everything. Using a single disk for backups, (but 2
total, alternated), seems like a good plan for me.
 
Last edited:

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
...
I'm guessing a "ZFS-formatted disk" is just a 1-disk pool?
Yes.
In the case where you do have a ZFS-formatted disk that you occasionally plug in to sync your off-site backup, what does the syncing?
Since my backup can't be snapshot synced to my source, I use RSync for the backups. Later I will add ZPool and ZFS dataset parameter saves as part of the backups.
 

sirjorj

Dabbler
Joined
Jun 13, 2015
Messages
42
Hmm... that snapshot+replication idea looks interesting, but I am bit nervous about it. I read in some 'things to be aware of in ZFS' type document that adding a disk to an existing pool is a very bad thing because it becomes a single point of failure and you cannot remove it so its back up and start over. I'm sure it probably difficult accidentally do that, but since I have very little FreeNAS/zfs experience, the thought of ZFS-formatting an external drive does concern me a bit. I'm guessing it's just a matter of making a new pool (we'll call it 'backuppool') and only assigning the external drive to it. Also, is it easy to 'unmount' and remount a pool once it's made? Again, probably a lot of concern about nothing and if I'd just try it, I'd be fine.

Also, with replication... can you replicate snapshots to an attached USB drive instead of another server? If so, that may be the best solution for me. If not, I may just plug in the drive to my iMac, format it with the OS X file system, and rsync over the network. Crude, but it's at least familiar...

jorj
 

Darkk

Dabbler
Joined
Mar 29, 2014
Messages
32
My backup scheme is bit more complicated than most. I have a 12TB FreeNAS ZFS array with 5TB SMR external USB drive for backups also formatted in ZFS with encryption. I have a cron job that runs the rsync script to backup everything off the 12TB array nightly. I also have a nightly scheduled ZFS snapshots.

This been working well for me.

I have a script on my Linux Mint 17.3 workstation that backs up my entire home directory onto the 5TB SMR external USB drive and then copies it to my 4TB portable hard drive that is encrypted with VeraCrypt which I use as off-site backup.

The reason for using rsync over ZFS snapshots is that my home directory is just data so wanted easy way to restore by selecting the files I want. ZFS snapshots are great at the server level to recover from a disaster such as total drive array failure but not sure how easy would it be to restore a single file from ZFS snapshot?

So I mix both technologies to make best use of it's features.
 

rogerh

Guru
Joined
Apr 18, 2014
Messages
1,111
The reason for using rsync over ZFS snapshots is that my home directory is just data so wanted easy way to restore by selecting the files I want. ZFS snapshots are great at the server level to recover from a disaster such as total drive array failure but not sure how easy would it be to restore a single file from ZFS snapshot?

AFAICS you just make a clone of the snapshot and copy the relevant file to any mounted filesystem. This seems to work straightforwardly, but I suppose I may have missed something.
 
Status
Not open for further replies.
Top