Volatoo is a distribution I’ve been working on this year (not me exactly — an AI, actually). The name comes from volatile and Gentoo. It is based on Gentoo, and the system is organized by generation. The repo is github.com/Volatoo/Volatoo, and the current v0.1-dev preview boots both OpenRC and systemd targets.

Volatoo is an immutable system: the root filesystem comes from a read-only SquashFS image, and writes at runtime go to tmpfs, gone on reboot.

At boot, SquashFS is the OverlayFS lower layer and tmpfs is the upper, stacked into /. What you see is a Gentoo you can read and write normally, except changes to /usr live only in memory. On reboot the upper is discarded and the system returns to the image.

Paths that need to survive (/home, /etc, /var/log, and so on) are attached from a persistent partition at boot; that partition is optional.

A generation is the version of the whole thing. An update produces a new read-only image and its mount record, and once the objects and manifest are written, current is atomically pointed at it; a rollback points previous back.

This post covers the boot flow, persistence and updates, and ends with a list of what still needs work.

Terminology

A few terms used below:

Term What it means here
closure The complete set of system files in one generation, including the base and all FHS layers
generation An immutable record pointing at a closure, a boot plan and a realization; current is the selected one and previous the rollback target
manifest The content inventory of a generation: which objects it contains, the parent generation, PortageState
plan / boot plan A small summary read first at boot, binding the generation digest, target and realization
realization How to mount the closure: SquashFS object, dm-verity root hash, salt, layer order
dm-verity A per-block Merkle tree; the root hash lives in the realization and the kernel verifies blocks as they are read
signify OpenBSD’s Ed25519 signing tool, used to sign realization plans
slot An A/B whole-system image slot in the state partition, a separate update path from generations

Why I Built It

I’ve used Gentoo for years and like its USE flags and the control they give me. The problem is that the state of the system is just “the current pile of files”: power loss halfway through an update, a package upgrade that breaks config compatibility, wanting to roll the system back to last week’s state — none of it is easy to handle.

NixOS’s generation model appealed to me, but /nix/store is incompatible with FHS, and plenty of existing binaries, scripts and drivers won’t install into it. I want to keep Gentoo’s package management and ordinary FHS paths, and make only the “system state” layer generation-based. Whether that direction is right is something I’m still testing.

The first version was straightforward: at boot, unpack the entire root filesystem into tmpfs. The prototype worked, but the numbers were ugly. A full copy took about 440 seconds under QEMU TCG; stage3 unpacks to 2,961,144 KiB (about 2.8 GiB), and after copying to tmpfs an 8 GiB VM had only 3.5 GiB free, with 134,221 inodes to expand on every boot.

After switching to a SquashFS read-only lower plus a tmpfs overlay, booting to login in the same environment took about 20 seconds, the write layer used 64 KiB, and 7.9 GiB was available. The comparison was clear, so I made store-overlay the default mode: the system closure stays on disk, the kernel reads compressed blocks on demand, and tmpfs holds only runtime changes.

Approach System unit Update model How Volatoo differs
NixOS /nix/store closure generation Keeps FHS, content-addressed closure
Silverblue OSTree image rpm-ostree Keeps Portage
MicroOS Btrfs snapshot transactional-update SquashFS plus dm-verity
Android dm-verity plus A/B slot A full Gentoo userspace

What the System Looks Like

Volatoo separates the immutable part from the writable part. The persistent partition is optional, its filesystem label is VOLATOO-STATE, and it contains /volatoo/:

/volatoo/
├── config/          # persist.conf, identity.conf
├── data/            # persistent data for bind/overlay/sync
├── snapshots/       # restore snapshots, /etc conflicts
└── system/
    ├── objects/sha256/      # content-addressed closures and layers
    ├── manifests/           # generation manifest
    ├── plans/               # generation to boot plan
    ├── realizations/        # bindings for full closures or layer stacks
    ├── signatures/          # signify signatures
    ├── current              # selected generation
    └── previous             # rollback target

