ash-rebuild-db(1)Ash Manualash-rebuild-db(1)

NAME

ash-rebuild-db - rebuild a VM's Nix store database

DESCRIPTION

Deletes the named VM's strategy-specific Nix store state, then regenerates it from the VM's saved ash-state.toml and current NixOS closure.

WHAT IT RESETS

For strategy=shared, rebuild-db removes only the Nix-related directories below shares/{ro,rw}/system, including local-overlay metadata, upper, and work directories. For strategy=image, it removes nix-store.img and its closure marker but preserves the closure base under $XDG_CACHE_HOME/$ASH_NAME/nix-store-images. ASH_NAME defaults to ash. The replacement image reuses that cache when the closure matches. In either case, guest-installed store paths are discarded.

SAFETY

The VM must be stopped. persist.img, workspace, SSH keys, runtime mount state, and other non-store share data are preserved.

REGENERATION

After removing the store state, ash resolves the saved flake again, prepares the configured store strategy, and regenerates virtle.toml and SSH helper scripts. The next normal spawn starts with the rebuilt store.

EXAMPLES

ash stop work
ash rebuild-db work
ash attach --spawn work

Generated from ash Cmdliner manpage metadata.

ash-rebuild-db(1)ash 0.1.9ash-rebuild-db(1)