When setting up your network-attached storage (NAS) device, you have a few options for the filesystem. You could choose to run absolutely anything you desire, but I'm here to tell you that the correct choice is actually the Zeta File System (ZFS). You'll often come across Btrfs, NTFS, and Ext4 on your travels, but ZFS is the way to go if you wish to maximize availability, reliability, and data storage redundancy. I'll cover data integrity checks, ZFS's Copy-on-Write (COW) design, compression, scalability, and advanced caching.Once at the end, you'll agree that ZFS is the best filesystem for your NAS.

Copy-on-Write nature

A better way to store data

ZFS is designed so that writes are never done in place. Unlike journaling file systems, ZFS doesn’t modify the data stored in the blocks when you overwrite some files. Instead, it creates an entirely new block and modifies the metadata of the updated data to link to the newly created block. Many operating systems use COW for handling physical memory, but it can be used for storing data, and ZFS makes great use of this approach.

The worst NAS scenario is to lose a single bit of data. COW also helps reduce the risk of data corruption caused by power outages or unexpected system halts during data writes. The sole purpose of your NAS is to store data (and lots of it). It only makes sense that we use one of the best-equipped filesystems for the task, though some could consider ZFS overkill for specific tasks.

Enhanced snapshots

Never miss a beat

One of my favorite features of ZFS is the ability to create instantaneous snapshots of data, which require no additional space on the drives, outside of changes. This allows you to make local backups of data on the NAS itself with versioning and rollback support, allowing you to not only track how data changes over time, but also allowing you to travel back to an earlier snapshot.

These snapshots can also be cloned, which is exceptionally handy for provisioning and testing. What's most important of all is not to consider this a robust backup solution. Snapshots are great, sure, but they alone fall short of a healthy 3-2-1 backup strategy. We've covered this extensively here at XDA and stand by the notion of having multiple backup copies at all times.

It's super flexible

Grow your NAS

You'll likely outgrow your NAS eventually. Whether this happens to be the installed drives or the raw supported capacity of the enclosure itself. ZFS has no trouble with either problem and can be worked with to create an expansive solution. With ZFS selected, you can easily have huge storage pools that can accommodate growth through new vdevs and RAIDZ.

Whether you're starting small or have petabytes of data, ZFS can easily handle it and so much more. Simply add new vdevs, stripe new data across the pool, and you're good to go with the new configuration. Some things to bear in mind, however, include the lack of any automatic rebalancing for old data already saved on the pool, and the overall redundancy will be affected by the newly added vdev(s).

Then there's compression, encryption, and deduplication. The first is great for saving space, much like you would when archiving files. Encryption is great for sensitive data. But deduplication is also rather handy by eliminating redundant copies of the same data, which can be invaluable when freeing up space — though you should always back up your data.

It can (quite literally) heal itself

The healer of the RAID group

When a file is moved to a ZFS pool on a NAS, end-to-end checksums are created for the data and metadata. These are then used to check for errors within the data itself. Should an issue be detected by the filesystem, it will automatically attempt to repair the data with the help of mirrored datasets. You can even configure ZFS to periodically perform data scrub tasks to check the integrity of stored data.

This can help prevent bit rot from ruining your day, and using ZFS with ECC memory would offer substantial protection against localized data loss. Bit rot is a serious problem for long-term storage. By using ZFS, you can ensure your cold storage is protected against gradual decay.

No RAID? No problem!

RAIDZ all the way

 
Credit:  

Don't want to lose any data, should one of your drives fail? That's where a Redundant Array of Independent Drives (RAID) can work alongside ZFS to safeguard your NAS from data loss. By forming a RAID with multiple drives, you can leverage them in striped, mirrored, parity, or hybrid setups. ZFS is one of the best options if you’re planning to use complex RAID configurations on your NAS.

Beyond conventional RAID types like striping and mirroring, ZFS also lets you set up RAID-Z storage pools. Operating systems developed around ZFS, such as TrueNAS Scale, can even allow for special DRAID modes, which is more than what you can do with other filesystems. I've relied on ZFS for years to handle data, be it media, sensitive files, and backups, and have yet to encounter a single problem that wasn't human error.

ZFS really does it all

Unlike some of its competitors, ZFS is not simply a system for storing files. It's also a volume manager, making the whole process of creating and managing storage that much easier. Although it typically has beefier specification requirements, it's worth considering for all the benefits that come with it, including automatic mounting, enhanced redundancy support, and incredible scalability.

If you're considering using a NAS OS like TrueNAS, note that this software is built around ZFS. You'll find native ZFS integration, easy storage management, and plenty of features to ensure you don't lose a bit. That's what a NAS should be: something you can set up and forget.

ZFS works well with NAS

If you care about your data, you'll want to use a filesystem that's both reliable and resilient, making your NAS the best place to park all your sensitive files. Thankfully, there's not really a "wrong" choice when it comes to the underlying method to store data. So long as the filesystem suits your needs and requirements, you'll be good to go. ZFS simply takes it to the next level for network storage.