Hi everyone, I have a question. How can I determine the size required for restoration? It appears that restore-size or raw-data aren’t giving me what I expected, with neither of them coming close to the 624K - the actual size of the data after restoration.
My second option would be to measure the size of the data before or right after the snapshot and then store it in the repository. I’m hoping to do this with tags or some other effective method. Do you think I’d be able to create my own files in a repository folder?
What is 624K in units? bytes? I’m wondering whether you might see a discrepancy between actual file size (reported by stats) and disk size (rounded up to disk sector size).
It seems to be safe to place extra files in the repository. I recently added a folder to mine for different reason.
For keeping snapshot-bound data, tags would be best imo. But I am hopeful from the latest version. Could you try compiling the latest master and check if snapshots output shows the correct size?
For me the size calculation of the stats command is a perfect match down to the last byte. Which restic version are you using? On which filesystem do you restore the data? Does the dataset contain hardlinks or other magic? Can you try a different set of files to see how those behave?
Can you restore just a single file and compare that? I’m wondering whether du somehow counts folder size, or are there maybe some xattrs or similar that are set automatically (maybe SELinux labels?)?
And if there is a single directory? My guess is that du somehow reports a large size if directories are involved. Which Linux distro and du --version do you use?
uname -a
Linux worker-7 6.5.0-41-generic #41~22.04.2-Ubuntu SMP PREEMPT_DYNAMIC Mon Jun 3 11:32:55 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
du --version
du (GNU coreutils) 8.32
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Torbjorn Granlund, David MacKenzie, Paul Eggert,
and Jim Meyering.
Thank you very much for your suggestion; it’s really great and definitely affects the amount of memory reported by the du command!
However, I encountered this issue not because I was just checking the size reported by du.
I was backing up data and then using the size reported by the stats command to create an LVM partition of the exact size needed for data restoration. I noticed that I often ran out of disk space for the restore, and it wasn’t just a few bytes but often 10% to 15%.
So, I started digging into the issue. Now, I will rely on the accuracy of the df -B1 command on my partition before backup and save the restore size in a tag for snapshots. This approach has been the most stable and is currently working for me.