objects/sha256 holds the real files (SquashFS, layers, verity tree), manifests records which objects make up a generation, and plans is the small summary read first at boot.

realizations records how to mount (root hash, salt, layer order), and signatures holds the signatures over the realization plan.

Objects are content-addressed, so several generations can share the same base or layer; an update publishes only the new layer and hash tree instead of copying the whole system. Without this partition, the system is entirely volatile.

The system closure can be a full SquashFS image (releases and compaction) or a base plus a series of small FHS layers (day-to-day updates). A complete development-gate closure is 574,824,448 bytes with a 4,534,272-byte dm-verity hash tree, roughly 0.79% overhead.

At boot the closure is the read-only lower and tmpfs is the OverlayFS upper, so / is writable but changes live only in memory.

There are three root modes:

Mode lower upper Used for
store-overlay SquashFS or layer stack on disk tmpfs Default
ram-overlay Compressed image in tmpfs (read-only loop) Another tmpfs PXE, USB sticks, diskless
copy None; full file tree expanded into tmpfs tmpfs Compatibility and debugging

The old overlay is a compatibility alias for store-overlay, not a separate mode.

Updates take two paths. generation is package-level incremental updates: one package transaction produces a small FHS layer (the file differences from this update, keeping ordinary paths like /usr and /etc), the base and each layer have their own dm-verity, and at boot they are stacked into the lower in order.

slot is whole-system updates: the kernel, initramfs and root.squashfs of a new release go into the other slot of the state partition, and you reboot into the new slot. Both paths share one state partition, but a boot takes only one.

Boot Flow

An ordinary Volatoo boot has two cases. The early steps are the same; they split at “which root to pick”:

  • release disk / direct image: there is no generation, and the initramfs finds the configured image. On a release disk it is root.squashfs in the VOLATOO-SYSTEM partition; once found, verify its SHA-256 and mount it as the read-only lower.
  • installed system: state has current, so the initramfs reads the generation, verifies the realization plan signature, and opens the read-only lower with dm-verity.

A slot boot is the third case and needs state: set volatoo.root=slot on the cmdline, and the initramfs verifies the slot manifest signature and the root’s SHA-256, then mounts that slot’s root.squashfs.

Whichever path is taken, a tmpfs upper is stacked on top at the end, persist and identity are applied, and the initramfs switches root to the real init.

flowchart TD
    A["Firmware / bootloader"] --> B["kernel + initramfs"]
    B --> C["/init: mount proc/sys/dev, read config"]
    C --> D{"current present in state?"}
    D -->|yes| E["Read manifest / plan / realization"]
    E --> F["Verify realization plan signature with signify"]
    F --> G["Open read-only lower with dm-verity"]
    D -->|no| H["Find the configured image"]
    H --> I["Verify SHA-256, mount SquashFS"]
    G --> J["tmpfs upper + OverlayFS"]
    I --> J
    J --> K["Apply persist and identity"]
    K --> L["Move mounts to /.volatoo"]
    L --> M["switch_root → persist-early → init"]
    M --> N["OpenRC / systemd"]

A Release-Disk Boot

Taking a release disk as the example, the whole process goes roughly like this:

  1. UEFI or BIOS loads the bootloader. The preview images use GRUB; the UEFI path for signed releases may be a UKI. The bootloader reads the kernel and initramfs into memory, the kernel starts, and it runs /init from the initramfs.
  2. /init mounts /proc, /sys and /dev, and reads default.conf plus the volatoo.* parameters on the kernel command line.
  3. It finds the VOLATOO-SYSTEM partition, mounts root.squashfs from it read-only, and verifies its SHA-256.
  4. It creates a tmpfs as the OverlayFS upper; with SquashFS as the lower, the two are stacked into the new root.
  5. It finds the VOLATOO-STATE partition and applies the bind / overlay policies from persist.conf.
  6. It moves the lower, tmpfs and state mounts under /.volatoo and switches root to the real init; with state present it goes through volatoo-persist-early first, which restores the sync policies, applies the machine identity, and then execs the real init.

