[INFO] New package - udev-usb-sync

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.

12 Likes

I haven’t it with fast usb storage but slow ones are horrible this tool save me. Thx!

Thank you for this. As it’s backup weekend here, it’ll get a good workout. I’ll let you know how it goes.

EDIT:

I’ve always wanted to disable write caching to external drives. This works just fine.

My backup routine from the desktop and the (Manjaro) laptop is two copies. One to a comtemporary USB-C spinning rust drive and second to an older USB-A (3.0) spinning rust drive. I use timeshift for root, and plain old rsync for the common user directories. Just for grins, I also moved some stuff to an m.2 in an external USB-C 3.2 gen 1 adapter thingie.

Works a charm. Beautiful work. Thank you.

Also installed it on my Arch laptop using the manual installation instructions at Applications / Udev Usb Sync · GitLab . Works just fine (as expected) there too.

Up to you, of course, due to having to support it elsewhere, but it seems a reasonable candidate for addition to the AUR for users of Arch and the other Arch-based downstreams.

https://aur.archlinux.org/packages/arch-udev-usb-sync

2 Likes