Which filesystem should I use for stable storage? - eviltoast

Hello everyone. I’m going to build a new PC soon and I’m trying to maximize its reliability all I can. I’m using Debian Bookworm. I have a 1TB M2 SSD to boot on and a 4TB SATA SSD for storage. My goal is for the computer to last at least 10 years. It’s for personal use and work, playing games, making games, programming, drawing, 3d modelling etc.

I’ve been reading on filesystems and it seems like the best ones to preserve data if anything is lost or corrupted or went through a power outage are BTRFS and ZFS. However I’ve also read they have stability issues, unlike Ext4. It seems like a tradeoff then?

I’ve read that most of BTRFS’s stability issues come from trying to do RAID5/6 on it, which I’ll never do. Is everything else good enough? ZFS’s stability issues seem to mostly come from it having out-of-tree kernel modules, but how much of a problem is this in real-life use?

So far I’ve been thinking of using BTRFS for the boot drive and ZFS for the storage drive. But maybe it’s better to use BTRFS for both? I’ll of course keep backups but I would still like to ensure I’ll have to deal with stuff breaking as little as possible.

Thank you in advance for the advice.

  • turdas@suppo.fi
    link
    fedilink
    arrow-up
    46
    ·
    1 year ago

    If you’re not intending to use complicated RAID setups, just go with btrfs. There is no reason to bother with zfs given your specs and needs.

    Do not go with ext4. Unlike both btrfs and zfs, ext4 does not do data checksumming, meaning it cannot detect bit rot (and obviously cannot fix it either). You’ll also be missing out on other modern features, like compression and copy-on-write and all the benefits that entails. Once you start using snapshots for incremental backups using btrfs send (or its zfs equivalent), you’ll never want to go back. Recommended script: snap-sync.

    • BitPirate@feddit.de
      link
      fedilink
      arrow-up
      11
      ·
      1 year ago

      ext4 + mdadm + dm-integrity would solve the bit rot problem. But you’d end up with a lot of parts bolted together and still miss out on the features that btrfs/zfs provide.

    • Nine@lemmy.world
      link
      fedilink
      arrow-up
      6
      arrow-down
      1
      ·
      1 year ago

      The kind of data OP is talking about using won’t benefit much from the features of btrfs. That being said it’s still a great choice for them!

      Also it will detect bitrot but it won’t be able to fix it unless DUP is being used.

      • turdas@suppo.fi
        link
        fedilink
        arrow-up
        6
        ·
        1 year ago

        Almost all data, aside from stuff like databases, benefits from filesystem-level compression, and almost every user benefits from having snapshots. Snapshots have saved my ass so many times, e.g. when I accidentally delete a file I shouldn’t have, or when a program has overwritten a file it shouldn’t have, or when Crusader Kings 3 corrupts my savegame.

        As for bitrot, I frankly don’t know if btrfs has an automatic mechanism of fixing rotten files from an external backup of the filesystem (created using btrfs send), but even if it doesn’t it’ll tell you what has rotted so you can restore the files manually.

        • sugar_in_your_tea@sh.itjust.works
          link
          fedilink
          arrow-up
          3
          ·
          1 year ago

          I use OpenSUSE Tumbleweed, and snapshots have been a lifesaver the 2-3 times when an update went bad (NVIDIA each time, go figure). A 30 second snapper rollback later and I’m back up and running.

    • MasterBlaster@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      1 year ago

      Systems like DSM from synology have integrity scrubbing to fight bit rot. Run it once a quarter on a 4 drive, and you’re protected. Plus, you should be backing up your data, even with RAID.

      BTRFS, last I read, had lots of complexity and weird problems. Hopefully, it has improved since then (about 3 years ago).

      • turdas@suppo.fi
        link
        fedilink
        arrow-up
        5
        ·
        1 year ago

        Btrfs can be a little complex and needs more user-friendly tooling for some of the advanced features to be useful to “laymen”, but OP seems technical enough (the fact that he cares about what filesystem he’s running in the first place is an indicator of this) that this should not be an issue.

        As for “weird problems”, the majority of those seems to come down to users using advanced features without RTFM, and users having underlying system issues that cause issues that btrfs catches early and refuses to mount the filesystem as RW, and the users then blame btrfs for the issue.

        • mimichuu_@lemm.eeOP
          link
          fedilink
          arrow-up
          1
          ·
          1 year ago

          I don’t mind needing to be technical or having to read to do things right. I probably wont really do much fancy things, I just don’t want the filesystems dying on me out of nowhere. If they’re stable enough for that, that’s enough for me. Thanks for the help

          • turdas@suppo.fi
            link
            fedilink
            arrow-up
            4
            ·
            1 year ago

            The two things I would recommend to any btrfs user is enabling zstd compression and setting up automatic snapshots using snapper or Timeshift. I would personally recommend snapper if you’re comfortable with command-line tools, as Timeshift only supports a very specific configuration.

            zstd compression is very fast, so if you have a reasonably new CPU you will notice no overhead from it, making it effectively just free extra disk space.

            Snapshots require a little bit of reading to understand, particularly because you will want a very specific subvolume layout to sensibly organize them, and distro installation wizards rarely give you such a layout except on distros that support snapshots out of the box, like OpenSUSE.

            The Arch wiki page on btrfs is amazingly good, as is their page on snapper if you want to set up snapshots.

        • MasterBlaster@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          1 year ago

          I’m aware. I considered using it when I upgraded the hardware. Good to hear it is solid. If that is the consensus, I might switch, eventually.

    • PlutoniumAcid@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      I just reinstalled my home lab server with Ubuntu 22.04 LTS. There was no choice in file system type.

      Is it possible to convert from ext4 to btrfs?

      If I should rather re-reinstall the server, how do I set the file system type during setup?

      • turdas@suppo.fi
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        It is possible to convert from ext4 to btrfs, but if you just installed the server it may be easier to just reinstall.

        • PlutoniumAcid@lemmy.world
          link
          fedilink
          English
          arrow-up
          1
          ·
          1 year ago

          Ubuntu setup wizard doesn’t offer btrfs, and the manual override requires me to set up all the partitions myself. I am not that good at Linux.