raft / docs
Guides

Snapshots and forks

Raft captures filesystem snapshots, rolls back changes, and clones workspaces on the same host.

Target workspace handle

Commands in this guide require a stopped workspace:

CONTROLLER: Select and stop target workspace
raft list
box="lab:rf-a1b2c3d4e5f60718"  # Replace with your actual workspace handle
raft stop "$box"

Stopped-source requirement

Workspace must be stopped

Creating a snapshot, restoring from a snapshot, or forking requires a stopped container. Operations run under host lock /run/lock/raft-incus.lock to prevent concurrent disk modification.

Creating snapshots

Take a point-in-time snapshot of the stopped workspace filesystem:

CONTROLLER: Create a named snapshot
raft snapshot "$box" pre-upgrade

Snapshot names must use letters, digits, underscores, or hyphens up to 64 characters.

Listing snapshots

View existing snapshots for a workspace:

CONTROLLER: List existing snapshots
raft snapshots "$box"

The command prints snapshot names and creation timestamps from Incus metadata.

Restoring from a snapshot

Roll back a stopped workspace to a previously recorded snapshot:

CONTROLLER: Restore snapshot
raft restore "$box" pre-upgrade

Configuration preservation during restore

raft restore executes Incus snapshot restore with --diskonly. It rolls back filesystem blocks while preserving container configuration, CPU and memory limits, and the eth0 network MAC address.

Resume the workspace with a renewed lifetime:

CONTROLLER: Resume restored workspace
raft resume "$box" --ttl 600

Forking a workspace

Forking creates an independent clone on the same host:

CONTROLLER: Fork workspace into a new clone
copy=$(raft fork "$box" --ttl 600)
echo "Created fork: $copy"

Characteristics of forked workspaces

  • Instance-only copy: Uses Incus --instance-only. Filesystem data, installed packages, and /workspace files are copied; source snapshots are not inherited.
  • Immediate start: raft fork launches the new container immediately with the specified TTL while the source remains stopped.
  • Fresh network identity: The fork receives a new container name, a fresh MAC address on rfbr0, and an independent IP address.
  • Capacity accounting: The fork counts toward the location's four-saved-box limit and uses storage from the shared 60 GiB Btrfs pool.

Destroy the clone when finished to release capacity:

CONTROLLER: Destroy forked workspace
raft destroy "$copy"

On this page