Restic snapshot size question


I just created my very first snapshot with Restic and here’s the output:

Files: 47494 new, 0 changed, 0 unmodified
Dirs: 471 new, 0 changed, 0 unmodified
Data Blobs: 256329 new
Tree Blobs: 452 new
Added to the repo: 297.813 GiB

processed 47494 files, 360.636 GiB in 61:43:19

So my question is, why it is reporting 297GB of added data out of 360GB when the data is 360GB big and also, when I mount the snapshot and run a ‘du’ command, it is also showing 360GB.

My second question is, I have a bunch of duplicate files on the original data spreaded across different directories, does Restic does de-duplication on these like checking checksums etc and not adding them to the repo?


Somehow you find your answer in your own last paragraph :slight_smile:

Restic does deduplication on chunk level. No matter on which directory a file resides, if chunks of it are the some as others it gets deduplicated.

So your ouput looks very much as everything works as expected.

1 Like

So if my math is right, I have 63GB of duplicate data. Is that the correct way of interpreting the output?
But if that is true, how come when I mount the snapshot and run a ‘du -sh dir’ it outputs 360GB? Shouldn’t output 297GB instead?

What you see when mounting is not the raw content of the repository, but the “unpacked” variant of it.

This is similar to a zip file. The zip file itself might be 1GB, but the unpacked size might be much larger.

Yes, according to restic.

the unpacked size should be 297GB then not 360GB. Kinda coincidence as the source is also 360GB.

Not sure what you mean by this. The files in your filesystem make up a total of 360 GB. Since some parts of some files are identical, these identical chunks are only stored once in the repository, i.e. de-duplicated. This makes the stored (“packed”) size in the repository only 297 GB. But the “unpacked” size of the files if you restore them, or look at them in the mounted state, is still 360 GB.

1 Like

that makes more sense now. thanks!

1 Like