Per title. From quick googling, I understand that zfs is a filesystem that provides some kind of software RAID and resiliency (eg CRC checks at the block level). Is my understanding right that it just good for detecting storage corruption, but not really self healing?
My home server just for a mini storage/ media server and I am broke to afford RAID. So at the moment, it’s just 2 consumer grade drives .
So pros with zfs I can think of, I get slightly better data resiliency.
But after reading the docs, the cons for me are that a) it’s not so straightforward/ somewhat complex to tune and use, b) it’s not default in mainline linux, and c) slightly lower performance?
What do you think and is it worth learning to use it vs just slapping a plain xfs/ ext4 ?
I’m happy with ZFS, on Debian it’s not that complicated to set up I’d say. Just make sure your consumer drives are not DM-SMR drives, otherwise the performance is bad, especially when “scrubbing” (data integrity verification) or “resilvering” (updating a disconnected, or replacing a failed drive).
See here for more info.
I love ZFS, and you don’t have to get deep in the technical stuff to enjoy the basic benefits. I’ve used it via TrueNAS, and it’s super easy to get set up.
I think BTRFS is easy enough (included in the kernel, pretty stable) and has most of the practical benefits of ZFS with little overhead. I like the snapshots and FS compression
I like ZFS but I don’t like striped RAID for most home applications. The problem with striped RAID is that if you lose parity + 1, you lose all the data on all the drives. I use Unraid, which is unstriped RAID. Meaning if I lose parity + 1, I keep all the data on the unaffected drives. It’s also much more flexible, meaning I can mix and match drives of different sizes, and easily expand the array over time as required. If this interests you, SnapRAID is free and does the same thing. In fact, it’s even better, as it offers bitrot detection.
With only two drives you don’t need to worry about RAID yet. Maybe with three+, where one drive becomes your parity drive. So if a drive dies, you can replace it and not lose your data. It’s a terrible time to be leaning into this hobby given the price of HDDs.
Big zfs proponent here.
So as I understand you want to do software raid, don’t bother with zfs. Just use standard lvm and whichever fs you like to make your mirror.
Also it’s not just a Filesystem (so it’s far more). The best description I once saw that it is a layering violation and that’s actually a great description and also pro/con depending on your viewpoint. You can basically manage any storage any way you want. If that’s a good thing is up to you.
I use both in my Proxmox cluster: ZFS on the big storage node, LVM-thin on the smaller ones. ZFS is worth it where you want snapshots, send/receive and checksums, but it wants RAM and you should plan the pool layout up front. On small boxes LVM-thin is simpler and does the job.
Worth it 100%. Even for single-drive systems like laptops. It allows for a trivial full system backups while the system is running.
Both ZFS and BTRFS require having at least 2 copies for healing, however, unlike a standard RAID1 that is oblivious to which of the 2 copies is healthy, the 2 filesystems use CRC checksums to figure out which is corrupt and recover the good one. As long as you have at least 2 copies, they will check the checksum on every read and heal it if corruption is detected. Besides that, you’d schedule a periodic scrub to also check the data that hasn’t been read in a while.
In ZFS you can tell it to keep 2 copies of everything even if you only have 1 drive, which would give you the healing effect, but this obviously halves the drive capacity, and does not save you if that 1 drive dies, hence spreading it on multiple drives is better.
Personally, I find ZFS easier to use than BTRFS, it’s not that complicated once you get the hang of it, plus LLMs can help anyway. It does have many dials that can be tuned, but unless you are trying to optimize it for a specific usecase, the generally recommend setting are fine for most use cases.
It’s not built into the kernel, but server distros (e.g. Ubuntu) build it as a loadable module, which is kept in step with the kernel, so generally no issues there. On distros like Arch it can be really annoying though.
“Slightly lower” is a bit of an understatement, both for ZFS and BTRFS. Those are CoW (Copy on Write) filesystems, so they are much slower to write, which is a traid off for the benefits of CoW. On the other hand, reads are only slightly slower (since CRC is always checked), and thanks to transparent compression, they can be even faster to read.
One downside of ZFS over BTRFS is fragmentation, all CoW filesystems suffer from it, but BTRFS allows you to defragment in place (takes a while though) unlike ZFS.
If you can’t afford storage, the data you want to store is generally compressible, and speed is not critical/priority, it might be woth using ZFS/BTRFS just for the transparent compression to save on space and get more out of the drives you have. I’m using BTRFS on a Fedora system for this reason alone, helps me avoid buying a new SSD 😬
I never had problems with zfs either on Solaris or BSD derivates nor Linux. It just works.
In my experience, RAID 5 has always been poor performance, and at RAID 50 you’re better off just using ZFS.
ZFS’s killer feature (aside from RAIDZ) is silent data corruption protection, which is why its preferred for large pools with many drives or anywhere where data resiliency needs to be very high.
The key here is the pool size, ZFS is only worth running if you have a sizable amount of drives and the system resources (RAM mostly) to run it.
You can run it on a cheap homelab server, and people do, but I wouldn’t recommend it unless you only use it for storage and you get more drives for RAIDZ.
Otherwise, the cheapo method of getting better data resiliency without performance loss is RAID 10 (Or in your case, RAID 1). That’s my default for any consumer grade drives. The cost of half the usable space is just worth the level of protection you get from a drive failure, especially when you’re on a budget (still much cheaper per TB than buying some beefy SAS drives and doing RAIDZ).
Make it a RAID 1 and chuck XFS on it for some corruption protection (or BTRFS, or ext4).
Also, make sure you use smartctl and even consider making a script that runs a test monthly and saves the results somewhere easy. Start a long test of your drives and check the output later (take a couple of hours to a day) to see if it found any errors and look at the error counter stats. A failing drive will have a lot of errors stacked up in the counter, and a failed drive is if the long test fails.
Zfs slaps and it’s so simple it doesn’t really need complex documentation, just get started and don’t fiddle with advanced options until you understand how they work
Thanks to btrfs I learned I had bad RAM that was corrupting files. Nothing was crashing, so I would never have noticed otherwise. 100% would recommend using a file system with checksumming, be it ZFS or btrfs.
it’s not default in mainline linux
This may or may not be a huge con depending on what distro you’re using. I guess a lot of folks like using something like TrueNAS, which I assume takes a lot of the pain of maintaining the ZFS install…
On the other hand, if you want freedom of distro choice… this might be more important to consider… I’m currently blocked on updating my Fedora IoT servers because the ZFS installation (that I had to manually do) some how broke… 😭
btrfs actually being part of Linux seems really nice. I just started with ZFS, so that’s what I know. I actually did look into switching to btrfs last year… but now I don’t remember why I stuck with ZFS… maybe I should check again.
Compression!
If you don’t need raid, you can also get compression from btrfs.
Self healing for bit-rot in files. So if your data is critical it is worth it.
it does report bitrot, but for self healing it needs duplication set up right?
You need a mirror copy so that when it checks the checksum it can go and pull the good copy
Raidz will repair as well.






