Lesson 8 of 9 · 29m
Backups, Restores, and Disaster Recovery You Have Actually Proven
Design backup coverage around recovery objectives, encrypt and separate copies, and practice restores because backup success is not recoverability.
The backup job can succeed every night and still leave you unable to recover. I have seen perfect archives of the wrong directory, encrypted backups with the only key stored beside them, database dumps corrupted because they were taken mid-write, and an offsite copy nobody could decrypt because the restore machine lacked the exact tool version. The senior question is never "do you have backups?" It is "what recovery have you demonstrated lately?"
Define recovery objectives in plain language
Two numbers shape everything:
RPO how much data loss is acceptable
RTO how long the service can remain unavailablePhotos and documents may tolerate an RPO of 24 hours but need strong deletion protection. A password database may need frequent replication because losing a day of changes is unacceptable. A game server world may need both frequent snapshots and fast restore. Write this per service, not as a vague lab-wide slogan.
Use the 3-2-1 rule as a floor
3 copies of important data
2 different media or systems
1 copy offsite or outside the failure domainA practical home-lab implementation is a NAS copy, a second local machine or disk, and encrypted object storage. Exactly one of those should not be reachable by the same compromised administrator credential. Immutability or object lock matters when ransomware or credential compromise is part of the threat model.
Restic is a strong small-lab pattern
export RESTIC_REPOSITORY=s3:https://s3.us-east-va.io.cloud.ovh.us/lab-backups
export RESTIC_PASSWORD_FILE=/root/.restic-password
restic backup /srv/files/data /srv/files/config --exclude-file /etc/restic/excludes --tag files
restic forget --keep-daily 14 --keep-weekly 8 --keep-monthly 12 --prune
restic check --read-data-subset=5%The details matter: credentials are separate from the host being protected, retention is explicit, and repository integrity is checked. But even restic check does not prove application-level recovery.
Databases need consistency, not file copying
Copying a live database data directory is usually a corrupted backup with extra steps. Use native dumps, snapshots with quiescence, or application-aware backup modes:
pg_dump --format=custom --file=/backup/files-db.dump filesdb
mysqldump --single-transaction --routines filesdb > /backup/filesdb.sql
sqlite3 /srv/files/data/app.db '.backup /backup/app.db'The correct method depends on the engine and write behavior. Test restore into a clean database, not merely the existence of the dump file.
Practice the ugly restore
A useful restore drill includes dependency reconstruction:
1. Create a clean VM or isolated restore namespace.
2. Install only from documented configuration.
3. Restore application data and secrets.
4. Start the service.
5. Verify login, recent records, permissions, and integrity.
6. Record elapsed time and missing steps.Do not restore over production for practice unless that is the controlled drill. Restore beside it. The point is to prove the backup contains a coherent service, not just files.
Disaster recovery is ordered decision-making
When the rack dies, you do not want to improvise priority. Write the recovery order:
power/network edge -> hypervisor/storage -> auth/DNS -> reverse proxy -> critical apps -> everything elseRecord external dependencies too: DNS registrar credentials, object storage keys, certificate recovery, offsite backup encryption keys, and 2FA recovery methods. If the only copy of the backup key is inside the backup, you built a cryptographic ouroboros.
Field notes
- A RAID rebuild is not a restore and a snapshot is not offsite protection. They solve different failure classes.
- Encrypt backups, but store key material in a separate password manager or offline recovery kit.
- Test large-file restore throughput and object storage egress cost before an emergency. Backup economics include restoration.
- Automate backup age alerts. Silent backup failure is more common than dramatic backup failure.
Was this lesson helpful?