On an installed system, step 3 becomes the generation path: read current, verify the realization plan signature, open the lower with dm-verity, then continue with step 4. All of this logic lives in initramfs/init.

From Firmware to initramfs

UEFI loads the bootloader from the ESP; BIOS loads GRUB from the BIOS boot partition at the start of the disk.

Signed release media under UEFI can use a signed UKI, packing the kernel, initramfs, cmdline and OS identity into a single PE that Secure Boot verifies first. In the developer preview, images with secure_boot=no use plain GRUB UEFI, and BIOS also uses GRUB.

The bootloader puts the kernel and initramfs in memory and jumps to the kernel.

The kernel unpacks the initramfs and runs /init. This init is a static BusyBox script that first mounts /proc, /sys and /dev (devtmpfs).

It then reads two sources of configuration: default.conf compiled into the initramfs, and the volatoo.* parameters on the kernel command line. The command line can override the image location, state, generation, root mode, tmpfs size and signature policy. persist.conf in state is not sourced here; it is parsed as data only.

Finding the Image and State

VOLATOO_IMAGE is where the image lives; it can be /dev/vda, LABEL=... or UUID=....

If the image is inside a filesystem or ISO, use VOLATOO_IMAGE_FILE to point at the root.squashfs inside it. The initramfs mounts the container read-only and mounts the SquashFS through a read-only loop device. A bare SquashFS partition only needs VOLATOO_IMAGE.

Devices are waited on for up to 10 seconds; USB sticks and internal disks use the same configuration.

VOLATOO_STATE defaults to LABEL=VOLATOO-STATE. Without this partition the system is entirely volatile; VOLATOO_STATE_REQUIRED=yes waits 10 seconds and then drops to rescue.

Once state is found, the initramfs mounts it read-write and checks /volatoo/layout-version; an unknown layout drops to rescue. It never creates or formats the state partition — that’s the installer’s job.

Selecting a Generation, Verifying Signatures

With /volatoo/system present in state, VOLATOO_GENERATION=auto reads the generation digest from current.

A generation has three parts:

  • manifest: the full inventory, recording which objects this generation contains and which generation is its parent.
  • plan: a one-page summary read first at boot, binding the generation digest, target and realization.
  • realization: the mount parameters, recording the root hash, salt and layer order.

At boot the manifest digest is checked first (without parsing the whole JSON), then the plan is read; the realization is only read when a mount is needed. This keeps the boot path from parsing a potentially large manifest.

If current fails verification, previous is tried, and previous must independently pass the same checks. You can also specify none or a particular digest for recovery.

Release images and machines without current use generation=none; the initramfs prints generation selection disabled for this boot or no current generation; using configured image and mounts the configured image directly.

The default is VOLATOO_SIGNATURE_POLICY=required. The initramfs verifies the signify signature on the realization plan with an embedded public key, before parsing the root hash.

dm-verity can only prove that the data blocks match the root hash, not who supplied the root hash; the signature closes that gap. allow-unsigned is a downgrade for development or recovery, and it warns explicitly.

Opening dm-verity, Assembling lower and upper

dm-verity adds a per-block verification layer under SquashFS. The kernel verifies a block when it reads it, rather than hashing the whole image at boot.

  • A v2 realization is one whole SquashFS plus a hash tree, mapped as /dev/mapper/volatoo-root.
  • A v3 realization is a base plus a series of FHS layers, each with its own dm-verity device mapped as /dev/mapper/volatoo-lower-N, stacked into the lower in order.

Change one data block or one used hash-tree block and the mount fails.

Then it creates a tmpfs for upper and work, defaulting to 80% of memory; OverlayFS merges the lower and the tmpfs upper at /newroot.

