notes

Reading the backup from a MacBook or a Linux host (milestone 57)

The question that makes a backup credible rather than merely functional: the board is dead, can I get my data? calef asked it about the RedoxFS volume the backup server writes, and the honest first answer was "we would have to write something". This note is what got written, what upstream already had, and the operational rule that has to hold for any of it to matter in a year. The evidence it has no room for is in host-recovery/.

Upstream did not already solve this, and it is worth being precise about why

vendor/redoxfs/src/bin/ has five binaries and it is easy to assume one of them extracts. None does:

Upstream binary Direction Use to recover?
redoxfs-ar host directory into a new image No. It is an archiver: it creates the filesystem as it writes. The name suggests tar, which reads too; this one only writes
redoxfs-clone image to image No. It copies a filesystem to another filesystem, not to host files
redoxfs-mkfs makes an empty one No
redoxfs-resize grows one No
redoxfs (mount.rs) serves an image over FUSE Yes, and that is the path we deliberately do not take. See below

So the read side upstream ships is FUSE, and fuse is a feature tools/redoxfs_host excludes (default-features = false, features = ["std"]). On Linux enabling it is nearly free. On macOS it means macFUSE, a third-party system extension, and reduced security mode on Apple Silicon. A recovery story that begins "first, reboot into recovery mode and lower your Mac's security settings" is not a recovery story. The library, though, links here already with std, so the read paths cost a tool instead: ls, cat and extract on top of the same engine, no FUSE, no kernel extension, no root, identical on macOS and Linux.

What the tool does

redoxfs_host partitions DEVICE            # the GUID partition table: number, size, type, label
redoxfs_host ls         VOLUME [PATH]     # a directory listing: kind, attributes, size, name
redoxfs_host cat        VOLUME PATH       # one file's bytes to stdout
redoxfs_host xattr      VOLUME PATH       # what extended attributes are on it
redoxfs_host xattr      VOLUME PATH NAME  # one attribute's bytes to stdout
redoxfs_host extract    VOLUME PATH DEST  # a whole subtree onto the host filesystem, attributes and all

Plus the pre-existing write side (mkfs, put) and one addition, import IMAGE HOST_DIR, which copies a host directory into an image using upstream's own redoxfs::archive.

A VOLUME is an image file, or a device plus a partition selector (milestone 110, below).

PATH is always relative to the filesystem root, and .. is refused, which is the same rule the FS server enforces on the wire (notes/fs-server.md). DEST becomes the thing extracted: a directory in the image lands as a directory at DEST, a file lands as the file DEST. That is cp -R SRC DEST with a DEST that does not exist yet, and it avoids the "into or as?" ambiguity that makes people run a recovery twice.

Files, directories and symlinks are extracted, with permission bits masked to 0o777. Setuid, setgid and sticky are dropped on purpose: an image is data being recovered, not something that gets to hand out authority on the machine doing the recovery. Entry names are checked before use, so a damaged or hostile image cannot walk out of the destination directory.

The read paths do not write to the image

This is not a detail. The image you are extracting from may be the last copy of the data, and may be on a failing disk or read-only media. So ls, cat and extract open the file without write permission and pass cleanup: false, and there are two traps in doing that with this engine:

The operational rule: keep the reader, or its exact pin, with the backup

We are pinned at RedoxFS 0.9.1, on-disk format version 8, and a reader must match the format version it reads. Header::valid checks the version before it checks anything else, so an image written by a different RedoxFS presents as no valid header anywhere in the ring, and the engine reports that as ENOENT. Being told "no such file or directory" about a disk you are holding is the wrong thing to be told while recovering a backup. So when an open fails, the tool reads the signature and version straight off the disk and says which version it found and which one it reads. There is a test that forges the mismatch and asserts the message.

The rule that follows, and it is the whole point of this note:

A backup readable only by software you no longer have is not a backup. Store the recovery tool, or the exact source it is built from, with the backup.

