posted in Selfhosted

Is using zfs really worth the investment vs other filesystems?

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 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 ?

enPage

Replying to @⁨FukOui@lemmy.zip⁩

2 legends about ZFS seem never to die: that it is difficult in normal linux, and that it needs much extra RAM.

Truth is, it is availible in the normal kernel now and several distros offer it from start. There are tools for maintaining it, and after a while, you will find that it needs less routine maintenance that most traditional file systems.

Truth is also that it can absolutely work with less RAM. That thing is only important for servers with a high load. There it is recommended strongly to have lots of RAM, but even there it is not for the sake of ZFS itself, but it is for the performance of your server. It makes good use of all that RAM in ways that other file systems cannot.

Is my understanding right that it just good for detecting storage corruption, but not really self healing?

If you use it on just 1 drive, and the default setting, then this is true. It still detects bit rot, but it cannot repair it automatically. But it has also an option for the self healing on only 1 drive (for the price of drive space then).

If you use 2 mirrored drives, or more as a raidz, the self healing is always there.

Replying to @⁨Zwuzelmaus@feddit.org⁩

Truth is, it is availible in the normal kernel now and several distros offer it from start.

You may want to rephrase this. ZFS license (CDDL) is still incompatible with the Linux kernel (GPL) so it’s not part of the kernel sources and needs to be compiled as an out-of-tree module against the kernel you’re running.

Some distros make such modules available by default with some of their official kernels, some don’t. You can get it installed on most distros but the manner of doing so and the amount of support you can expect from the distro varies wildly. If install/update is a manual operation you run the risk of the module falling out of sync with the running kernel.

Replying to @⁨ShortN0te@lemmy.ml⁩

Mainly what bothers me about the whole approach is the possibility of having the module not load one day, for whatever reason.

I’ve had this happen with out-of-tree modules for other stuff. I’m fine with something like a controller or camera not working, can even cope with the GPU not working. Not ok with not being able to mount a filesystem that all your stuff is on.

Replying to @⁨lemmyvore@feddit.nl⁩

But thats why you dont do that? Either you go for an official package that will be held up to date with your kernel or other system packages or when you for some reason build it yourself or are side loading it, then you automate the process to be triggered during update.

But this is true for every piece of software that depends on specific other software like libraries.

Been running zfs on Debian and Ubuntu for years now and never had to gave it a thought during updates and even between release upgrades.

Replying to @⁨FukOui@lemmy.zip⁩

It’s not that hard to learn. It’s a few commands to set up a pool, vdev and a dataset. The defaults are fine, though you might want to enable compression, set a large block size and optionally enable encryption via parameters.

Contrary to popular myths it’s not ram heavy either, at least with default parameters. This might come from the ram heavy (optional) deduplication or the fact that it likes to use unused available ram for caching (as it should).

With your two disks though you could either mirror them or stripe them. Both are not ideal, it really shines when you have enough disks to use the parity, ie in Z1 you can lose one of your disks without losing data, z2 you can lose two disks. I run it as Z2 with six disks, so any two can fail without losing data and I get the capacity of four disks.

The main advantage of zfs over other file systems is that it will checksum absolutely everything, including your data, and restore it, if possible (at least a mirror or Zx; a simple stripe can not recover anything of course).

Replying to @⁨FukOui@lemmy.zip⁩

I absolutely recommend ZFS. I’ve been burned by MD (the other software RAID) because it doesn’t scan the array for bad data, so bit rot and silent errors can go undetected until a process wants to read it. ZFS periodically scans the array and fixes corrupted data if possible.

ZFS can use more CPU resources compared to MD, but the difference in performance is insignificant compared to the read bandwidth of mechanical hard drives. Memory usage is comparatively high because it uses the RAM as cache, but you can set a limit. My current 8TB RAIDZ1 array uses only 8GB of RAM and it could still be lower.

I recommend using some dedicated OS to manage ZFS pools, like TrueNAS Scale or Proxmox.

pve.proxmox.com/wiki/ZFS_on_Linux

it’s not default in mainline linux

It’s purely an issue of licenses. ZFS is a mature solution, and being out-of-tree does not reflect a qualitative issue. It’s available as a separate package on most distributions.

pve.proxmox.comZFS on Linux - Proxmox VE

Replying to @⁨rtxn@lemmy.world⁩

You cannot compare zfs to md, they are different like apples and oranges.