v3 deletions are encoded directly in the layers (a whiteout is OverlayFS’s deletion marker, and an opaque directory means the whole directory was replaced), so deletions don’t need to be replayed into the upper.

Persistence and switch_root

The bind and overlay entries in persist.conf are mounted by the initramfs before switch_root; sync and machine identity are handled by persist-early after switch_root. The details of each policy are in the Persistence section below.

/etc is not overwritten directly from a snapshot; it goes through a three-way merge: the previous image’s /etc is the base, the last synced local /etc is local, and the new image’s /etc is new. On conflict the local version is kept and the image version is placed alongside as ._cfgNNNN_.

Machine identity and logs persist by default: machine-id, SSH host keys, /var/log. Without state none of these exist, and every boot is a new identity.

switch_root discards the initramfs, so before switching, the initramfs moves the lower, writable, state and source mounts under /newroot/.volatoo/, and moves /proc, /sys and /dev over as well.

With state present, switch_root runs /usr/libexec/volatoo-persist-early; only without state does it go straight to /sbin/init.

volatoo-persist-early restores sync policies, applies the machine identity and the first-boot admin access configuration, and finally execs the real init.

This has to happen before services start, otherwise services would see the old /etc, or a machine-id that differs per machine.

After init

OpenRC or systemd sees an ordinary Gentoo root:

/                          overlay (lower: SquashFS, upper: tmpfs)
/.volatoo/lower     read-only SquashFS or layer stack
/.volatoo/writable  tmpfs (upper/work)
/.volatoo/state     ext4, LABEL=VOLATOO-STATE

Services start normally and writes go into the tmpfs upper. At shutdown the persist service runs sync once more.

The next boot again starts from the selected generation: changes in /usr, temporarily installed packages and unsynced /etc changes are gone; the bind/overlay/sync data and identity in state remain.

On failure the initramfs uses stable error codes such as image.not-found, image.integrity, state.layout-version, persist.config, generation.verity, root.init-missing.

Before dropping to rescue it prints the command line, effective configuration, /proc/partitions, blkid and the mounts already set up. Rescue is the same BusyBox without loading the full system. If current fails verification it falls back to previous.

Why the lower Stays on Disk

I ended up keeping the lower on disk for a practical reason: a full copy into tmpfs removes runtime dependence on the image device, but every boot has to expand several GB and over a hundred thousand inodes.

SquashFS reads by block, so boot only touches the working set and leaves memory for applications. The cost is that runtime reads go back to the storage device, which can’t be unplugged.

ram-overlay is for cases where the disk must be removed or there is no disk: it copies the compressed image without expanding the file tree, and detaches the source device once the copy is done.

Why Signatures Too

If a SquashFS block is changed, the kernel doesn’t necessarily know. dm-verity is like a Merkle tree: every data block has a hash, the hashes roll up into a root hash, and blocks are verified as they are read. The root hash lives in the realization plan.

The plan is small, signed with the release private key, with the public key embedded in the initramfs. Someone who can modify state can swap the plan, root hash, SquashFS and hash tree together; the signature pins the plan to the release key, and dm-verity pins the data to the plan.

If the kernel and initramfs loaded by the bootloader are swapped, the embedded public key is swapped too. Release media anchor this layer with a signed UKI plus Secure Boot; under BIOS there is no such link in the chain, and the boot medium is what you have to trust.

Persistence

Without state everything is volatile. With state, machine-id, SSH host keys and logs persist by default, so a machine doesn’t get a new identity on every boot; each of the three can be turned off individually.

Other paths must be declared explicitly in /volatoo/config/persist.conf, one per line:

bind     /home      home
overlay  /var/lib   var-lib
sync     /etc       etc

bind copies the image directory to /volatoo/data/bind/<key>/root on first boot, then bind-mounts that directory on every subsequent boot. Writes land directly in state and are still there on the next boot.

