Fstab btrfs mount options update

Recently I checked my fstab. It was needed for my disk operations.
rw,noatime,compress=zstd:2,ssd,space_cache,commit=120,subvol=@ 0 0

If I remember correctly it was generated during system installation (architect)

  1. Yesterday I read Manpage for btrfs. I can’f find there anything about rw option. I’m pretty sure that it is for enabling read write but is this option necessary? Aren’t read write enabled by default?
  2. space_cache - it’s without any options. So I assume that it’s default v1. Is this ok?
  3. I’ve found [HowTo] Btrfs and Snapper
    I don’t use snapper. Mount options written by @visone are:
    noatime,sdd,clear_cache,commit=120,compress=zstd
    No space cache option. Is it off or v1 by default?
    Is there a reason to add clear_cache in my config?

My hardware is old laptop with ssd drive. No fancy purpose. Internet, virtualbox, a little bit of everything.

Most interesting for me are rw and clear_cache
rw because I didn’t find it in manual
and clear_cache because of whats manual says:

Force clearing and rebuilding of the disk space cache if something has gone wrong.

So not very useful if you don’t know what can go wrong :slight_smile:

Personally, I use compress=zstd without a compression level. This defaults to level 3 compression.

I also don’t have the commit=120 option in there. The default value is 30.

Yes, read/write is the default, so you don’t need to explicitly include that. But it doesn’t hurt anything if it’s there. :wink:

Yes, v1 is the default, and unless you have a multi-TeraByte SSD, you should just leave that “as is”. v2 is only really useful on very large drives.

No. It is needed only if you have been using v2 and you are switching to a kernel that doesn’t support v2, which means that the filesystem will be mounted read-only. clear_cache then allows you to mount it read/write again.

1 Like

But maybe you know. Why it’s set to 120 by Manjaro installer? At least it was when I did my installation.

It wasn’t when I installed mine, back in April 2019. You would have to ask @philm why he chose that as the default. Maybe he took that over from Arch ─ I don’t know. :man_shrugging:

Either way, when all else fails, consult the manual. :stuck_out_tongue:

@philm could you answer this quetsion?
Why commit=120 is the default value on btrfs partitons? (at least in my case it was)

I don’t think it really matters much, other than that it could be a performance issue.

Mind you, just because the installer applies certain defaults doesn’t mean that those are necessarily the best values. I had to change quite a bit on my own system.

For instance…

  • My /etc/stab still had discard as a mount option for the partitions on my SSD, while it is recommended to use the fstrim.timer instead.

  • The initramfs did not support a separate /usr, plus that the initramfs still uses the less-than-optimal configuration of the hooks based upon udev, rather than letting systemd gather all the required information when building the initramfs.

  • The default setup of sudo requires the user to enter their own password in order to have full root privileges, which is unsafe.

1 Like

rw option is in man mount, it is not filesystem specific

1 Like

Did a fresh install of Manjaro (XFCE) with Btrfs and the Manjaro Installer (Calamares) did not put the commit option in fstab… (I manually put it to 60).

I also note that there is no mention of an ‘autodefrag’ option.

Less writes on disk leads to more performance and longer ssd life (not a major issue nowadays). The default 30 is also fine.

Phil doesn’t do Manjaro-arhitect

1 Like

4 posts were split to a new topic: Grant sudo to the first user by default?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.