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:
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:
raft snapshot "$box" pre-upgradeSnapshot names must use letters, digits, underscores, or hyphens up to 64 characters.
Listing snapshots
View existing snapshots for a workspace:
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:
raft restore "$box" pre-upgradeConfiguration 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:
raft resume "$box" --ttl 600Forking a workspace
Forking creates an independent clone on the same host:
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/workspacefiles are copied; source snapshots are not inherited. - Immediate start:
raft forklaunches 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:
raft destroy "$copy"