overlay uses the image directory as the lower and puts upper/work in /volatoo/data/overlay/<key>/. An image update changes the lower, local changes stay in the upper, and deletions use whiteouts.

sync restores the most recent full snapshot to the target early in boot, and writes it back on volatoo-persist sync or at shutdown. /etc goes through a three-way merge rather than being overwritten:

Local vs base New image vs base Result
unchanged unchanged Use the new image
unchanged changed Use the new image
changed unchanged Use local
changed changed the same way Use either one
changed changed differently Keep local, place the image version alongside as ._cfgNNNN_, record a conflict

Conflicts never write merge markers into the live config files. Structural conflicts — ones that can’t be placed alongside — go into the state snapshot directory; boot continues but warns.

Recovery failures (missing base, corrupt metadata, unsafe paths) drop to an emergency shell instead of starting the real init with half-restored state.

State is currently plain ext4; LUKS is still on the roadmap. Persisting /etc means the keys inside it also stay in the state partition in plaintext, which is a trade-off you have to weigh yourself.

Updates and Rollbacks

Take a package update as an example. It goes through Volatoo’s planner/engine pipeline, with the development store accessed through volatoo-update-view as a private writable view.

The planner generates a BuildSpec (which packages to install this time and what the target is), fetches binpkgs from local disk or a binhost, does binary-only installs in staging, packs the differences into an FHS layer, synthesizes a realization, signs it, and switches current.

After a reboot the new generation takes effect; if you don’t like it, volatoo-generation rollback points current back at previous.

flowchart LR
    G1["G1: base"] --> G2["G2: G1 + layer A"]
    G2 --> G3["G3: G2 + layer B"]
    C["current"] -.-> G3
    P["previous"] -.-> G2

generation v2 also binds PortageState into the generation, including Portage configuration, world, repository snapshots, profile and toolchain. PortageState is a complete snapshot of the Portage inputs for that generation.

Each layer records its parent generation, up to 256 layers, after which compaction kicks in. Compaction merges a long chain of layers into one full closure so the chain doesn’t grow unbounded.

All objects are content-addressed. Publishing writes the objects and manifest first, then atomically updates current. Activation carries the expected current digest, and a publish based on an old generation is rejected.

A rollback just points previous back (a previous only exists after the first update), and previous must also pass generation and realization verification.

The host sees the system store as read-only; only the update view has write access, in a private mount namespace. The update view is a temporary writable mount view that disappears when the command exits, so ordinary processes can’t touch the writable store.

slot is whole-system updates. The kernel, initramfs and root.squashfs of a new release go into the other slot of the state partition; the slot manifest is a signed VOLATOO_SLOT_V1 binding channel, init system, object digests and sizes.

The bootloader picks a slot by pending/active markers; the initramfs verifies the manifest signature and the root’s SHA-256 and size, and on failure decrements tries, clears pending, and returns to active. The state partition is shared across slots, so identity, persist and the generation store are unaffected.

generation and slot are two different paths: generation for day-to-day package updates, slot for whole-system releases, kernel or init system changes. A boot takes only one, and a slot boot sets volatoo.generation=none.

dm-verity only guarantees that the blocks read match the root hash; it doesn’t know who supplied the root hash, and signatures solve that second problem.

The generation trust chain is: public key in the initramfs → signify signature → realization plan → generation, boot plan, context → image records → dm-verity root hash → SquashFS blocks. The slot chain is: public key → signed slot manifest → SHA-256 and size of kernel, initramfs and root. Neither chain signs the whole root; large files are verified with dm-verity or SHA-256.

Signed rollback is intentional: any old generation with a still-valid signature can be selected. Preventing replay of old releases needs TPM or protected UEFI monotonic state, which isn’t done yet.

Measurements and Limits

The numbers below come from QEMU TCG, cross-architecture emulation, not native performance. They are for comparing approaches, not for predicting your machine.

Item Figure
Full copy into tmpfs about 440 s to boot, 2.8 GiB root, an 8 GiB VM left with about 3.5 GiB
SquashFS + tmpfs overlay about 20 s to boot, 64 KiB write layer, about 7.9 GiB available
Signed realization v3 (development fixture) root authentication and switch_root 4 s BIOS / 7 s UEFI; systemd PID 1 12/13 s, OpenRC 10/12 s; login 38/40 s systemd, 41/43 s OpenRC
Closure and verity 574,824,448 / 4,534,272 bytes, about 0.79%
Phase 0 stage3 image (the project’s early OCI stage3, including the Rust toolchain) zstd 19, 574,746,624 bytes, 50 s to build

The numbers in the table come from the development notes in docs/design/boot.md and the TCG environment; repeated runs will vary.

The Phase 0 row uses the project’s early gentoo/stage3 OCI image; the 2026-11 stage3 is much smaller. This set is what I reproduced with the current stage3: a 304 MiB SquashFS built in about 20 s; a direct BIOS image boot to a shell in 10 s, an OpenRC boot with state in 26 s, and 43 s under UEFI.

The native x86_64 plus KVM benchmark script is scripts/measure-native-root-modes.sh; reference-hardware numbers aren’t recorded yet.

What Still Needs Work

v0.1-dev is still a preview, and v0.1.0 isn’t tagged yet. These are the pitfalls I know about for now — some are unfinished, some are deliberately left for later.

  • state is plaintext: machine-id, SSH host keys, authorized_keys, keys in /etc and logs all sit in ext4; anyone with the disk can read and modify them. LUKS is still on the roadmap.
  • the boot chain has no root of trust: on BIOS and on preview images with secure_boot=no, image-sha256 is written into the GRUB cmdline, and whoever can change the image can change that value too. Signing with a UKI plus Secure Boot currently only covers signed release media.
  • no replay protection: current/previous and slot active/pending are not monotonic state, so an old but validly signed generation or slot can be selected again. The preview’s SHA256SUMS isn’t signed with an offline production key, and PXE has no release key verification.
  • no one-command update yet: planner/engine is a development pipeline and volatoo-generation is a low-level tool. generation and slot rollback semantics also differ; a slot’s tries only covers failures the initramfs can observe, and previous only exists after a second selection.
  • no fsck on state boot: the initramfs mounts read-write directly and relies on ext4 journal replay; errors outside the journal mean rescue. When I assembled a release disk this time, a state image dirtied by poweroff -f made e2fsck fail outright.
  • persist-early failure cuts you off: if identity, firstboot-access or persist restore fails, it drops to an emergency shell with no option to fall back to a snapshot or skip this boot’s persist. A machine with no keyboard and no SSH key can’t be operated.
  • the tmpfs upper has no disk backing: the default is 80% of memory, so large writes can fill it; store-overlay in turn depends on the image device. /etc three-way merge conflicts also need manual handling.
  • build inputs aren’t pinned: fetch-gentoo-inputs.sh takes the latest stage3 and the newest snapshot, so the next build picks up new inputs. The prototype and Catalyst have drifted apart; the missing volatoo-firstboot-access this time is an example.
  • the systemd path isn’t fully verified: the Catalyst systemd root got stuck in the builder sandbox, and the official image download was too slow, so it never booted; journald persistence is still inferred. arm64 and native KVM numbers are also still missing.

How to Try It

The repo is github.com/Volatoo/Volatoo and the preview is at v0.1.0-dev.20260814; details on installation, persistence and building are in the handbook.

Installation requires specifying the target disk explicitly. By default you must provide an SSH public key; you can explicitly choose --no-provision-access, but that means arranging access some other way. No default credentials are set. OpenRC and systemd are two separate images, and you can’t switch between them after installation.

Building it yourself needs Docker: fetch the Gentoo inputs, build the Catalyst root, build the kernel and initramfs, assemble the release disk, and finally verify it with a QEMU gate.

References