fix(nb): share the card's image store instead of copying it locally #250

Merged
dominik.polakovics merged 1 commit from fix/nb-wow-shared-image-store into main 2026-08-01 20:00:47 +02:00

Reverses the per-machine image store from #246. One store on the card serves
both machines, which is what the card was designed for.

The version gap was not real

nb's podman 5.8.2 reads a store the handheld's 6.0.1 wrote — all five images,
no complaint. What actually broke was narrower: podman refuses a store whose
recorded paths differ from the current ones, and the card mounts under a
different user per machine (/run/media/deck vs /run/media/dominik). Those
paths belong to libpod's database, not to the images. bin/common.sh now
points that database at host-local state via CONTAINERS_CONF_OVERRIDE
([engine] static_dir), which merges over the host config rather than replacing
it, so distro helper-binary paths survive.

The part that was genuinely NixOS-specific

The store carries overlay/.has-mount-program, but nothing named the mount
program. Arch has fuse-overlayfs on PATH so podman finds it; NixOS does not,
so podman falls back to native kernel overlay, and creating a container off the
ext4 card then fails:

Error: creating /etc/mtab symlink: value too large for defined data type

common.sh now names fuse-overlayfs explicitly and dies with a clear message
when it is missing.

On the two false starts

I twice reported the shared store as unworkable. Both were wrong, and worth
recording because the failure mode is deceptive:

  • I blamed layer diff dirs being mode 0555. They are — but the local copy
    that works fine on nb has 202 such dirs against the card's 200, so
    that was never the difference.
  • What actually happened was a cascade. The first native-overlay failures left
    stale directories in overlay/tempdirs, whose diff dirs podman cannot
    chmod before unlinking. Every subsequent load tripped on those, reported the
    images as corrupt, and fell back to pulling from a localhost registry that
    does not exist. Clearing tempdirs once, with the mount program named, and it
    all works.

Testing

Full server-up.sh / server-down.sh against the card's store: worldserver
ready in 14s (10s for the local copy), database synced back, tokens matching,
and zero temp dirs left in overlay/tempdirs after the cycle. Also verified
each of the three images runs directly off the card with --pull=never.
scripts/test-configuration nb passes.

After deploy

The 44GB copy at ~/.local/share/wow-portable/containers becomes dead weight
and can be removed.

Reverses the per-machine image store from #246. One store on the card serves both machines, which is what the card was designed for. ### The version gap was not real nb's podman 5.8.2 reads a store the handheld's 6.0.1 wrote — all five images, no complaint. What actually broke was narrower: podman refuses a store whose recorded paths differ from the current ones, and the card mounts under a different user per machine (`/run/media/deck` vs `/run/media/dominik`). Those paths belong to **libpod's database**, not to the images. `bin/common.sh` now points that database at host-local state via `CONTAINERS_CONF_OVERRIDE` (`[engine] static_dir`), which merges over the host config rather than replacing it, so distro helper-binary paths survive. ### The part that was genuinely NixOS-specific The store carries `overlay/.has-mount-program`, but nothing named the mount program. Arch has `fuse-overlayfs` on PATH so podman finds it; NixOS does not, so podman falls back to native kernel overlay, and creating a container off the ext4 card then fails: ``` Error: creating /etc/mtab symlink: value too large for defined data type ``` `common.sh` now names `fuse-overlayfs` explicitly and dies with a clear message when it is missing. ### On the two false starts I twice reported the shared store as unworkable. Both were wrong, and worth recording because the failure mode is deceptive: - I blamed layer `diff` dirs being mode `0555`. They are — but the local copy that works fine on nb has **202** such dirs against the card's **200**, so that was never the difference. - What actually happened was a cascade. The first native-overlay failures left stale directories in `overlay/tempdirs`, whose `diff` dirs podman cannot `chmod` before unlinking. Every subsequent load tripped on those, reported the images as corrupt, and fell back to pulling from a `localhost` registry that does not exist. Clearing `tempdirs` once, with the mount program named, and it all works. ### Testing Full `server-up.sh` / `server-down.sh` against the card's store: worldserver ready in 14s (10s for the local copy), database synced back, tokens matching, and **zero** temp dirs left in `overlay/tempdirs` after the cycle. Also verified each of the three images runs directly off the card with `--pull=never`. `scripts/test-configuration nb` passes. ### After deploy The 44GB copy at `~/.local/share/wow-portable/containers` becomes dead weight and can be removed.
The per-machine store was justified by a podman version gap that does not
exist: 5.8.2 here reads a store the handheld's 6.0.1 wrote, all five images,
without complaint. What actually broke was narrower — podman refuses a store
whose recorded paths differ from the current ones, and the card mounts under a
different user on each machine. Those paths belong to libpod's database, not to
the images. bin/common.sh now keeps that database in host-local state, so one
store on the card serves both machines.

That alone was not enough here. The store carries overlay/.has-mount-program,
but nothing named the mount program, and podman on NixOS then picks native
kernel overlay because it cannot find fuse-overlayfs on PATH the way Arch can.
Creating a container off the ext4 card then fails with

  Error: creating /etc/mtab symlink: value too large for defined data type

so common.sh names fuse-overlayfs explicitly, and errors clearly when it is
absent.

Verified: full server-up and server-down against the card's store, worldserver
ready in 14s against 10s for the local copy, database synced back, and no temp
dirs left behind afterwards. Earlier attempts appeared to fail structurally, but
that was a cascade — the first native-overlay failures left stale temp dirs in
overlay/tempdirs which every later load then tripped over, reporting the images
as corrupt.

Drops the 44GB duplicate on this host, and with it the need to re-copy whenever
the handheld rebuilds images.
dominik.polakovics deleted branch fix/nb-wow-shared-image-store 2026-08-01 20:00:47 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Cloonar/nixos!250
No description provided.