MD it’s a raid device, not a filesystem.

You should compare btrfs to zfs, they pretty much share the same capabilities and features.

I use MD as my raid array, and btrfs on top of MD.

Of course if you use ext4 on top of MD you get nothing of the good stuff, except a very solid array management due to md.

Replying to an earlier post

Depends on your requirement and hardware really. If you don’t have the RAM for zfs, but a proper RAID controller, just go for raid 6. (The ones crying about raid and dataloss never use a proper RAID controller). If you do not have one, then zfs is a pretty decent choice, but it benefits greatly from having loads of RAM (not required, just very beneficial). If you need something ridiculously large, beegfs is your friend.

For me, personally, I use zfs to serve a volume of 24 physical drives at home. I find that zfs sits in the middle where it’s flexible enough to serve a lot of those intermediate situations where mdraid isn’t enough, you don’t have a (proper) raid controller, and it’s not enough disks/machines to justify beegfs.

With 2 drives I’d just go mdraid.

Replying to @⁨FukOui@lemmy.zip⁩

Personally, I use ZFS heavily, and I’d highly recommend it … but for such a simple system with only two drives and you just want redundancy, ZFS is kind of overkill. The only benefit you might get is the ‘copy on write’ feature, which gives you the ability to mount older snapshots of the drive and potentially recover data that has been deleted or overwritten. (Without unmounting the current version of the partition, you can mount an older version that still has the files that are gone. However, the deleted/overwritten files don’t stay around forever, especially if the drive is nearly full or gets written to often. It’s kind of like a fancy ‘recycle bin’, but it’s smarter about what files to keep shadow copies of – for example, files that existed for longer are more likely to be retained than files that only existed for a brief time.)

Where ZFS really shines is in more complex setups where you want to take advantage of the performance gains. It can do some pretty cool stuff because unlike most other systems, it’s aware of both the layout of the data on the physical drives and the files and filesystem. In most other systems, those two things are handled by different subsystems that aren’t really aware of one another and can’t optimize things as nicely. For example, in a normal RAID system, the data blocks that are mirrored/striped across multiple drives are always the same size. But ZFS can mirror/stripe data blocks of varying sizes, allowing it to better optimize for a mix of small and large files. You can also do cool stuff like designating particular partitions/drives as file directories or caches to further optimize performance. (Great use for that old fast but small SSD you have lying around.)

I got into ZFS with very little experience, and it was actually pretty straightforward to set up. If you want to use it just to learn it, I’d recommend that. But for the very simple setup you want, there are probably simpler solutions if you want something that just works out of the box without needing to configure things in the command line.

Replying to @⁨FukOui@lemmy.zip⁩

It’s my personal opinion but: no

Btrfs is integrated in the kernel already and pretty solid. I have been running it for the last few years. I use Linux mdarray to create a raid5 and on top of it, format btrfs.

Never had issues, and yes it did catch data corruption (and fixed it) so I am pretty happy .

Zfs on the other hand, needs specific kernel patches and I don’t like that too much.

Replying to @⁨Shimitar@downonthestreet.eu⁩

fully agree.

i used zfs on arch many yeara ago and my updates would fall months behind.

then i switched to freebsd for better zfs support. but lost support of some linux apps

later i started using truenas and it works great.

un a related note, i switched to cachyos on my desktoo and laptoo and used btrfs for the first time and i absolutely love it.

so if youre building a nas from scratch, id say use btrfs, but if youre using an os that manages that stuff for you, zfs is a great choice.

Replying to @⁨FukOui@lemmy.zip⁩

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.

openzfs.github.ioHardware — OpenZFS documentation

Replying to @⁨FukOui@lemmy.zip⁩

ZFS shines with large datastores and multiple drives. It has its uses, for sure.

As others have said, it puts all the layers: RAID blocks, file system, volume management, etc, all under a single umbrella. Because of this it can do some things that are more challenging with other approaches.

For your two drives, I wouldn’t bother with anything other than what they are, and make sure you have proper backups.

Drives die all the time. Just today one of my RAID boxes complained about a drive, in the process of replacing the drive I discovered 2 other bad drives that I had sitting around as spares.

Last week an external drive decided to die. Fortunately I was using it as one of three replicants of my primary system, so no big deal.

Replying to @⁨FukOui@lemmy.zip⁩

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I’ve seen in this thread:

