Recovery¶
Recovery Scenarios¶
| Scenario | Solution |
|---|---|
| Accidental file deletion | Restore from snapshot |
| Bad upgrade | Rollback to snapshot |
| Container failure | Recreate container |
| Host failure | Reinstall OS, import pool |
| Disk failure | Restore from backup |
File Recovery from Snapshot¶
Access Snapshot Directory¶
Copy File Back¶
cp /mnt/tank/nextcloud-data/.zfs/snapshot/hourly-2024-01-15/file.txt \
/mnt/tank/nextcloud-data/file.txt
Dataset Rollback¶
Destructive
Rollback destroys all changes since the snapshot.
# Stop services using the dataset
docker compose down
# Rollback
sudo zfs rollback tank/nextcloud-data@before-upgrade
# Restart services
docker compose up -d
Container Recovery¶
Containers are disposable. To recover:
Data persists in ZFS bind mounts.
Host Recovery¶
If the host OS fails but ZFS pool is intact:
- Install fresh Ubuntu Server
- Install ZFS:
- Import pool:
- Reinstall Docker and services
- Start containers with existing bind mounts
See Rebuild Checklist for detailed steps.
Disk Failure Recovery¶
Single Disk Pool (No Redundancy)¶
If a disk fails, restore from backup:
- Replace failed disk
- Create new pool
- Restore from remote backup:
If You Had a Mirror¶
Database Recovery¶
From Snapshot¶
From SQL Dump¶
VM Recovery¶
From Snapshot¶
Corrupted VM Disk¶
Restore from backup or recreate from installation media.
Recovery Testing¶
Schedule regular recovery drills:
- Monthly: Restore file from snapshot
- Quarterly: Clone dataset and verify service starts
- Yearly: Full rebuild test on spare hardware