Snapshots¶
Overview¶
Snapshots are read-only, point-in-time copies of datasets. They're instant and space-efficient.
Manual Snapshots¶
Create Snapshot¶
Recursive Snapshot¶
List Snapshots¶
Delete Snapshot¶
Rollback¶
Destructive Operation
Rollback destroys all changes since the snapshot.
For rollback to older snapshots, destroy intermediate ones:
Access Snapshot Data¶
Snapshots are accessible in a hidden directory:
Recover individual files by copying from snapshot.
Automated Snapshots¶
Using zfs-auto-snapshot¶
Default policies:
- Frequent: every 15 minutes, keep 4
- Hourly: keep 24
- Daily: keep 31
- Weekly: keep 8
- Monthly: keep 12
Disable for Specific Datasets¶
Snapshot Policies¶
| Dataset | Policy | Rationale |
|---|---|---|
| nextcloud-data | Frequent + Daily + Monthly | User data, needs recovery options |
| db | Hourly + Daily | Database state changes often |
| media | Weekly only | Large, rarely changes |
| containers | None | Disposable state |
| vm | Before major changes | Manual snapshots preferred |
Send/Receive¶
Transfer snapshots between pools or machines: