I OPEN-SOURCED THE WHOLE THING?! lzply Is on GitHub — 7 Tools, One Self-Healing Format, Install It in 5 Minutes!

lzply is open source: the full C toolkit — self-healing archives, a FUSE mount, BER checker, platter refresher, and a striped volume that rebuilds 3 dead stripes — on GitHub with install and usage for all 7 tools, verified from a fresh clone.

I OPEN-SOURCED THE WHOLE THING?! lzply Is on GitHub — 7 Tools, One Self-Healing Format, Install It in 5 Minutes!
lzply on GitHub hero: one glowing archive file splitting into seven tools — archiver, mount, stats, heal, BER check, refresh, striped volume — linked by data streams

Everything is open source now. The whole lzply family — the self-healing archiver, the FUSE mount, the statistics, heal, BER-check and refresh tools, and the striped volume that rebuilds three dead stripes — lives in one public repository under the MIT license: github.com/cnmcdee/lzply. Clone it, build it, run the tests, install it. This article is the map: what the project is, how to install it (proven from a fresh clone, with the two repo fixes the proof turned up), and how to use all seven tools, each with real measured output. No source is re-pasted here — articles #5 and #7 already embed the full code. The repo is the source of truth now.

WHAT LZIP + BCH + SHA-256 ACTUALLY IS

One archive file holding many entries, like zip. Every entry is an independent byte stream through a three-stage pipeline:

compress (lzip/LZMA) -> BCH encode        (on write, v4)
BCH decode -> decompress                 (on read)

Compression is lzip via liblz, levels -1.. -9, default -6, byte-identical to what lzip -N produces. Store mode (level 0): when the compressed blob would be no smaller than the original — random data, already-compressed files, empty files — the entry is stored uncompressed instead, and BCH still applies. Error correction is binary BCH: -e selects t (0 = none, 1 -> t=1, 2 -> t=2, 3 -> t=4, 4 -> t=8, 5 -> t=16, 6 -> t=32, 7 -> t=32; default t=8). Integrity is a SHA-256 of the original data on every entry — load-bearing, because a bounded-distance BCH decoder can miscorrect damage beyond t, and the SHA-256 is what turns that into a reported corruption instead of silent damage. There is no encryption in v4; it was stripped out entirely. No legacy support either: v3 archives and the old magics are rejected outright.

The BCH polynomials are the project's quiet superpower. The binary embeds 82 narrow-sense primitive generator polynomials (parents N = 2m - 1, m = 7..22), found by the rssearch exhaustive search over 3,145,030 payload/t combinations. They need 39–42% less parity than Reed-Solomon for the same t — the 36 polys for m=17–22 are not in any published table. With no poly given, the most efficient polynomial for each entry's blob length is picked automatically; poly=NN pins one by id. The full study is in the companion article (linked at the end).

THE SEVEN TOOLS, IN ONE TABLE

ToolWhat it does
lzplyThe archiver: create, extract, test, list, inspect, tree, append, date filters, store mode.
lzply_mountMount a .lzply archive as a writable filesystem (FUSE). mount -t lzply works too.
lzply_statStatistics for an archive or a mount point: sizes, compression %, poly, t, parity bits, ECC overhead %.
lzply_healStrip the BCH parity and re-encode it — same level or higher — without touching the compressed data.
lzply_checkMeasure the bit-error rate (BER) of an archive or a mount, to watch for filesystem degradation.
lzply_refreshRewrite a file over itself (1–3 passes) to freshen the platter on older spinning disks.
lzply_hyperA striped volume: 8 bit-plane data stripes + P/Q/R parity, rebuilds 1, 2 or 3 dead stripes.

The rename history is in the code and the README: lzrs (lzip + Reed-Solomon) → lzbch (lzip + BCH) → lzply, magic LZRS → LZBC → LZPL, extension .lzply. The name follows the domain now.

INSTALLATION — PROVEN FROM A FRESH CLONE

These are not instructions copied from a README and hoped for. They were run, verbatim, against a fresh clone of the GitHub repo on a clean checkout, and the results are below. The proof turned up two real repo bugs, both fixed and pushed before this article was written.

1. Dependencies

