syncthing thinks that my btrfs subvolume is full but it is not

Syncthing seems to think that my btrfs volume is full, but it isn’t. The only way to get the sync running again is to set the Syncthing folder limits to 0. This is the way my drives are setup:

>>> sudo btrfs filesystem df /mnt/btrfs_raid1/
Data, RAID1: total=557.00GiB, used=555.86GiB
System, RAID1: total=8.00MiB, used=96.00KiB
Metadata, RAID1: total=1.00GiB, used=806.94MiB
GlobalReserve, single: total=512.00MiB, used=0.00B

>>> sudo btrfs filesystem usage /mnt/btrfs_raid1/
Overall:
    Device size:		   7.28TiB
    Device allocated:		   1.09TiB
    Device unallocated:		   6.19TiB
    Device missing:		     0.00B
    Used:			   1.09TiB
    Free (estimated):		   3.09TiB	(min: 3.09TiB)
    Data ratio:			      2.00
    Metadata ratio:		      2.00
    Global reserve:		 512.00MiB	(used: 0.00B)

Data,RAID1: Size:557.00GiB, Used:556.50GiB (99.91%)
   /dev/sdb1	 557.00GiB
   /dev/sdc1	 557.00GiB

Metadata,RAID1: Size:1.00GiB, Used:807.89MiB (78.90%)
   /dev/sdb1	   1.00GiB
   /dev/sdc1	   1.00GiB

System,RAID1: Size:8.00MiB, Used:96.00KiB (1.17%)
   /dev/sdb1	   8.00MiB
   /dev/sdc1	   8.00MiB

Unallocated:
   /dev/sdb1	   3.09TiB
   /dev/sdc1	   3.09TiB

Is this a bug or can I configure Syncthing to understand btrfs volumes?

Syncthing uses normal filesystem API’s (statfs syscall) to look up space, so if that misreports it, there is nothing we can do. Also, there are two space checks, one for folders, one for config/db directory, so make sure you are checking the right one.

What Syncthing does should be the equivalent of df /path, so try just that.

I managed to fix this by using wipefs to clear the drive and createed a new partition table with a btrfs filesystem. Could have been some old stuff on the drive that caused it. So for now it looks like it’s all good again.

btrfs gonna btrfs :man_shrugging:

I have a similar problem with RAID6 on btrfs, which is only solvable by a reboot. It seams, the new statfs behavior introduced this in kernel 5.4. https://lore.kernel.org/linux-btrfs/f1f1a2ab-ed09-d841-6a93-a44a8fb2312f@gmx.com/T/#t Quick fix @btrfs is to shrink the metadata using btrfs balance. Hopefully we see this patch in the next kernel release.

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