Skip to content

Volumes

Persistent volumes are ext4 filesystems that survive sandbox destruction. Create one, attach it at sandbox creation with --volume name:/mount, destroy the sandbox — the data stays.

CommandDescription
bhatti volume createCreate a persistent volume.
bhatti volume listList your volumes and current attachments.
bhatti volume deleteDelete a volume. Requires it to be detached.
bhatti volume resizeGrow a volume. Cannot shrink.
bhatti volume clonePoint-in-time copy. Source must be detached.
bhatti volume backupBack up to S3-compatible storage. Requires server S3 config.
bhatti volume backup-listList backups for a volume.
bhatti volume restoreRestore from a backup. Volume must be detached.
bhatti volume backup-deleteDelete a backup.

Four operations require the volume to have no sandbox attachments: delete, resize, clone, and restore return 409 Conflict while it belongs to a sandbox, even a stopped one.

Stop does not detach. It powers off the guest but preserves its volume attachment for the next boot. Destroying the sandbox releases the volume (its root disk is deleted); if you need a copy of the entire sandbox instead, use a named memory snapshot or fork. A filesystem snapshot captures only the root disk, not attached volumes.

backup works on attached volumes. The server quiesces each running guest, clones the volume locally, then thaws it before compression/upload. New agents freeze/thaw the filesystem (frozen); older agents sync only (sync_only). A backup of a volume without running guests (including one whose attached sandbox is stopped) has mode detached; older backups without recorded consistency can say unverified. Inspect the API’s consistency_mode metadata if you need to distinguish them; CLI backup-list currently omits this field. See Data & durability.

Terminal window
# Prepare an unattached volume before attaching it
bhatti volume create --name workspace --size 5120
# Grow/clone a volume before attaching it; stop alone does not detach
bhatti volume resize workspace --size 10240
bhatti volume clone workspace --name workspace-pre-upgrade
bhatti create --name dev --volume workspace:/workspace
# Off-site backup (requires `backup` config block on server)
bhatti volume backup workspace
bhatti volume backup-list workspace

backup, restore, backup-list, and backup-delete require an S3-compatible storage backend configured on the server. Without it, they return 501 Not Implemented with the message backup not configured — add backup section to config.yaml. See Configuration: backup.