I’m running v1.22.0 Linux (64-bit Intel/AMD) and I noticed that the GUI shows the size of my shared folder as ~16.9 GiB, whereas $ du -hs in that folder reports it as being 11G. The filesystem is Btrfs, but as far as I can tell (using compsize), there’s no compression.
On my phone, $ du -hs on the source directory says 12G, and there are some subdirectories excluded in Syncthing by me.
The problem is likely explained then. Syncthing isn’t smart enough to know that the folders are nested, so it will just add up the sizes as if they were independent entities.
Probably because nested folders are something that is usually strongly discouraged, unless you know exactly what you’re doing (with all the possible consequences). You can confirm the behaviour easily just by adding multiple folders to Syncthing under the exact same path. The global state will be a simple sum of all of them, even though they are all the same folder on the disk.
Everything in syncthing is folder-root relative. That a couple of folders overlap in the file system isn’t visible (or relevant) to the rest of syncthing. Don’t think of it as size on disk, think of it as size seen/managed by syncthing.
Processed 19231 files, 19608 regular extents (19608 refs), 23 inline.
Type Perc Disk Usage Uncompressed Referenced
TOTAL 100% 10G 10G 10G
none 100% 10G 10G 10G
What types of files are being synced?
Media files.
@tomasz86 Why exactly are nested folders strongly discouraged? What could be the unwanted consequences? I’m syncing my phone’s internal memory and there are about 17 folders in it that I want to be synced.
You don’t have nested folders in the syncthing sense, so they thread of the discussion is irrelevant. You just have a normal folder. I’m not sure why there are different size estimates. Since btrfs is involved I’m inclined to believe you have some files that are linked or deduplicated, or simply that btrfs is confused.
Turns out Syncthing isn’t wrong. If I run the du command with -c which gives the file size instead of disk usage, and run the script here, it would report the same 16.150 GiB.