feat(drive): add bisync mode + tuned mount cache - #137
Merged
Conversation
Cloud-mounted folders are slow because every Thunar/Obsidian access hits the network through the rclone FUSE mount. For high-traffic folders (Obsidian vaults, notes, code), the right pattern is a periodic bisync to the cloud against a local copy on NVMe. stoa-drive now ships both modes side by side: - mount: bumped --dir-cache-time to 24h, --attr-timeout 1h, --poll-interval 1m, and added --vfs-fast-fingerprint. Mounts also auto-exclude any path registered as a sync pair so the mount view and the synced copy do not collide. - sync: new "Folder Sync" submenu and CLI (sync / sync-all / sync-enable / sync-disable / sync-status). Pairs live in ~/.config/stoa/drive-sync.list (TSV: remote:path<TAB>local-path). Per-pair workdir + first-sync marker under ~/.cache/stoa/drive-sync/<id>/. Auto-sync installs a user-level systemd timer (interval and conflict policy in stoa.conf).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Thunar and Obsidian were slow on cloud-mounted folders because every read goes over the network through the rclone FUSE mount. For folders you touch a lot (Obsidian vaults, notes, code), the right pattern is to keep them physically on the NVMe and bisync to the cloud on a timer. This PR adds that second mode side-by-side with the existing mount, and also tightens the mount cache for everything else.
Mount tuning (
stoa-drive mount)--dir-cache-time5m → 24h (overridable:RCLONE_DIR_CACHE_TIME)--attr-timeout 1h(overridable:RCLONE_ATTR_TIMEOUT) — cachedstat()s--poll-interval30s → 1m (overridable:RCLONE_POLL_INTERVAL)--vfs-fast-fingerprintFolder Sync (
stoa-drive→ Folder Sync, or CLI)~/.config/stoa/drive-sync.list(TSV:remote:path<TAB>local-path)~/.cache/stoa/drive-sync/<id>/--resyncruns automatically the first time a pair is synced, then normal bidirectional sync afterSTOA_SYNC_CONFLICTinstoa.conf(defaultnewer)stoa-drive-sync.timer) at the interval set bySTOA_SYNC_INTERVAL(default5min)New CLI commands
stoa.confNew (commented) options:
Test plan
bash -n scripts/stoa-drive.shpasses (verified locally)stoa-drive mount <remote>still works; verify Thunar feels snappier after first open (cached dir listings)stoa-drive→ Folder Sync → Add pair → entergdrive:Obsidian+~/Obsidian→ run first sync (should--resynconce)stoa-drive sync-all) → file appears in Google Drive web UIgdrive:Obsidianregistered as a sync pair, mountgdriveand confirm~/Drive/gdrive/Obsidianis excludedstoa-drive sync-enable→systemctl --user list-timersshowsstoa-drive-sync.timerstoa-drive sync-disable→ timer is gonehttps://claude.ai/code/session_01GXhB3rozaZUTpYmpaum8GW
Generated by Claude Code