Files synced via Syncthing show correct size but zero disk usage (du/df) on target

Environment:

  • OS: Ubuntu (both source and target)
  • Syncthing version: ( v1.30.0)
  • Setup: Source β†’ Target replication using Syncthing
  • Filesystem: ext4

Problem Description:

I am observing an issue with .dat files generated using dd on the source system.

  • Files are created on source using dd

  • Syncthing successfully transfers the files to the target

  • Syncthing UI shows correct file size (e.g., 1 GB)

  • stat on target shows proper size but the blocks are 0.

  • du -sh on target shows 0 size

  • df -h does not reflect any increase in disk usage


Example:

# On target
stat testfile_10.dat

Size: 1073741824
Blocks: 0
du -sh testfile_10.dat
# Output: 0

Additional Observations:

  • When the same file is transferred using rsync, disk usage is correctly reflected
  • Issue occurs only with Syncthing-transferred files

Are the contents not what you’d expect?

My concern is the blocks are not getting copied for these files.

My guess is they don’t need to be, because the files are all zeroes or content you already have on disk with copy-on-write enabled.

1 Like

You are correct, there is no content inside the file.

2 Likes