On Thu, Jun 25, 2020 at 11:57 PM Chris Murphy
<lists(a)colorremedies.com> wrote:
The answer to your question "Why should I have confidence in my data"
is because of the same reason you are giving for using btrfs.
Because years (decades?) of using ext4, I haven't had a single problem
with my files (that I've seen), due to the filesystem, even without a
checksum.
The thing you trust in this case, is not ext4 though. It's not designed to even detect
the problem under discussion so you can't trust it to protect you from the problem.
What you actually trust is the drive's ECC and there's a ton of data out there
indicating you shouldn't.
Not least of which is a very long period of time with file systems that did not even apply
checksums to their own metadata. You aren't alone in trusting the hardware vendors,
even file system design implicitly trusted them. But due in part to ZFS and btrfs, and
their own bug reports, they've learned of these betrayals and now ext4 and xfs also at
least checksum their own metadata. If you implicitly trust the vendors, why checksum
metadata?
A different use case I haven't seen mentioned yet is using
sd-cards.
I use sd-cards a lot in small raspberry-pi type/size machines.
I've been able to use some of these for several years at a time.
I'm always prepared to re-install these at any time, but others might not.
How does btrfs do on sd-cards?
Less total writes than other file systems. With compression it reduces write amplification
significantly, and increases sdcard lifespan by a lot (which maybe isn't saying much
for consumer sdcards but set that aside for now).
I'm using btrfs on a Raspberry Pi Zero, 512 MB RAM, compress=zstd:1. Read and write
performance seem about the same, perhaps reads are a touch faster but it's purely
anecdotal.
I have seen these cards die in various ways, never one time a read error from the card
itself. First indication are checksum mismatch errors from btrfs, i.e. the card is
returning garbage for some blocks, soon thereafter the card "bricks" itself into
a read-only state. i can still mount the file system and get my data out. And most of the
time when it's read-only, it's still accepting write commands without error,
it's just not persistent. Write a block, no error. Read that block, old data. It's
plainly failing to write yet no error from the card at all.
--
Chris Murphy