BTRFS compression not enabled by default?

When I installed Endeavour, I chose the erase entire disk and BTRFS options. But later when I installed compsize to check how effective the compression was, the output didin’t seem to indicate that there was any compression in use (I did a stupid and forgot to record the output before I went and changed things).

After running sudo btrfs filesystem defragment -rvf -czstd / the output of compzise now shows compression being enabled using zstd.

So assuming that I’m interpreting things correctly and my btrfs filesystem doesn’t have compression enabled, I can change that by adding compression to the options in /etc/fstab for each subvolume correct?

Thank you in advance.

I would recommend adding compress=zstd

2 Likes

welcome at the purple side :enos:

I am still not that comfortable with BTRFS but choosing the preset scheme and automatic partition you should have compression:
2021-10-08_17-10

and @dalto

already changed it to zstd for compression for the next release :wink:

1 Like

It has been a while since I looked at it the current fstab.conf but it used to only add compress if it detected an ssd. Has that changed?

oh yes this could be still the case, I do not test BTRFS so much only current using it here on one hardware install…

Also, is it possible to set fs passno to 0 ?

Traditional filesystems need to run their respective fsck utility in case the filesystem was not unmounted cleanly and the log needs to be replayed before mount. This is not needed for btrfs. You should set fs_passno to 0.

https://btrfs.wiki.kernel.org/index.php/FAQ#When_will_Btrfs_have_a_fsck_like_tool.3F

1 Like

@joekamprad this requires a really minor code change unless Garuda upstreamed their change.

If you want I can check and if not I can submit a PR for it against Calamares

2 Likes

Interesting, I don’t have compress in my options at all.
Screenshot_20211008_114708

Adding compress=zstd now for /, /home, and /var/log (compressing swap and /var/cache don’t seem like good ideas to me).
And my drive is a nvme ssd in case that matters.

It looks like this has been upstreamed in Calamares already:

1 Like

Great!
Thanks for looking that up and sharing it here!

Is that a change I should make in my existing installation’s fstab?

You can if you want to. fsck.btrfs is a shell script which does more or less nothing so there is not much harm in calling it. However, there is also no benefit so might as well set it 0.

@dalto

as there is also the extra SSD options part it seems to be use compression not only for SSD:

@pebcak as @dalto says fs_passno 0 Garuda dev commits this already…

2 Likes

Yeah, it looks like the compression defaults changes were committed 2 weeks ago:

1 Like

BTRFS is still under heavy changes on calamares. Currently, I see Manjaro got issues with snapshot implementation… which will resulting in more changes to calamares soon.

Hopeful we will get a new release ready soon :wink: Currently, I struggle with a great merging of repos action on GitHub affecting also structure for the install process … but I am almost 2/3 through it

1 Like

It is so that current release do not have the latest calamares… so it will only put compression if ssd is used.