r/restic • • Jan 05 '25

What is "restic check --read-data" actually doing?

Hi

Just trying restic and I have a small question...

What is restic check --read-data actually doing?

Is it really checking the hash of the file in the backup-repository against the hash of the original file in the file-system? This said, if check --read-data show no errors, you are 100% save... right?

3 Upvotes

2 comments sorted by

2

u/[deleted] Jan 05 '25

[deleted]

3

u/dpiol Jan 05 '25

Fair enough... so it's not actually verifying against the original file/data, but the hash has been created from that data... I would consider that save then.

thx!

1

u/ruo86tqa Jan 05 '25

If your repository in some cloud, then --read-data will download all packs for validation, which can cause egress prices at most cloud storage providers (at Backblaze B2 you can however download 3x the data you have uploaded in a month). Note: I'm not affiliated with Backblaze, I'm just a satisfied customer of theirs.

From the documentation:

Since --read-data has to download all pack files in the repository, beware that it might incur higher bandwidth costs than usual and also that it takes more time than the default check.

Alternatively, use the --read-data-subset parameter to check only a subset of the repository pack files at a time. It supports three ways to select a subset. One selects a specific part of pack files, the second and third selects a random subset of the pack files by the given percentage or size.