Why is Syncthing showing incorrect size?

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.

How is this possible?

Are there any nested folders? Screenshots of the Syncthing Web GUI would be welcome.

Yes, there are some nested folders, and some of them are hidden.

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.

1 Like

Why isn’t Syncthing smart enough for a simple thing like that? Anyway to confirm your assumption?

Syncthing is not going to list the size of each folder and sub folder separately. It just displays that total size of the shared folder.

Try running

$ du -sh --total <directory>

  • Could you post screenshots of Syncthing’s web GUI? (expand the relevant panels so that the details are visible)
  • The output from compsize.
  • What types of files are being synced?

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.

2 Likes

[at]bwa11 That command also prints 11G.

@gadget

Could you post screenshots of Syncthing’s web GUI? (expand the relevant panels so that the details are visible)

The output from compsize.

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.

1 Like

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.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.