I have found that syncthing’s .
inotify watches prevent my external HDD unmounting on Linux
Strangely these watches don’t even show up on a
I need to kill the process:
and then my HDD can unmount. Otherwise I get:
umount: /media/backup: target is busy
What are the implications of killing
Am I better off stopping syncthing entirely?
Can I tell syncthing to restart the inotify watching?
Will I miss any changes which occurred in the meantime?
You are probably better off restarting syncthing after you kill inotify as it won’t scan things for a while (as inotify defers scans based on the assumption that it doesn’t get killed).
Syncthing has no control over inotify daemon, and inotify daemon does not have an API, so I think killing is the only way.
Is the “a while” the
rescan interval configured per folder or a different interval (and if so, what)?
It’s the time passed to
syncthing-inotify with the flag
-delay-scan which defaults to 1h. After that, the rescan interval from folder configuration in syncthing UI “takes over” again.
I looked for the a “delay scan” option in the syncthing GUI, but couldn’t find it. How does the user configure this option to be passed to
Do I have this right in usual operation with inotify (actually this is likely wrong, but perhaps it’s some text to copy paste to speed your answer):
Start inotify watcher
Do startup scan
-delay-scan interval (while receiving from inotify)
Wait the “rescan interval” (or just the remainder?) then do a full scan
Go to Step 3
syncthing-inotify do a full scan on behalf of syncthing?
Also, is the only difference that if inotify is killed, there will be no notifications during the remainder of step 3?
I’m a bit bamboozled by the different interactions in the usual case, and then the additional complexity should the inotify be killed.
What Syncthing GUI are you talking about the “normal” GUI (the web ui) doesn’t have any params for inotify, as syncthing-inotify is a different and optional binary.
When inotify starts (after syncthing is already running), it will just watch the folders for changes. When it detects a change, it will tell syncthing to scan that change and wait for 1h (or the -delay-scan) for the next scan.
If you then kill inotify, syncthing will wait the 1h, then scan, then go back to the configured rescan interval (default 1m).
I would try: kill inotify, unmount the hdd, restart inotify.
I’ve raised a related question:
I’ve been trying to understand the
behaviour of inotify in relation to blocking unmounting a filesystem. I need to kill inotify to unmount my external HDD.
This is a more general question:
Is there a way of telling syncthing directly to only rescan a particular folder?
Is there a way of telling inotify to tell syncthing to trigger a scan on a folder?
I may be seeing it incorrectly, but ideally, wouldn’t one of these methods exist so we can:
syncthing-inotify -delay-scan 999999999999
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.