sudo apt install build-essential liblz-dev libfuse3-dev
# Debian/Ubuntu. libfuse3-dev is only needed for lzply_mount;
# the other six tools build without it.

2. Clone and build

git clone https://github.com/cnmcdee/lzply.git
cd lzply
make

Measured from the fresh clone (HEAD defee61):

gcc -O2 -Wall -Wextra -o lzply lzply.o liblzply.a -llz
gcc -O2 -Wall -Wextra -D_FILE_OFFSET_BITS=64 -o lzply_mount lzply_mount.o liblzply.a -llz -lfuse3
gcc -O2 -Wall -Wextra -o lzply_stat lzply_stat.o lzply_util.o liblzply.a -llz
gcc -O2 -Wall -Wextra -o lzply_heal lzply_heal.o lzply_util.o liblzply.a -llz
gcc -O2 -Wall -Wextra -o lzply_check lzply_check.o lzply_util.o liblzply.a -llz -lm
gcc -O2 -Wall -Wextra -o lzply_refresh lzply_refresh.o lzply_util.o liblzply.a -llz
gcc -O2 -Wall -Wextra -o lzply_hyper lzply_hyper.o bch.o sha256.o
BUILD EXIT: 0

All seven binaries build clean with -Wall -Wextra. No OpenSSL, no other dependencies: the SHA-256 is an in-tree FIPS 180-4 implementation.

3. Test

make test

Measured from the same fresh clone:

TOTAL: 7406 checks, 0 fails          (BCH codec harness, all 82 polys)
LZPLY TESTS: 137 passed, 0 failed   (archive suite; 10 mount tests skip: no /dev/fuse here)
lzply_hyper tests: 56 passed, 0 failed
MAKE TEST EXIT: 0

On the server (Debian 12, /dev/fuse present) the same suite runs the mount tests too: 147 passed, 0 failed, hyper 56/56, BCH 7,406/0. The two numbers differ only by the 10 mount tests that need FUSE — nothing else.

Three bugs the proof found (all fixed in the repo before this article; current HEAD fdff59c):

  1. make test failed on a fresh clone with testdata missing; run make_testdata.sh first — the test corpus (including a 50 MiB random file) is generated and gitignored, so a clone has none. Fixed: make test now builds testdata on demand.
  2. make install PREFIX=... failed with cannot create regular file — the install target never created $(PREFIX)/bin. Fixed: it does now.
  3. The server suite failed one test — -i: sub/ shows 0750/drwxr-x--- — and the cause was a real (small) display bug plus a root quirk. The server tree is synced with rsync -a, which preserved the setgid bit on the repo directory, so new directories inherit it; and as root, chmod 0750 does not clear setgid, so the directory's real mode was 2750, not 0750. The tool reported the number correctly — but its symbolic rendering dropped the setgid bit entirely, printing drwxr-x--- for a 2750 mode. Fixed: fmt_perm now renders setuid/setgid/sticky (s/S, t/T) like ls — a 2750 directory shows as drwxr-s--- — and the test checks the mode in a way that tolerates an inherited setgid bit.

One gotcha that is not a bug: the hyper test suite uses 64 MiB stripes (8 × 64 MiB plus parities), so it needs roughly 600 MB free where you run it. A first verification attempt cloned into /tmp — a 512 MiB tmpfs — and -init correctly refused with has 329715712 bytes free, needs 536870912. That is the free-space check working as designed. Clone onto a real disk and it passes.

4. Install

sudo make install
# installs the 7 binaries to /usr/local/bin and mount.lzply to /sbin
# (so `mount -t lzply` works). PREFIX=... overrides the install prefix.

Proven with a prefix install from the fixed repo:

$ make install PREFIX=/tmp/install-test
INSTALL EXIT: 0
$ ls /tmp/install-test/bin/
lzply  lzply_check  lzply_heal  lzply_hyper  lzply_mount  lzply_refresh  lzply_stat

And the installed binary works — /tmp/install-test/bin/lzply -t verified a demo archive clean.

USAGE — EVERY TOOL, REAL OUTPUT

All examples below were run against the fresh-clone build (mount demo on the server, where FUSE lives). Files: a 45-byte text file, an 11.1 KiB lorem file, a 97.7 KiB random file, and a nested photo.

lzply — create, list, test

