3

Whilst researching about BTRFS I ran into this thread from 2017 with this reply:

To paraphrase the upstream opinion, btrfs has been "almost production ready" for many years now, but never quite got to the stage where it actually was ready.
In the meantime, many of the features that btrfs provides are now available via other more mature and stable storage technologies like ext4, XFS, LVM, etc. We've put considerable effort into improving these technologies to the point where current Red Hat offerings already cover almost the entire btrfs feature set.

So I googled "ext4 checksum" and saw that ext4 does (metadata) checksumming (that too since 2012), which, according to this, is similar to what btrfs (and zfs?) do.
The ext4 docs also says:

To protect against this sort of non-hostile corruption, it is desirable to store checksums of metadata objects on the filesystem to prevent broken metadata from shredding the filesystem.

Albeit, its followed by:

In theory, btrfs has stronger guarantees against corruption (uniform checksums on all metadata blocks, redundant copies of all metadata, etc.

Now, from what I understand so far, metadata checksumming doesn't really help protect against actual file data corruption? But this line from the ext4 docs, coupled with the one above, implying that it also helps protect against data corruption is really bugging me:

It is still quite possible for data to be corrupted on disk

So, my question is that is just metadata checksumming not enough to help protect me from having corrupted data on my drives?

P.S.: In no way am I thinking or implying that ext4, like zfs or btrfs, will automatically fix the corrupted data. I just want to know if it will inform me if and when my data gets corrupted. I will be using this in offline external drives after all. Thank you.

2
  • At the block level, dm-integrity (usually along encryption and LUKS) + RAID would protect and correct data corruption. Of course there is overhead and space cost.
    – A.B
    Commented Aug 7, 2021 at 19:06
  • Almost all disks will be broken by itself, and almost in a silent way. Called silent corruption. This did happen my offline disk, a SMR disk: A large 7z file corruped silently in less then 1 year. From then on I always use RAID as far as possible. But RAID is not always available especially in laptop PC / NUC and so on. And even many many people are not aware of RAID. Your data corrupted silently, and don't know that. It's crazy in this modern world.
    – Keelung
    Commented Oct 4, 2022 at 0:53

1 Answer 1

0

In my knowledge, checksumming helps ensure the data 'sent' is the data 'received' by comparing the checksum (possibly a cryptographic hash function) generated at both ends the same way.

As the documentation explains, it only can detect corruption. e.g data corruption in storage caused by random bit flips. However, it can't prevent data corruption due to bugs.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .