| name | create-snapshot |
| description | Use when the user wants to take a BTRFS snapshot before a risky change. |
Create Snapshot
Take a manual BTRFS snapshot before upgrades, config edits, or package installs.
When to use
- Before running a risky system change
- Creating a baseline before testing
- Archiving a known-good state
Inputs to gather
- Snapper config name (e.g.,
root, home)
- Description (what change prompted this snapshot)
- Snapshot type (optional;
single default, or pre for paired pre/post)
Procedure
- Preflight: Verify target is BTRFS. Confirm
snapper is installed; fall back to raw btrfs subvolume snapshot if no config exists.
- If snapper config exists: Run
sudo snapper -c <config> create --type <type> --print-number -d "<description>". Capture the numeric ID.
- If no snapper config: Run
sudo btrfs subvolume snapshot <source> <dest> with a timestamped name.
- Print the new snapshot ID to stdout (for caller to capture).
Output / side effects
New snapshot created on the target subvolume. Returns the snapshot ID.
Safety / constraints
Creates a read-only BTRFS snapshot. Requires sudo. No data modification; snapshot space depends on CoW changes afterward.