A checksum mismatch means the file contents are different, but it does not automatically mean the backup archive is corrupted.
Several things can cause this:
- Files changed between the original checksum calculation and backup creation.
- Files were modified after restoration.
- The backup process transformed or excluded certain data.
- The original and restored files are not actually the same version.
- Text-processing scripts changed line endings or file encoding.
To investigate:
Generate a checksum of the original file:
sha256sum original-file
Generate a checksum of the restored file:
sha256sum restored-file
Compare the file sizes:
stat original-file restored-file
Check whether the original file changed during the backup process.
Inspect the backup tool's transformation, filtering, and exclusion settings.
Extract the file into another temporary location and compare it again.
For reliable verification, calculate checksums from a consistent source state and compare them against the restored data. Also remember that permissions, ownership, and timestamps are separate from file-content checksums.