POLL: Which file system in 2022. ext4, btrfs, xfs, zfs, f2fs (choose 1)

Great tip, thank you!

1 Like

Well said!
I’ve been trying to wrap my head around subvolumes, more damn subvolumes, snapper, and setting it up from scratch - for the last couple friggin’ days!

And now I finally mangaged to set it up in a somewhat orderly fashion, and it seems to be coming together. Probably gained some more gray in my hair, but then I realized I haven’t had so much fun in a long time! Having been away for some time, I’d forgotten how fun Linux is, it is just the best computer game!

1 Like

Obviously, before I switch, I will test whether BTRFS works for me and whether I like it. Snapshot is the biggest advantage compared to EXT4, what other advantages does it have?

compression, self-healing, subvolumes, etc

So, it is not only about taking a snapshot, but it has other important advantages. I understand compression, obviously to save space, for example, what is the significance of sub-volumes? However, what are the possible risks compared to EXT4, because it is less talked about?

1 Like

This is one of the FUD message you find everywhere on the internet.

You need to know a couple of things about this:

  1. If you have unused RAM it is a wise idea to use it as cache. That gives you a better ROA (return on asset :wink:)
  2. The ZFS cache shrinks automatically when memory pressure rises
  3. The maximum ZFS cache size is configurable. (zfs_arc_max). And the default value on Linux is half your RAM.
2 Likes

For me it’s not needing to think about partitions any longer.
/ is a subvolume
/home is subvolume
/swap is a subvolume (with a swapfile in it)

Things are kept separate but still share the same physical space.

I moved my server and laptops to btrfs 5 years ago, havent regreted it once. Snapshots have saved me many times.

5 Likes

Agree, unused RAM is bad RAM :slight_smile:

Compression helps with not only space but often improves performance.

Subvolumes allow you to have separate logical spaces with different rules applied to them in the same partition. This can have a few different uses:

  • Allowing you to have different snapshot policies for different parts of the system
  • Allowing you to keep or destroy parts of your filesystem separately
    • For example, having a separate subvolume /home which you can preserve even when erasing /.
  • Unlike partitions, subvolumes share space so you don’t have worry about allocating space in advance.
  • They also can be used as a way to share data between distros when you multiboot

All filesystems encounter corruption but when a btrfs filesystem encounters corruption in the wrong spot, it can result in total data loss. The recent change in btrfs to default to keeping two copies of the metadata helps with this.

btrfs filesystems also require maintenance. You should be running scrub and balance jobs monthly. This can easily be automated, but it shouldn’t be ignored.

5 Likes

Interesting question since I’ve never used btrfs until recently. . . Is this true on Fedora also? I just let Fedora do it’s thing upon install.

Yes. It is true on any distro using Btrfs.

Is balance needed even if there is only one device with BTRFS?
Also how about defragmentation? Shall one run that also on a monthly basis?

Edit: I missed the following just having a look at the ArchWiki:

On a single-device filesystem, a balance may be also useful for (temporarily) reducing the amount of allocated but unused (meta)data chunks.

I guess I should learn how to do this. I’ve never done anything for btrfs. I’ll have to look into it. Assuming it’s in the fedora docs

Yes. Here is an example of the advantages of balance on a single partition filesystem.

You can schedule this as well. How often to run defrag will depend on what the physical disk is and the nature of your data.

1 Like

Haha…that is funny. Fedora has some of the worst documentation of any Linux distro.

The easy button for this is to install btrfsmaintenance. Take a quick spin through the config file and ensure it is running.

1 Like

I actually think their docs are pretty decent. Sometimes hard to find things, but it’s all there. I will install btrfsmaintenance though :wink:

Thanks @dalto!

1 Like

It has no man or help. Their github is very vague. Running btrfsmaintenance-refresh as suggested doesn’t do anything. I did get the config at /etc/sysconfig/btrfsmaintenance but that’s it. Not a great install and very unintuitive.

fstrim was already setup/enabled by default.

You modify the config there and then enable the systemd services or the cron job. There is nothing else to it.

That being said, the documentation is here:

Thanks. Ya, that was the documentation I found already and was taking about.