Over the years we have had a lot of topics relating to removable storage with damaged or incomplete files.
We have had topics about file managers saying a copy has been done but the system is still flushing data.
This has resulted in a lot of topics about fine tuning cache and limiting buffer size.
A long time ago a discussion on EndeavourOS forum a comment from a member @kwg sparked me into looking into udev and rule writing - and with the help of @megavolt this went into a rule, a script and a configuration file to impose the - if not optimal then the most reasonable - conditions for a given system.
The utility is of course not bulletproof but we have tested a range of scenarios and applications and found - what we believe - is the most reasonable conditions - @megavolt even took into account if the device connected should be a hub - and thus ignored - really good thinking.
→ Strict limit of write cache / 0s sync time policy for usb devices by default
The package is named udev-usb-sync and is available from up-to-date mirrors on all branches.
sudo pacman -Syu udev-usb-sync
You can find more information at Applications / Udev Usb Sync · GitLab - the page also contains links to some of the numerous topics on the matter.
So a special thank you to @kwg for the idea and @megavolt for invaluable assistance in fine tuning the rule and the script and to @Yochanan for proofreading my PKGBUILD and doing the packaging and uploading stuff.