Back up to connected USB drive

I’m just about ready to use my TrueNAS setup in my home “production” environment, but am wondering about the data backup.

TrueNAS/ZFS “Replication” and “Snapshots” is totally foreign to me.

I do still need to figure out the syncing to the offsite and what method is best (was going to use rsync but am tempted by a versioned backup solution since it’s the last point of backup?)

Anyway, for the local backup, my thought was:

  1. Plug in external USB drive (“connected” 24/7 probably?)
  2. Script to mount the drive, rsync to it, unmount the drive
  3. Cron to run the script nightly

Thoughts on this approach? I kind of like the idea of the Replication Task, as I understand it, but that would effectively require the external drive to be Import’ed and active (mounted?) constantly, which seems less ideal?

I don’t know how all the internals work, but I would think that despite the external drive having power cable to it and USB connected, that once unmounted it can go “fully offline” and sleep, not power-on hours, etc. etc.? Otherwise I think I’d have to manage the backup manually that that’s not going to happen nearly as reliably…

There is an active feature request regarding the USB backup, please take a look:

There are several Resource articles, with attached scripts, that do allow local backups, (including to USB attached disks). I’ve written the first years ago on the old forum:

1 Like

Thanks guys. All those links, as I understand it, seem to be for hot-swappable backup disks. But I am thinking more so just a rsync or maybe even Replication task for it? And, maybe most different from those, my drive would be plugged in to the USB port 24/7. I feel like if it’s not… my backups will become irregular and eventually infrequent enough to be poor backup strategy.

The instructions I wrote can be used on a semi-permanently attached backup disk. Just skip the import and export parts, (which were manual).


One note, USB attached disks are not known to be reliable enough for 24/7/365 operation. For some reason either USB or Linux is just not capable of maintaining a solid, reliable connection to external storage.

People have said it can’t be USB storage because it works perfectly on MS-Windows. That may be true, but it does not change facts for Linux. So, in my opinion, be prepared to deal with your 24/7/365 USB connected drive to drop off occasionally, requiring manual effort to deal with it.

But surely the mounting and unmounting of it help alleviates that?

Or are you saying that at one point for example the disk may not even appear to be mountable? And would then need to be physically unplugged / powered off and reconnected or something?

Actually yes, ZFS export when done, and import before use will probably be okay.

Keep in mind, mounting a ZFS Dataset or un-mounting it, does not affect the pool’s presence on the server. Exporting the pool tells both the OS and ZFS to forget about the pool for the moment.

Some USB to SATA bridge chips are such low quality, that they may do odd things. As @dan said, (I think it was him), USB storage was a race to the bottom, (aka cheap!). Because of that, who knows what firmware or logic bugs exist in those chips?

I saw this in the Feature Request and didn’t feel it needed attention, but that’s up to whoever sees value in it. From my perspective, you can just attach any USB storage to an end workstation and back up the data. Yes, it will not include any snapshots, but snapshots take up storage space. If you need exact duplications, then you might want to look at building a virtual or secondary TrueNAS system that will sync the data across your LAN.

I built a virtual TrueNAS and sync my data using freefilesync as I do not care for the snapshots and just the actual file/folders of my choosing and how it is replicated.

If you are building a virtual Truenas, you’ll want to hardware passthrough the physical disk, and backup the configuration/metadata, so that the disk can be imported to any new instances of Truenas should the original fail.

Maybe zerobyte is a project to have an eye on. Right now it’s in early stage and probably not what i would call “production ready” but is has potential.