$ lzply -c -y data demo.lzply
  data// (dir)
  data/hello.txt  45 B -> 55 B (122.2%)
  data/lorem.txt  11.1 KiB -> 145 B (1.3%)
  data/photos// (dir)
  data/photos/a.txt  45 B -> 55 B (122.2%)
  data/random.bin  97.7 KiB -> 97.7 KiB (100.0%)
lzply: wrote demo.lzply (6 entries, 108.9 KiB -> 97.9 KiB)

The two small text files and the random file are stored uncompressed (level 0) — compressing them would have made them bigger. Only the lorem file actually compressed, to 1.3%.

$ lzply -l demo.lzply
path                    original       stored  lvl ecc
data/                        0 B          0 B  6   -
data/hello.txt              45 B         55 B  0   BCH 000b
data/lorem.txt          11.1 KiB        145 B  6   BCH 000f
data/photos/                 0 B          0 B  6   -
data/photos/a.txt           45 B         55 B  0   BCH 000b
data/random.bin         97.7 KiB     97.7 KiB  0   BCH 0044
6 entries

$ lzply -t demo.lzply
  data/hello.txt OK
  data/lorem.txt OK
  data/photos/a.txt OK
  data/random.bin OK

lzply — inspect, tree, append, selective extract

-i reads headers only — no decompression, works on a data-corrupted archive:

$ lzply -i demo.lzply
path               type       perm symbolic    mtime (UTC)              original       stored  lvl ecc
data/hello.txt     file       0660 -rw-rw----  2026-11-25 01:09:03 UTC         45 B         55 B    0 BCH 000b
data/lorem.txt     file       0660 -rw-rw----  2026-11-25 01:09:03 UTC     11.1 KiB        145 B    6 BCH 000f
data/random.bin    file       0660 -rw-rw----  2026-11-25 01:09:03 UTC     97.7 KiB     97.7 KiB    0 BCH 0044
6 entries (2 directories, 4 files)

$ lzply -tr demo.lzply
demo.lzply
└── data/
    ├── hello.txt (45 B)
    ├── lorem.txt (11.1 KiB)
    ├── photos/
    │   └── a.txt (45 B)
    └── random.bin (97.7 KiB)

2 directories, 4 files

Append is incremental when nothing is replaced, and extraction takes selectors:

$ lzply -a demo.lzply data/new.txt -y
  new.txt  14 B -> 24 B (171.4%)
lzply: added 1 entries to demo.lzply (7 entries total)

$ lzply -d demo.lzply out data/photos/
  data/photos/a.txt OK
$ find out -type f
out/data/photos/a.txt

lzply — date filters, store mode, pinning a polynomial

Every entry stores its mtime, so you can filter by date. Here hello.txt was touched to 2024-06-15:

$ lzply -i dated.lzply -year 2024
data/hello.txt  file  0660 -rw-rw----  2024-06-15 12:00:00 UTC  45 B  55 B  0 BCH 000b
1 entries (0 directories, 1 files)

-datestart / -dateend take YYYY-MM-DD (whole day, inclusive) or YYYY-MM-DDTHH:MM:SS; they filter -d, -i, -tr, -t and -l, and AND with path selectors.

$ lzply -c -y -0 lorem.txt store0.lzply
  lorem.txt  11.1 KiB -> 11.1 KiB (100.1%)
$ lzply -l store0.lzply
lorem.txt  11.1 KiB  11.1 KiB  0  BCH 0032

$ lzply -c -y poly=003a lorem.txt pinned.lzply
  lorem.txt  11.1 KiB -> 206 B (1.8%)
$ lzply -l pinned.lzply
lorem.txt  11.1 KiB  206 B  6  BCH 003a

$ lzply -c -y -e 6 lorem.txt e6.lzply
  lorem.txt  11.1 KiB -> 182 B (1.6%)
$ lzply -l e6.lzply
lorem.txt  11.1 KiB  182 B  6  BCH 0016

-0 forces store mode; poly=003a pins the m=18, t=32 polynomial; -e 6 raises the correction level to t=32 (auto-picking poly 0016 for this blob size).

lzply_stat — what the parity actually costs

