Sneakernet Backup

Status
Not open for further replies.

divB

Dabbler
Joined
Aug 20, 2012
Messages
41
Hi,

Is it possible to "zfs send" to a harddrive connected via USB?

I would like to add another backup level in Sneakernet style where a person manually connects a 2TB harddrive in the evening of the 1st of each month. During the night, ZFS snapshots should be moved automatically via zfs send to this drive. On the next morning, the drive should be disconnected and is manually taken to a different location.

Generally this will be controlled by scripts and at the time when the drive is connected/disconnected, the FreeNAS system would be turned off (it is used as a backup server only).

The question is: How to I set this up and how does ZFS deal with ZFS volumes which are only temporarily available? I know e.g., that with LVM in Linux it is not so obvious when and how to remove LVs/VGs etc - it is not hot-plugging intended which probably goes also for ZFS.

My backup scripts already create a snapshot of the volumes after each backup (happens every day) and I would like to send the snapshots.
Ideally I would only send the current snapshot and only incremental changes since the last "zfs send" are sent and stored on the drive. So I would like to not only have a backup of these data but also an archive (as long as there is free space on the drive).

What I am also unclear is what happens if I delete a snapshot on my FreeNAS system which has previously been sent to the drive. Would incremental transfer/storage then still work?

Thanks!
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
First of all, you'd better not have the machine always shut down when it's not directly doing something user-facing. Scrubs, SMART tests, etc. need to be run.

Now... Yes, it is theoretically possible to replicate to a local USB drive. However, keep in mind that USB has some important limitations, especially when dealing with FreeNAS and ZFS. You can export and later import the pool (in this case made up solely of the single drive), but it's a very manual process.
 

divB

Dabbler
Joined
Aug 20, 2012
Messages
41
1.) I know that and I may use FreeNAS not exactly what's intended for. For me, it's a 100% pure backup machine (most volumes mounted with iSCSI, some rsynced). I care about power consumption, so the box is definitely only on for 1hr a day. I run scrubs manually (and should probably do SMART as well).

2.) But do you have a pointer? In particular my questions? (e.g., How do I manually add or remove ZFS pools? How do I properly call "zfs send" in this case? What happens if I send a snapshot "1st February" to the HDD, then delete it on the FreeNAS box and then send the snapshot "1st March" to the HDD? Will still only be the changes between 1st Feb and 1st March be stored, no matter how many snapshots I create/delete in between?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
Well, you can do everything you want from the WebGUI, but it will be messy. As we don't condone or even recommend using the CLI my advice is to go to the FreeBSD documentation for your answer.

Sorry, but I don't want to give future readers the idea that this is something that should be done. It really shouldn't and unless you have the experience with FreeBSD CLI to do I'd expect that when you think you are going to need the backup on this drive is precisely when you are going to figure out you've done something wrong and your backups really aren't worth anything.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Yes, you can zfs send to a USB-connected drive. You would import it, do your zfs send/zfs receive, and then export it--as far as zfs is concerned, a USB drive is no different from any other drive. Practically, of course, it is, and there are concerns with the reliability of the USB interface for this task, but that wouldn't affect the mechanics of how to do it.

Not sure about the issue of deleted snapshots on the source machine.
 

hunter

Explorer
Joined
Nov 24, 2013
Messages
94
Yes, have been doing what you asked about for quite a while, just to have a backup that is not 'hot', but I never created scripts. I have my system create snapshots once/week. Then I just use zfs send commands to put the incremental snapshots on the drive. I use the esata interface instead of USB. Look in the freeNAS manual for replicating zfs snapshots and you'll see the format for the commands.

Sent from my Nexus 7 using Tapatalk
 

hunter

Explorer
Joined
Nov 24, 2013
Messages
94
I'd rather have zfs replication tasks to replicate the snapshots to two different systems, but it will only replicate them to one location so I just do the other location, my connected, imported, esata drive, by hand.

Sent from my Nexus 7 using Tapatalk
 
Status
Not open for further replies.
Top