this post was submitted on 13 Apr 2024
157 points (98.8% liked)

Linux

48216 readers
816 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] pimeys@lemmy.nauk.io 25 points 7 months ago (1 children)

ZFS is still the de-facto standard of a reliable filesystem. It's super stable, and annoyingly strict on what you can do with it. Their Raid5 and Raid6 support are the only available software raids in those levels that are guaranteed to not eat your data. I've run a TrueNAS server with Raid6 for years now, with absolutely no issues and tens of terabytes of data.

But, these copy on write filesystems such as ZFS or btrfs are not great for all purposes. For example running a Postgres server on any CoW filesystem will require a lot of tweaking to get reasonable speeds with the database. It's doable, but it's a lot of settings to change.

About the code quality of Linux filesystems, Kent Overstreet, the author of the next new CoW filesystem bcachefs, has a good write-up of the ups and downs:

  • ext4, which works - mostly - but is showing its age. The codebase terrifies most filesystem developers who have had to work on it, and heavy users still run into terrifying performance and data corruption bugs with frightening regularity. The general opinion of filesystem developers is that it's a miracle it works as well as it does, and ext4's best feature is its fsck (which does indeed work miracles).
  • xfs, which is reliable and robust but still fundamentally a classical design - it's designed around update in place, not copy on write (COW). As someone who's both read and written quite a bit of filesystem code, the xfs developers (and Dave Chinner in particular) routinely impress me with just how rigorous their code is - the quality of the xfs code is genuinely head and shoulders above any other upstream filesystem. Unfortunately, there is a long list of very desirable features that are not really possible in a non COW filesystem, and it is generally recognized that xfs will not be the vehicle for those features.
  • btrfs, which was supposed to be Linux's next generation COW filesystem - Linux's answer to zfs. Unfortunately, too much code was written too quickly without focusing on getting the core design correct first, and now it has too many design mistakes baked into the on disk format and an enormous, messy codebase - bigger that xfs. It's taken far too long to stabilize as well - poisoning the well for future filesystems because too many people were burned on btrfs, repeatedly (e.g. Fedora's tried to switch to btrfs multiple times and had to switch at the last minute, and server vendors who years ago hoped to one day roll out btrfs are now quietly migrating to xfs instead).
  • zfs, to which we all owe a debt for showing us what could be done in a COW filesystem, but is never going to be a first class citizen on Linux. Also, they made certain design compromises that I can't fault them for - but it's possible to better. (Primarily, zfs is block based, not extent based, whereas all other modern filesystems have been extent based for years: the reason they did this is that extents plus snapshots are really hard).

I started evaluating bcachefs in my main workstation when it arrived to the stable kernels. It can do pretty good raid-1 with encryption and compression. This combination is not really available integrated to the filesystem in anywhere else but zfs. And zfs doesn't work with all the kernels, which prevents updating to the latest and greatest. It is already a pretty usable system, and in a few years will probably take the crown as the default filesystem in mainstream distros.

[–] TCB13@lemmy.world 3 points 7 months ago (1 children)

ZFS is still the de-facto standard of a reliable filesystem. It’s super stable, and annoyingly strict on what you can do with it.

Yes and that's the reason why I usually pick BTRFS for less complex things.

[–] pimeys@lemmy.nauk.io 4 points 7 months ago (1 children)

Yeah. I would not for example install ZFS to a laptop. It's just not great there, and it doesn't like things such as sudden power failure, and it uses kind of a lot of memory...

[–] TCB13@lemmy.world 4 points 7 months ago (1 children)

Meanwhile BTRFS provides me with snapshots and rollbacks that are a useful when I'm messing with the system. And subvolumes bring a lot of flexibility for containers and general management.

[–] pimeys@lemmy.nauk.io 1 points 7 months ago

For sure. I would say if you run a distro like Arch, using it without cow filesystem and snapshots is not a good idea... You can even integrate snapshots with pacman and bootloader.

I've been running nixos for so long, that I don't really need snapshots. You can always boot to the previous state if needed.

If you write software and run tests against a database, I'd avoid having the docker volumes on btrfs pool. The performance is not great.