Fedora 34 - BTRFS and ZSTD

Hi, I’m looking at my fstab, that I didn’t change since installation and I noticed that for some reason I’m apparently not using zstd compression on root subvolume.

UUID=e286bc9a-e288-4cc6-a1f0-f3fffe7a4a98 /                       btrfs   subvol=root,x-systemd.device-timeout=0 0 0
UUID=9c16805c-d864-427c-85b5-4111a61aa3e1 /boot                   ext4    defaults        1 2
UUID=3E21-B9F1          /boot/efi               vfat    umask=0077,shortname=winnt 0 2
UUID=e286bc9a-e288-4cc6-a1f0-f3fffe7a4a98 /home                   btrfs   subvol=home,compress=zstd:1,x-systemd.device-timeout=0 0 0

But fstab I’ve seen posted elsewhere on the internet from fedora installation does use zstd for root as well. Should I edit the fstab and add compression on root?

You should if you want compression enabled on the root volume. :smile:

Ultimately, it is your choice if you care about that compression. In my machines, I have compression enabled on the root volume.

Keep in mind the mount option will only impact new data. If you want to compress the existing data, you can use:

btrfs filesystem defrag -r -czstd /
2 Likes

New Fedora 33 installations did get Btrfs by default for automatic partitioning, but did not get compression. Enabling compression was a Fedora 34 feature, so only new Fedora 34 installations get compression enabled by default.

But you can add it to fstab. Strictly speaking you only need to add compress=zstd:1 mount option to the / mount point. It is a file system wide mount option. As @dalto mentions, it only applies to new writes from the time the option is enabled. Since old writes have already happened, it’s completely OK to just enable compression from this point forward, you don’t need to defragment with a compress option.

2 Likes