Fewer Letters More Letters IoT Internet of Things for device controllers LTS Long Term Support software version NAS Network-Attached Storage RAID Redundant Array of Independent Disks for mass storage SBC Single-Board Computer SSD Solid State Drive mass storage ZFS Solaris/Linux filesystem focusing on data integrity

7 acronyms in this thread; the most compressed thread commented on today has 11 acronyms.

[Thread #175 for this comm, first seen 21st Nov 2026, 22:30] [FAQ] [Full list] [Contact] [Source code]

Hachyderm.ioImran Nazar ~ عمران نزر (@Two9A@hachyderm.io)3.24K Posts, 316 Following, 296 Followers · Front-end #typescript developer and general keyboard tapper; author of Internet RFC 7168 (Hypertext Coffeepot Control Protocol for teapots); occasional plumber, more than occasional #c64 #retrocomputing enthusiast, terrible at classical #piano. Header photo is a verdant scene looking over the landscape near Buxton, England, taken from a single-track country road.

Replying to @⁨FukOui@lemmy.zip⁩

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 😬

Replying to @⁨FukOui@lemmy.zip⁩

I’d go with zfs. You’ll get copy-on-write snapshots that take a split second to create and do not add any read or write overhead, online filesystem checking, detection of corrupt files down to the filename in the filesystem and all snapshots, lz4 file compression, and more. I even use zfs on single disk usb drives just because the features it offers are so good.

Replying to @⁨FukOui@lemmy.zip⁩

Short answer: not for this machine. Your reading is right: on a single drive ZFS only detects corruption. It repairs a file only when a second copy exists, and with two drives that means a mirror. So the real question is what the second drive should do. I would give it a backup job rather than a mirror. A mirror survives one drive dying, but it also copies every deletion and every mistake to both drives at the same moment. A second drive holding a nightly copy (rsync, or restic if you want older versions) covers both cases, and then plain ext4 or XFS on the first drive is plenty. If you can, keep the backup drive in another room. ZFS or btrfs earns its place later, when you have more drives and want checksums and snapshots, and nothing you set up now stops you moving to it. Once the nightly copy runs, test it by restoring one file from the backup drive onto the first.

@FukOui @selfhosted

Replying to @⁨The_Decryptor@aussie.zone⁩

ARC is literally just a smarter version of the memory caching you’re going to get with every filesystem. You only notice it because it’s tracked well and you have access to detailed statistics. Your free memory with other file systems is used for caching in much the same way as you mentioned.

“Half the system ram” is bullshit, that’s the maximum allowable and only if you aren’t using and don’t need the memory. You don’t need to tweak anything down, the default minimum cache is 32MB or 1/32 of system RAM.

Replying to an earlier post

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.

Replying to @⁨FukOui@lemmy.zip⁩

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.

Replying to @⁨FukOui@lemmy.zip⁩

I have no opinion here, and I’m rather on the ‘interested in the replies’ side. But I think what is it about just being with ext4? I have it on most my computers, as I had it many years ago. Only my home computer (Fedora, default install) has btrfs, and ironically it contains none of the data anyone cares about.

I am not really willing to reformat most of my disks, so I wonder what should I expect then? Do I need to do backups meticulously?

Replying to @⁨FukOui@lemmy.zip⁩

Just chipping in as someone who’s tried mdadm, zfs and btrfs over the years…

I settled on btrfs in the end basically due to the quantity of tools that can read the filesystem.

I use clonezilla and gparted a lot when setting up and maintaining systems and btrfs just has more support, easier to add disk, etc.

It’s also - as others have mentioned - already in the kernel so you can keep your data and change your distro if needed.

I see - and this is a generalisation - most people have ZFS because of TrueNAS, which is fine, but when I built my own (Arch, btw) NAS, it just all came together nicely (giggity)

Replying to @⁨FukOui@lemmy.zip⁩

One of the most annoying parts is that OpenZFS drags their feet on Linux kernel releases. I understand Linux isn’t their only target, but adapting to the new APIs is usually merged quickly, but you are lucky to get a release before the last kernel is deprecated. I’ve been keeping Linux 7.2 on life support for weeks now.

The old advice was to stick to LTS. For stability this is true, but now with all these LLM-guided bug/security finds, much of these aren’t backported & leaves one at greater risk than before.

Replying to @⁨FukOui@lemmy.zip⁩

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.

Replying to @⁨FukOui@lemmy.zip⁩

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.