Engineering story
Make Linux sync progress visible
Read the engineering story for the design of live write-back monitoring and scoped follow mode.
Make Linux cache flushing observable
The standard sync command blocks until dirty pages are written without showing what remains. Psync polls Linux write-back counters while sync runs, reports elapsed time and a summary, and can watch a scoped target and resync when its files change.
go install codeberg.org/ubunatic/psync@latestProject snapshot · measured 2026-10-26
| Week starting | Commits |
|---|---|
| 2026-08-03 | 0 |
| 2026-08-10 | 0 |
| 2026-08-17 | 0 |
| 2026-08-24 | 2 |
| 2026-08-31 | 2 |
| 2026-09-07 | 16 |
| 2026-09-14 | 0 |
| 2026-09-21 | 0 |
| 2026-09-28 | 6 |
| 2026-10-05 | 2 |
| 2026-10-12 | 0 |
| 2026-10-19 | 1 |
Go 1.26.5, Cobra, Loom, Linux /proc (meminfo, diskstats, mountinfo), inotify, GoReleaser
Overview
Psync starts sync(1) in the background and polls Dirty and Writeback in /proc/meminfo. It prints live progress and a completion summary without changing sync's behavior. Linux per-device write rates and in-flight requests are available when a target mount or device is selected.
psync -f /mnt/secure
psync -w /mnt/secure
psync -F important-file.dbCapabilities
Poll system dirty/write-back counters while sync runs and print a summary.
Watch system write-back state without starting sync; target mode also reports device I/O.
Resync a specific file or directory after changes, with debounce and minimum-interval guards.
Choose a mounted filesystem interactively when follow or watch mode needs a target.
Modes and options
Safe follow mode
Follow mode requires a scoped file, directory, or selected filesystem. It does not infer targets from system-wide Dirty counters, so unrelated writes from other processes cannot trigger extra sync cycles. Directory watching is non-recursive.
psync demo
psync demo --size-mb 8192 --duration 20sQuickstart
Install from the latest Go module or download a release binary. Run psync demo to see the progress display without root access, a slow disk, or real disk writes.
go install codeberg.org/ubunatic/psync@latest
psync demoEngineering story
Read the engineering story for the design of live write-back monitoring and scoped follow mode.
Architecture
Engineering story
sync(1) is one of those commands whose silence is easy to mistake for a hang. It waits for dirty data in the Linux kernel's page cache to reach storage, but gives the person at the terminal no estimate of progress or throughput. psync wraps…
Read the engineering story