What filesystem is currently best for a single nvme drive with regard to performance read/write as well as stability/no file loss? ext4 seems very old, btrfs is used by RHEL, ZFS seems to be quite good… what do people tend to use nowadays? What is an arch users go-to filesystem?

  • lazynooblet@lazysoci.al
    link
    fedilink
    arrow-up
    88
    ·
    1 year ago

    Ext4 being “old” shouldn’t put you off. It is demonstratively robust with a clear history of structure integrity. It has immense popularity and a good set of recovery tools and documentation. These are exactly what you are looking for in a filesystem.

    I’m not saying EXT4 is the best for your requirements, just that age of a file system is like fine wine.

  • Dubious_Fart@lemmy.ml
    link
    fedilink
    arrow-up
    40
    ·
    1 year ago

    ext4 being old, and still being the main file system most distros use by default, should be enough alone to tell you being old isnt bad.

    it means its battle tested, robust, stable, and safe. Otherwise it wouldnt be old and still be in widespread use.

    • DaPorkchop_@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      i would generally recommend XFS over ext4 for anything where a CoW filesystem isn’t needed. in my experience, it performs better than ext4 at most workloads, and still supports some nifty features like reflink copies if you want them.

  • odium@programming.dev
    link
    fedilink
    arrow-up
    29
    arrow-down
    1
    ·
    1 year ago

    btrfs is great for system stability because of snapshots. You can set it up to automatically make snapshots at a timed interval or every time you run pacman.

    If something breaks, you can just revert to a previous snapshot. You can even do this from grub. It’s a bit hard to set up, so if you want, you could use an arch based distro which automatically sets it up like GarudaOS.

        • Nonononoki@lemmy.world
          link
          fedilink
          arrow-up
          2
          arrow-down
          1
          ·
          1 year ago

          I guess not much on desktop Linux, but every Android phone uses it. Really wish every Linux desktop would start encrypting their /home partition by default, which is the standard by many other operating systems.

          • Krik@feddit.de
            link
            fedilink
            arrow-up
            3
            arrow-down
            1
            ·
            1 year ago

            I’m pretty sure default Android runs almost always on F2FS.

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

              Got any source for that? Android has traditionally always used ext4 afaik, not sure if that changed in the last few years.

              • Krik@feddit.de
                link
                fedilink
                arrow-up
                2
                ·
                edit-2
                1 year ago

                Wiki says:

                Motorola Mobility has used F2FS in their Moto G/E/X and Droid phones since 2012. Google first used F2FS in their Nexus 9 in 2014. However Google’s other products didn’t adopt F2FS until the Pixel 3 when F2FS was updated with inline crypto hardware support.

                Huawei has used F2FS since the Huawei P9 in 2016. OnePlus has used F2FS in the OnePlus 3T. ZTE has used F2FS since the ZTE Axon 10 Pro in 2019.

                I assume since Google is involved that more and more Android phones will adopt F2FS in the future.

    • BCsven@lemmy.ca
      link
      fedilink
      arrow-up
      6
      ·
      edit-2
      1 year ago

      Or OpenSUSE , all setup out of the box for btrfs, snapshots, grub rollback, and cleanup timers, etc.

    • TeddE@lemmy.world
      link
      fedilink
      arrow-up
      5
      arrow-down
      1
      ·
      1 year ago

      Wow, first time I’ve seen GarudaOS recommended by someone who’s not me. Awesome distro, daily driver on my gaming rig.

  • Kogasa@programming.dev
    link
    fedilink
    arrow-up
    17
    ·
    1 year ago

    Been using BTRFS for all disks and purposes for a few years, I would recommend it with the requirement that you research it first. There are things you should know, like how/when to disable CoW, how to manage snapshots, how to measure filesystem use, and what the risks/purposes of the various btrfs operations are. If you know enough to avoid doing something bad with it, it’s very unlikely to break on you.

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

    Most people should use ext4. Only use something else if you want to tinker and don’t need long term data storage.

  • nothacking@discuss.tchncs.de
    link
    fedilink
    arrow-up
    10
    ·
    edit-2
    1 year ago

    Ext4 is old, but fast and very robust. You won’t loose data or corrupt the filesystem if your system looses power. It can even survive partial wipes, if you accidentally overwrite the first few megs of you drive with a messed up dd, nearly all your data will be recoverable, including filenames and directory structure.

    It doesn’t have very fancy features, but it is the best tested and most robust option available. (also the fastest due to its simplicity)

    Btrfs has things like copy on write files that can protect you from an accidental rm, but this won’t save you from drive failures, so you still need backups for important data.

    • Affine Connection@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      edit-2
      1 year ago

      You won’t loose data or corrupt the filesystem if your system looses power.

      Some secondary storage devices ignore standards and outright lie about sectors being successfully written when they are actually scheduled to be written out of order. This causes obvious problems when power failure prevents the true writes from completing. Nothing can be guaranteed for such drives.

  • exi@feddit.de
    link
    fedilink
    arrow-up
    11
    arrow-down
    2
    ·
    1 year ago

    If you are planning to have any kind of database with regular random writes, stay away from btrfs. It’s roughly 4-5x slower than zfs and will slowly fragment itself to death.

    I’m migrating a server from btrfs to zfs right now for this very reason. I have multiple large MySQL and SQLite tables on it and they have accumulated >100k file fragments each and have become abysmally slow. There are lots of benchmarks out there that show that zfs does not have this issue and even when both filesystems are clean, database performance is significantly higher on zfs.

    If you don’t want a COW filesystem, then XFS on LVM raid for databases or ext4 on LVM for everything else is probably fine.

    • Laser@feddit.de
      link
      fedilink
      arrow-up
      5
      ·
      1 year ago

      Did you disable CoW for your database with btrfs? E.g. for PostgreSQL, the Arch Wiki states:

      If the database resides on a Btrfs file system, you should consider disabling Copy-on-Write for the directory before creating any database.

      • exi@feddit.de
        link
        fedilink
        arrow-up
        7
        arrow-down
        1
        ·
        1 year ago

        From arch wiki:

        Disabling CoW in Btrfs also disables checksums. Btrfs will not be able to detect corrupted nodatacow files. When combined with RAID 1, power outages or other sources of corruption can cause the data to become out of sync.

        No thanks

        • DaPorkchop_@lemmy.ml
          link
          fedilink
          arrow-up
          9
          ·
          1 year ago

          that’s no different than any “normal” filesystem with a traditional block-level RAID solution

          • exi@feddit.de
            link
            fedilink
            arrow-up
            4
            arrow-down
            2
            ·
            1 year ago

            Not really. You can still use dm-verity for a normal raid and get checksumming and normal performance, which is better and faster than using btrfs.

            But in any case, I’d recommend just going with zfs because it has all the features and is plenty fast.

            • DaPorkchop_@lemmy.ml
              link
              fedilink
              arrow-up
              1
              ·
              1 year ago

              ZFS lacks some features that btrfs has, such as creating CoW clones of individual files (rather than having to snapshot a whole subvolume).

              personally i’ve been using btrfs on pretty much everything for about two years, ranging from multiple >100TB filesystems spanning 8 spinning rust drives to individual flash drives and had very few issues (compared to my experiences with ext4 on mdadm). snapshots/reflink copies have made many of my workflows much easier, adding/removing/replacing devices pretty much Just Work™, and the fact that everything is checksummed gives me a piece of mind i didn’t know i needed. sure, ZFS has pretty much the same featureset, but it’s not in the mainline kernel and seems to lack some of btrfs’ flexibility (from the research i’ve done in the past, like adding/removing disks to an existing pool is still experimental).

              what i’m really excited for is bcachefs, which takes what i consider the best features of both btrfs and ZFS and then steps them up a notch (e.g. ability to configure RAID settings and prefer specific drives on a per-file/per-directory level). as soon as it’s stable enough to be mainlined i’ll definitely be migrating most of my btrfs filesystems to that.

    • Zucca@sopuli.xyz
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      If you don’t want a COW filesystem, then XFS on LVM

      XFS supports reflinks, so it’s kind of snapshot and CoW capable. Someone was working on some tool to make snapshots on XFS by utilizing reflinks.

  • Avid Amoeba@lemmy.ca
    link
    fedilink
    arrow-up
    8
    ·
    edit-2
    1 year ago

    Ext4 is probably going to be the fastest. When it comes to reliability, old is good. If you don’t need any of the features Btrfs and ZFS, you’ll reap higher performance using Ext4. Otherwise ZFS is more feature-complete compared to Btrfs, however it’s generally not available as root fs option in OS installers. Ubuntu used to have it as an experimental option but I think that’s gone now. If you know what you’re doing you can use it as a root fs. Personally I’m using Ext4 on LVMRAID on a 2-way NVMe mirror. I might be switching to ZFS on root when I get to rebuild this machine. All my storage is using ZFS.

  • Ananace@lemmy.ananace.dev
    link
    fedilink
    arrow-up
    8
    ·
    1 year ago

    We’re moving towards more btrfs - or at least LVM+<other FS> where there’s no btrfs support - on as much of our server fleet as we can, since the lack of snapshotting on the other filesystems is making consistent backups way too expensive resource- and time-wise.
    With LVM it’s at least possible to take a block-level snapshot - which is really inefficient compared to a file-level snapshot, but it at least provides a stable point for backups to run from, without having to pause all writes during the backup or risk running out a sliding window if allowing writes to continue.

    For a home user (especially one who’s not as well versed in Linux or don’t have tinkering time), I’d personally suggest either ext4 - since it’s been the default for a while and therefore often what’s assumed in guides, or btrfs where distros include it as a default option - since they should be configured with snapshots out of the box in that case, which make it much harder for the system to break due to things like unexpected shutdowns while running updates.

    I’d personally stay away from ZFS for any important data storage on home computers, since it’s officially not supported, and basically guaranteed never to be either due to licensing. It can remain a reasonable option if you have the know-how - or at least the tinkering time to gain said know-how, but it’s probably going to be suboptimal for desktop usage regardless.

    • pressanykeynow@iusearchlinux.fyi
      link
      fedilink
      arrow-up
      3
      ·
      1 year ago

      I find btrfs pretty good for desktop use mostly due to convenience it offers with managing devices(adding new device or migrating data is trivial and does not need any downtime) and subvolumes(different mount options or excluding some data from snapshots).