Network-Attached Storage distros include a barrage of features to enhance the utility of your backup and data archival server. On the file system front, you’ve got the Copy-on-Write and checksum facilities offered by ZFS and Btrfs. For folks with spare storage drives in their home lab, you can put together a reliable RAID cluster, and with enough memory in your NAS, you can even leverage RAM caching to push your HDD (and even SSD) speeds to the next level.​

There are also advanced tools like SMB multichannel and link aggregation, but I’m not going to focus on them today. Rather, I wanted to go over snapshots, a mechanism to safeguard the precious data on a NAS. While they may seem rather simple at first glance, there are a couple of things I do to make the most of my snapshot operations.

What are snapshots, anyway?

A quick and easy way to recover from accidental deletion

In technical terms, a snapshot is a (block-level) image referencing the files in your NAS at a specific point in time. As such, snapshots let you revert your storage server to an older state if (or rather, when) things go wrong. Rather than taking up loads of space like a conventional backup, snapshots hold metadata that points to the original files, making them a lot less taxing on your NAS’ storage capacity.

Combine that with the fact that only the changes to the datasets are saved when you create new snapshots, and it’s clear why they're a lot more space-efficient. So, you can schedule frequent snapshots to ensure your files remain easily recoverable in case of accidental deletions. What’s more, you can even replicate them to other systems (including NAS setups and cloud storage platforms) to make your storage server’s data even more foolproof.

Aggressive snapshots are the right way

I go for daily, weekly, and monthly snapshots

I rely on TrueNAS for the majority of my NAS needs, and the distro has an entire section dedicated to protecting my data from unforeseen accidents (including my home lab experiments). I’m referring to the Data Protection tab, or rather, the Period Snapshot Tasks wizard, which lets me automate the snapshot creation process – and it serves as the backbone of my NAS backup configuration.

I’ve currently set up multiple snapshot operations for my datasets, and they feature different Schedule and Snapshot Lifetime parameters. The former refers to the frequency at which TrueNAS creates new snapshots. So, the daily Schedule creates a new snapshot every 24 hours at 12 am, while its weekly counterpart does so at the start of every Sunday. I’ve configured separate daily, weekly, and monthly Schedules for my storage server, and I probably would’ve gone for hourly snapshots as well, but that seems a little too excessive for a consumer-grade home lab.

Then there’s the Snapshot Lifetime option, which determines the amount of time before the snapshots are deleted. While setting an expiration date for them may seem unintuitive at first glance, you have to remember that new snapshots can occupy quite a bit of space after you’ve made changes to the underlying dataset. Over time, these snapshots can inflate in size considerably, which is why the Snapshot Lifetime feature comes in handy. Me? I’ve configured my daily snapshots to get deleted every two weeks, while my weekly snapshots there for at least two months. Finally, my monthly snapshots remain tucked away on the NAS for two years, so I can revert to my old configuration when things go south.

Use Rsync to save your snapshots to another node

For that sweet, sweet redundancy

Redundancy is vital for a proper storage server, and that’s something I’ve learned from experience. Sure, a couple of snapshots can help you restore your files, but what if your NAS itself gets compromised or breaks down? That’s where Rsync comes into the picture.

If you haven’t heard of it, Rsync lets you sync files between remote systems, and I use this neat service to push my snapshots to a separate NAS lying at a family member’s place (a trustworthy one, of course). My Rsync task syncs my files to the remote server every month, which helps save bandwidth on both our ends.

Leverage cloud sync for essential data

Cloud storage is quite handy for a 3-2-1 snapshot configuration

I tend to rely on self-hosted services for most of my everyday tasks. However, even my home labber heart has to admit that cloud storage platforms are great for keeping essential files safe. While I use Rsync for the majority of my NAS files, I rely on Google Drive for storing some home lab-centric datasets.

And I can pull this off thanks to the Cloud Sync Tasks utility in TrueNAS, which is not only easy to configure but also supports Google Drive without requiring a plethora of config file tweaks or add-on apps. I’ve heard great things about Backblaze B2, and I plan to switch to the platform in the near future.