Software Consulting & Engineering Requirements to Production

butterpot: resumable Btrfs backups

2026-present

← Back to portfolio

  • Open source
  • Rust
  • Btrfs
  • SSH
  • Incremental backups

Developing butterpot, a multi-user Rust backup system I designed around Btrfs snapshots, incremental send/receive transfers over SSH, and privilege separation. Long-running backups require decisions about interrupted transfers, available disk space, and the snapshot ancestry needed for the next incremental backup.

The server derives client identity from the authenticated SSH public key and uses that identity to determine backup paths. The transfer protocol separates Btrfs delta streams from resumable transport pieces: payloads stay in disk spool files, while a durable index records verified pieces and stream identity. A changed source or delta base invalidates old resume state; an unavailable base produces an explicit request for a full backup. Completed snapshots are published only after stream reconstruction and a successful btrfs receive.

Snapshot retention and free-space pruning complete the receive lifecycle. Testing snapshot deletion also exposed a host-safety constraint: the operation needs elevated privileges or a special mount option. I used that requirement to shape vmrunner, keeping destructive filesystem tests inside disposable Linux guests.