Is btrfs good for my ssd

These are the load options on my fstab:

noatime,compress=zstd,ssd,space_cache=v2,commit=120,discard=async

What they do is explained here: https://mutschler.eu/linux/install-guides/pop-os-btrfs-21-04/#step-4-post-installation-steps

The ssd option can be removed. It will get automatically for SSDs.

This is now the default on the kernel so you might want to remove it.

Also, if your use case is not write-intensive, you could remove

as well and use periodic fstrim by enabling the fstrim.timer.

You might want to have a look at this recent thread:

I runned it with the defaults without parameter,

mprime

If it prompted me to connect to GIMPS, I answered “no”.

Join Gimps? (Y=Yes, N=Just stress testing) (Y): n

The rest at the defaults.

The stress test my CPU and RAMs took a long time, but no error appeared.


PassMark company found the problem of my faulty RAM only happens with DMA transfers under certain circumstances.

But the error of bit appears at 5% -15% probability, it is very random.
That means,you need to repeat test tool 20+ times, 1 in 20 same tests could find the error.

PassMark company told me that MemTest86+ found the error of this RAM after many repeat tests.

The problem with detecting it, is that it is intermittent. For a couple of weeks this month the problem disappeared entirely and wasn’t reproducible with file hashing or any other method. We had pretty much given up on it, but then the problem returned this week. So it may also be temperature related, or humidity, or EMI, voltage stability or some external factor.

That is why it is very difficult for different test tools to detect the error, but they are time-consuming for me. Useless, nobody want to test 10+ times.
I let the filesystem (BTRFS or ZFS) doing its job with checksum ability and notifies me.

sudo journalctl -b | grep ssd
May 28 13:48:40 mr-victory kernel: BTRFS info (device nvme0n1p5): enabling ssd optimizations

BTRFS automatically activates SSD optimizing options.

Out of curiosity, how do you get notified? A message on dmesg/journal, desktop notification or something else?

There were two notifications for me when copying data failed.

  1. Notfication:

BTRFS stops or cancels copying immediately and you will notice very easily, EXT4 can not.
Example:

❯ cp ~/MEGA1.zip ~/Downloads 
cp: error reading '/home/zesko/MEGA1.zip': Input/output error
  1. Notification:

Then check journal why the copy failed.
Example:

Sep 20 15:18:35 zesko kernel: BTRFS error (device nvme0n1p2): bdev /dev/nvme0n1p2 errs: wr 0, rd 0, flush 0, corrupt 72, gen 0

That means I got 72 corrupt data somewhere on my disk.


Theoretically, you can implement automatic notification of BTRFS error messages possible.

space_cache=v2

This is now the default on the kernel so you might want to remove it.

Could you please tell if this is also applicable to LTS kernel ?

default since btrfs-progs 5.15, kernel support since 4.5
https://github.com/lansuse/btrfs-progs/commit/26852f45c4220f9d7978fd76d2a958668550f7c6

So if I am reading the commit correctly, it should be the default for LTS kernel as well.

1 Like

I have been running btrfs since I made that post, and my cheap ssd isn’t showing any signs of failing, so that’s a plus. However I was using space_cache v1, and I used to leave firefox on all the time (and I didn’t configure it to use profile-sync daemon), combine that with the fact that btrfs-transacti writes every ~5 seconds, 1GB would be written to the disk every hour. After switching to space_cache v2, and installing profile sync daemon, the situation has been alleviated somewhat, btrfs-transacti still writes to disk every ~5 seconds, but the amount every write is less. Also there was a firefox option to make it use memory for some things but it escapes me right now.

Edit: I found the tweak: https://easylinuxtipsproject.blogspot.com/p/firefox.html#ID3