Skip to content

Durability

Paper gets folded, stained, crumpled and lost. Pabaru is built so that a backup still restores when that happens.

  1. Inside every block. Each block is a 40 × 40 grid of dots (200 bytes) protected by a Reed-Solomon code RS(200, 140). It corrects up to 30 wrong bytes per block — and up to 60 when the decoder can tell which dots are uncertain and marks them as erasures.
  2. Across blocks and pages. The data is split into kk blocks and an erasure code adds mm parity blocks. Any kk of the k+mk + m blocks are enough to rebuild everything, no matter which ones were lost.

Blocks are spread evenly over the pages and shuffled within each page, so a coffee stain or a torn corner takes out a few blocks from many places rather than a whole run of data.

If the number of parity blocks is at least the number of blocks on any single page,

m≥max⁡p (blocks on page p),m \ge \max_{p}\, (\text{blocks on page } p),

then losing any one page still leaves at least kk blocks. The Archival profile and the --survive-page-loss option guarantee exactly this, adding a page if necessary. You can test it without a printer:

Terminal window
pabaru verify ./documents --survive-page-loss --drop-page 1

Version 0.2 was tested on real prints that had been crumpled and torn:

  • Coarse dots for small backups. When the data fits on the same number of pages anyway, Pabaru chooses dots up to 0.5 mm in size, which survive creases and crumpling.
  • Local grid tracking. The decoder follows the grid lines locally, cell by cell, so it copes with paper that is no longer flat.
  • Crumpled: smooth the page out and scan it. Several scans of the same page are combined.
  • Torn: scan the page whole or in pieces — each piece is decoded separately and the results are merged.

Very fine dots on a heavily crumpled page may not be readable; that is why the optimizer prefers coarse dots whenever it can. Try your own scenario with pabaru verify ./documents --crumple medium --tear (or --crumple strong).

Print two copies and store them in different places. If both are damaged, scan whatever is left of each: blocks from all scans are combined, so the copies cover each other’s gaps.

After restoring, every file is checked against its BLAKE3 hash from the backup’s manifest. If Pabaru says the restore succeeded, the files are bit-for-bit identical to the originals.