ubunatic.com

Make Linux cache flushing observable

psync makes sync progress visible.

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@latest

Key facts

12-week commit activity

2026-10-26
View 12-week data table
Week startingCommits
2026-08-030
2026-08-100
2026-08-170
2026-08-242
2026-08-312
2026-09-0716
2026-09-140
2026-09-210
2026-09-286
2026-10-052
2026-10-120
2026-10-191

Key Features

  • Shows live progress as Linux writes cached file data to storage during `sync`.
  • Watch mode reports pending writes and per-device disk activity without starting `sync`.
  • Follow mode watches selected files and runs `sync` again when they change.
  • Choose a mounted filesystem interactively, or use a plain prompt without a terminal.

Verified Engineering Milestones

  • Follow mode and mount picker in the first release (#006, f792678)
  • Per-device progress in watch mode (#011, 9279f9c)
  • Loom mount picker and v0.2.2 release (#013, 4485b28, 460d911)

Stack

Go 1.26.5, Cobra, Loom, Linux /proc (meminfo, diskstats, mountinfo), inotify, GoReleaser

Observe the flush while it runs

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.db

Progress, watch, and scoped follow mode

Sync with progress

Poll system dirty/write-back counters while sync runs and print a summary.

Passive watch

Watch system write-back state without starting sync; target mode also reports device I/O.

Follow changed files

Resync a specific file or directory after changes, with debounce and minimum-interval guards.

Select a mount

Choose a mounted filesystem interactively when follow or watch mode needs a target.

Choose what psync observes

Default
Run sync and show live dirty/write-back progress and a completion summary.
-d / --data
Pass data-only mode to sync(1), without unneeded metadata.
-f / --file-system
Sync the filesystem that contains the selected target files.
-w / --watch
Observe write-back progress without calling sync(1).
-F / --follow
Watch selected files or direct directory entries and resync on changes.
--debounce and --min-interval
Coalesce change bursts and enforce a minimum delay between follow-mode syncs.
-i / --interval
Set how often psync samples /proc/meminfo; the default is 500 ms.

Follow only a target you choose

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.

Use psync demo to watch a deterministic simulated flush without writing test data to disk.
psync demo
psync demo --size-mb 8192 --duration 20s

Install and try the simulation

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 demo

Make Linux sync progress visible

Read the engineering story for the design of live write-back monitoring and scoped follow mode.

Project details

Stack
Go 1.26.5, Cobra, Loom, Linux /proc (meminfo, diskstats, mountinfo), inotify, GoReleaser
Milestones
Follow mode and mount picker in the first release (#006, f792678) · Per-device progress in watch mode (#011, 9279f9c) · Loom mount picker and v0.2.2 release (#013, 4485b28, 460d911)

Layer composition

Terminal
CLI, live progress, TUI picker
Desktop
Linux, /proc, inotify
Inference / AI
—
Containers / VM
—
Web
—

psync: the story behind the project

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