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 ?

  • andioop@piefed.social
    link
    fedilink
    English
    arrow-up
    1
    ·
    3 days ago

    I’m just so glad you asked this because I’ve been looking for an answer to this too. Will read all the comments!

  • Strider@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    5 days ago

    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.

  • mlg@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    5 days ago

    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.

  • toastal@lemmy.ml
    link
    fedilink
    English
    arrow-up
    1
    ·
    5 days ago

    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.

  • kalleboo@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    6 days ago

    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.

  • SayCyberOnceMore@feddit.uk
    link
    fedilink
    English
    arrow-up
    1
    ·
    5 days ago

    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) with btrfs

  • wltr@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    1
    ·
    5 days ago

    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?

    • FukOui@lemmy.zipOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      5 days ago

      I lost some data recently due to a hard drive failing (no backups rip) and previously some files on disk due to corrupt blocks. I didn’t expect the drive to fail soon because it’s new but I learned my lesson.

      I want a more fault tolerant system to avoid this again in the future. Of course RAID is not a backup but mostly fault tolerance

  • JasSmith@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    1
    ·
    6 days ago

    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.

  • paydequeso@piefed.social
    link
    fedilink
    English
    arrow-up
    1
    ·
    6 days ago

    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.

  • ryannathans@aussie.zone
    link
    fedilink
    English
    arrow-up
    1
    ·
    6 days ago

    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

  • Avid Amoeba@lemmy.ca
    link
    fedilink
    English
    arrow-up
    1
    ·
    6 days ago

    Worth it 100%. Even for single-drive systems like laptops. It allows for a trivial full system backups while the system is running.

  • friend_of_satan@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    6 days ago

    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.

  • Shimitar@downonthestreet.eu
    link
    fedilink
    English
    arrow-up
    1
    ·
    6 days ago

    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.