Concretely, that means the backup's off-site copy carries one of:

  1. a built redoxfs_host binary for the host you would recover on (fine, but binaries rot across OS versions and architectures), or
  2. the nife commit hash plus vendor/redoxfs at 0.9.1 and patches/, which is enough to rebuild the tool with nothing but a Rust toolchain, or
  3. both, which costs a few megabytes.

Option 2 is the one that survives. It is also why vendor/ is checked in rather than fetched: the recovery path must not depend on a registry, a git host, or a company still existing.

The same discipline applies to any future pin bump. Bumping vendor/redoxfs to a version with a different on-disk format silently strands every existing backup, so a bump is a migration, not an upgrade, and it belongs in design/decisions/ with a plan for the images already written.

No filesystem-level encryption, so no key handling

Decided by calef on 2026-07-30 (roadmap, milestone 57): "If I'm struggling to get the data off, I'm not all that worried about somebody else getting it." RedoxFS does support encryption (vendor/redoxfs/src/key.rs), and this volume does not use it. Encryption belongs at the Time Machine layer instead, where the Mac encrypts before anything is sent, so the server never holds plaintext and recovery uses the client's key rather than the server's.

For this tool the consequence is a real simplification: every FileSystem::open passes None for the password, and there is no key handling anywhere in the recovery path. Nothing to lose, nothing to store, nothing to get wrong at 2am.

The caveat belongs here too. If Time Machine encryption is switched on, recovery then depends on that password, which relocates the "can I get my data" risk rather than removing it. That password belongs wherever the family's other credentials live, not only in one Keychain.

The same-engine objection, answered once so nobody relitigates it

The reader shares any bug the writer has, because it is the same code. True, and true of every filesystem: e2fsprogs shares lineage with the Linux ext4 driver. The risk that actually strands data is an undocumented format, and RedoxFS is open source with upstream tooling. What the shared engine does not give you is an independent check of the format, which is why the round-trip test below writes with upstream's archiver rather than with our own put.

How it is proven

tools/redoxfs_host/tests/recovery.rs, and the shape of the test is the argument:

Extended attributes come back on the files (milestone 57)

An image written by nife carries a directory in its root called .extended-attributes, holding one small file per node that has extended attributes. ls shows it and extract copies it out. That the store is visible here is a decision and not a leak: no client of the FS server can reach it, and a recovery host is not a client of the contract; it holds the image file. The record format is written down in file_system_contract::xattr::store so a person holding a damaged image can read it.

extract also puts the attributes back on the extracted files and directories (setxattr on macOS, lsetxattr on Linux, never following a symlink), because Time Machine's sparsebundle keeps Apple's metadata in exactly these attributes. ls marks an entry that carries attributes with @, and xattr renders or dumps them without extracting anything. Three things it is honest about:

extended-attributes.md has a real transcript on a Mac, how the reattachment is proven, and its BUGS: Linux refuses a name without a user. prefix and any attribute on a symlink, and FreeBSD is not wired up.

A device and a partition, not only an image file (milestone 110)

A real disk has a partition table where an image has a filesystem, so the tool takes a device plus a partition selector and does the offset itself. The selector is --partition N, 1-based as in /dev/sda3 or disk4s3, or --partition-type GUID for a program. Both flag names are provisional. partitions DEVICE prints the table first. The selector is refused on mkfs, put and import, because opening a device read-write by accident is worse than opening an image that way.

$ redoxfs_host partitions target/nifefs-blank.img
$ redoxfs_host extract target/nifefs-blank.img / /tmp/recovered --partition 3

The work corrected its own premise. The old tool did not fail on a partitioned disk: the engine's header scan finds whichever filesystem lies in the first 256 MiB and opens that. That can read a partition nobody named, miss one further out, and size the allocator from the whole device. So reading a device whole is now a warning that names the flag, not a refusal. devices-and-partitions.md has the selectors, the correction, transcripts, how it is proven, and its BUGS. The largest: it has never been run against a real raw device, and the GPT backup table is not consulted when the primary is damaged.

What this does not do, and where it goes next