$ lzply_stat demo.lzply
path                type   original compressed     stored   comp%  lvl  poly   t   parity    ecc% mtime (UTC)
data/hello.txt      file       45 B       45 B       55 B  122.2%    0  000b   8       80 22.222% 2026-11-25 01:09:03 UTC
data/lorem.txt      file   11.1 KiB      134 B      145 B    1.3%    6  000f   8       88  8.209% 2026-11-25 01:09:03 UTC
data/random.bin     file   97.7 KiB   97.7 KiB   97.7 KiB  100.0%    0  0044   8      160  0.020% 2026-11-25 01:09:03 UTC
7 entries (2 directories, 5 files)
total uncompressed: 108.9 KiB, total compressed (blob): 97.9 KiB, total stored: 97.9 KiB
overall compression: 90.0% (stored/original)
total parity bits: 488, overall ECC overhead: 0.061%

The pattern is the whole point of the BCH search: the small file pays 22% ECC overhead, the 97.7 KiB file pays 0.020%. Parity cost collapses as the blob grows — that is why the 82-poly table matters.

lzply_check — bit-error rate, then heal it

Five bits were flipped inside the stored data of random.bin (t=8, so all five are correctable):

$ lzply_check damaged.lzply
path              poly   t  corrected   total_bits          ber status
data/random.bin   0044   8          5       800160     6.25e-06 correctable
5 entries checked (5 BCH, 0 no-ECC)
with errors: 1, uncorrectable: 0
total corrected: 5 bits over 802392 total stored bits
overall BER: 6.23e-06 (worst: data/random.bin 6.25e-06)

BER is corrected bit errors divided by total stored bits. The workflow is check → heal → test:

$ lzply_heal damaged.lzply -o healed.lzply
data/random.bin: 0044 (m=20, t=8) -> 0044 (m=20, t=8), stored 100020 -> 100020 B, 5 bit error(s) corrected
lzply_heal: healed.lzply: 1 healed, 6 unchanged, 0 skipped by selector, 0 uncorrectable (kept), 5 bit error(s) corrected

$ lzply_check healed.lzply
5 entries checked (5 BCH, 0 no-ECC)
with errors: 0, uncorrectable: 0
total corrected: 0 bits over 802392 total stored bits
overall BER: 0

$ lzply -t healed.lzply
  data/random.bin OK
  new.txt OK

