Df, syncthing reporting inconsistent disk space, possibly deeper rooted problem?

Hi everyone,
I’m using syncthing to sync some folders on my main (manjaro) PC to other PCs. I noticed today that the sync has stopped because syncthing reports

Error on folder "Sync" (drrcm-cbcjy): insufficient space on disk for database (/home/andreas/.config/syncthing/index-v0.14.0.db

Running df on my home directory gives me the following:

Dateisystem    Größe Benutzt Verf. Verw% Eingehängt auf
/dev/nvme0n1p2  861G    815G  2,8G  100% /home

Sorry for the german language setting, I hope it’s clear… 861G size, 815G used, yet only 2,8G are reported available and 100% are reported used? Something seems off here…

I’m running Manjaro on stable branch, all updates applied, kernel 5.15.7-1-MANJARO.

Does anyone have an idea what could be going on here?

Edit: Version info:

$ syncthing --version
syncthing v1.18.5 "Fermium Flea" (go1.17.5 linux-amd64) syncthing@archlinux 2021-12-11 09:58:08 UTC [noupgrade]
$ df --version
df (GNU coreutils) 9.0

Are you using btrfs by any chance?

No, ext4

I would check the answers provided here:

https://serverfault.com/questions/232525/df-in-linux-not-showing-correct-free-space-after-file-removal

“Deleting the filename doesn’t actually delete the file. Some other process is holding the file open, causing it to not be deleted; restart or kill that process to release the file.”

1 Like

I don’t know why syncthing reports the error but 3 GB is not much and easily filled temporarily.

df does use rounding for the percentage and 3GB out of 800 is roughly 100%, so it’s to be expected.

Thanks for the answers! The percentage problem is explained then, but why the discrepancy between what’s available on the disk (861G) and what’s free (815G) and what’s reported free? I ran lsof and also did a reboot and there are no processes holding any large files open… also I didn’t delete anything big recently.

Also, technically speaking, a file uses more space on a drive than its actual size: storage is divided by sectors (up to of a few KB each), and those sectors cannot be shared by multiple files. So, by taking multiple files into account, they overall use more storage than the mere sum of their sizes.

That might explain it actually… there’s a lot of files on my home drive. So they could take up considerably more space than they are actually in size.

Doesn’t explain the syncthing problem though… I now set minimum available disk space in syncthing to 0kb and deleted a few GB off my home drive, and still I get the error about insufficient space.

Also keep in mind that a ext filesystem reserves space for a specific user and group.It us usually root. This space can only be used by this special user and/or group.

This results in a full drive from a normal user perspective, but the filesystem is not really full. Check with tune2fs the filesystems settings.

https://wiki.archlinux.org/title/Ext4#Reserved_blocks

I solved the syncthing problem… syncthing has several places where you can set the minimum required disk space, globally, per folder, per device… it’s a mess. It was set to 1% free disk space, I set it to 0 everywhere, now it’s synching correctly. That was not at all easy to figure out :frowning:

Thanks for the hint, I will read up on reserved blocks, that wasn’t really on my radar until now!

And thanks everyone for pushing me in the right direction! :slight_smile:

Reserved blocks are useful on a root filesystem. But to reserve 5 % on a non root filesystem (like /home ) is no necessary. It is often a good idea to reduce it.

1 Like

Is it wise? You are technically allowing it to make your drive full…

Furthermore, since you are down to your last percent of storage space, you would need to make some room soon anyway…

I see your point. However I am only synching a couple of text files and pdfs/odts and such in the order of a couple hundred MB (my notes and documents collection), so I think I can afford to go a bit lower than my last 1% storage space on an 860GB drive. Eventually though you are right, I will have to clean up or (more likely) buy a bigger drive :wink:

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