Heal strips the BCH parity and re-encodes it — the compressed blob is never touched, no password, no recompression. Uncorrectable entries are kept byte-for-byte and reported, never silently dropped. A mounted archive is refused (same rule as the mount's exclusive lock).

lzply_refresh — freshen the platter

$ lzply_refresh lorem.txt 2
lorem.txt: 11400 bytes, 2 passes, sha256 d60d710ecc94a7c1d1d9fa305a95cf7f6a3c6c9dbc84e71f8c055490244ecb0d, verified unchanged

Reads the file, rewrites it over itself from offset 0 (same inode), fsyncs per pass, and requires the SHA-256 to match before and after. A directory or mount point refreshes recursively; a mounted archive is refused. Aimed at older spinning disks — on copy-on-write filesystems or SSDs the rewrite may not hit the same cells, and the tool says so.

lzply_mount — the archive as a filesystem

On the server, where FUSE lives:

$ lzply_mount /tmp/mnt8.lzply /tmp/mnt8point
lzply_mount: mounted /tmp/mnt8.lzply (2 entries) on /tmp/mnt8point
$ cat /tmp/mnt8point/mnt8data/inside.txt
hello from the mount
$ echo "new file from mount" > /tmp/mnt8point/added.txt
$ fusermount3 -u /tmp/mnt8point
$ lzply -l /tmp/mnt8.lzply
mnt8data/inside.txt   21 B  31 B  0  BCH 000b
added.txt             20 B  30 B  0  BCH 000b
3 entries
$ lzply -t /tmp/mnt8.lzply
  mnt8data/inside.txt OK
  added.txt OK

Full writable FUSE: read, write, create, mkdir, rename, chmod, utimens (mtime persists and is filterable by -year). Unmodified entries are copied verbatim on repack; modified ones are re-encoded. A killed daemon loses unflushed changes but never corrupts the archive. One caveat, found by testing: after fusermount3 -u returns, the repack may still be in flight for a moment — wait for the daemon process to exit before reading the archive.

lzply_hyper — a volume that rebuilds dead stripes

Config file, eight bit-plane data stripes, three parity stripes:

$ cat config.txt
stripe:s0:/tmp/demo8/hyper/s0.bin:rw:16M
stripe:s1:/tmp/demo8/hyper/s1.bin:rw:16M
...
stripe:s7:/tmp/demo8/hyper/s7.bin:rw:16M
parity:p:/tmp/demo8/hyper/p.bin:rw:0044:4
parity:q:/tmp/demo8/hyper/q.bin:rw:0044:4
parity:r:/tmp/demo8/hyper/r.bin:rw:0044:4

$ lzply_hyper -c config.txt -init
stripe s0: /tmp/demo8/hyper/s0.bin (created, capacity 16777216 bytes)
...
parity r: /tmp/demo8/hyper/r.bin (created, poly 0x0044 t=8)
volume initialized: 8 data stripes, 3 parity stripe(s), poly 0x0044 t=8

-init checks the disks have the size and creates the initial files; it refuses to overwrite without --force. Then write, list, check, read — a 2 MiB random file, SHA-256 7cb62f04…:

$ lzply_hyper -c config.txt write hyperfile.bin
wrote 'hyperfile.bin': 2097152 bytes, stripe_off 0, stripe_len 262144, bch 340 bytes, sha256 7cb62f041af3b0dc152dd94f8307f4820d9d60d06247d77581cf58ce0a589c0a

$ lzply_hyper -c config.txt list
index from parity stripe 0 (p): 1 file(s)
  hyperfile.bin  2097152 bytes  poly 0x0044 t=8  stripe_off 0  stripe_len 262144

$ lzply_hyper -c config.txt check hyperfile.bin
check 'hyperfile.bin': OK (2097152 bytes, sha256 verified)

$ lzply_hyper -c config.txt read hyperfile.bin hyper-out.bin
read 'hyperfile.bin': 2097152 bytes -> hyper-out.bin
$ sha256sum hyper-out.bin
7cb62f041af3b0dc152dd94f8307f4820d9d60d06247d77581cf58ce0a589c0a

Now delete three data stripes and read anyway:

$ rm hyper/s0.bin hyper/s4.bin hyper/s7.bin
$ lzply_hyper -c config.txt read hyperfile.bin hyper-out3.bin
read 'hyperfile.bin': 2097152 bytes -> hyper-out3.bin (rebuilt 3 dead stripes)
$ sha256sum hyper-out3.bin
7cb62f041af3b0dc152dd94f8307f4820d9d60d06247d77581cf58ce0a589c0a

$ lzply_hyper -c config.txt -rebuild
rebuilt data stripe s0 (/tmp/demo8/hyper/s0.bin)
rebuilt data stripe s4 (/tmp/demo8/hyper/s4.bin)
rebuilt data stripe s7 (/tmp/demo8/hyper/s7.bin)
rebuild complete

Three dead stripes, byte-identical read, all three rebuilt. P (XOR) covers one loss, Q (GF(256)) the second, R the third — independent parities, not mirrors. Four dead stripes fails cleanly instead of returning wrong data. Read speed is the priority: ~35 MiB/s on a 100 MiB file, bounded by the BCH syndrome check, not the I/O.

WHERE TO READ MORE

METHOD AND SOURCES

  • All numbers in this article are measured, not copied from documentation: the clone, build, test and install runs are from a fresh GitHub clone; the tool outputs are from the fresh-clone build (mount demo on the server, Debian 12, gcc 12.2.0).
  • Format v4: magic LZPL, version 4, 78-byte entry header (mtime, header CRC32), lzip → BCH pipeline, SHA-256 per entry, no encryption, no legacy support.
  • BCH: binary, systematic, table-driven remainder encoder; syndrome → Berlekamp-Massey → Chien search decoder; 82 narrow-sense primitive generators from the rssearch exhaustive search (3,145,030 finds, 99.979% coverage, 495,386,012 parity bits saved).
  • Hyper: 8 bit-plane data stripes, SWAR 8x8 transpose, P = XOR, Q/R = GF(256) weighted sums (g = 2, primitive polynomial 0x11d), recovery by Gauss-Jordan inversion of the k×k coefficient system, BCH + SHA-256 per file.