Mirror backup

On this page 6

A mirror backup is a backup method that maintains an exact, file-for-file replica of a source directory or volume on another disk, server or storage location, updating the copy so that it always matches the current state of the source. In Backup & recovery for Servers, it is valued for fast, simple restores, because the files are stored in their native format without compression, containers or proprietary catalogs.

The defining property, and the main risk, is that a mirror propagates deletions and modifications. When a file is removed or overwritten on the source, the next synchronization removes or overwrites it in the mirror as well, so a mirror backup keeps no history of earlier versions on its own.

How a mirror backup synchronizes data

A mirror backup works by comparing the source with the destination and transferring only what differs. Each run copies new files, replaces changed ones and, unlike most other backup types, deletes destination files that no longer exist on the source.

Change detection usually relies on file size and modification time, with optional checksum comparison for higher accuracy at the cost of reading every file. Tools such as rsync with the --delete option, Robocopy with /MIR, and Rclone in sync mode implement this behavior; rsync additionally transfers only the changed blocks inside large files.

Change on the sourceAction on the mirrorConsequence
New fileFile is copiedMirror gains the file
Modified fileFile is replaced or delta-updatedPrevious version is lost
Renamed or moved fileUsually copied anew and old path deletedExtra transfer unless detected
Deleted fileFile is deleted from the mirrorNo copy remains
Unchanged fileSkippedNo transfer cost
What happens to each change during a mirror run

Mirroring can run on a schedule, for example nightly, or near-continuously through file system change notifications. The interval defines the effective recovery point objective: data written after the last run is not protected.

Mirror backup compared with other backup types

A mirror backup differs from classic backup types mainly in retention and storage format. Full, incremental and differential backups build a chain of restore points, whereas a mirror holds only one point in time, the latest.

MethodRestore points keptStorage formatHandles deleted files
Mirror backupOne, the latest statePlain files, uncompressedDeletes them from the copy
Full backupOne per runArchive or image, often compressedKeeps them in older sets
Incremental backupMany, chainedArchive or deduplicated repositoryKeeps them in earlier increments
Differential backupMany, each relative to the last fullArchiveKeeps them until the next full
SnapshotSeveral point-in-time viewsBlock or file system referencesKeeps them until the snapshot expires
Mirror backup and related methods

A mirror backup should also be distinguished from RAID 1 disk mirroring. RAID 1 writes every block to two disks at the same instant to survive a drive failure; it is a high availability measure, not a backup, because corruption and deletions hit both disks immediately.

Strengths and limitations

The appeal of a mirror backup lies in its simplicity and restore speed, while its weakness is the absence of version history. Both sides follow from the same design.

PropertyEffectPractical meaning
Native file formatFiles are readable without backup softwareRestore is a plain copy, or no restore at all
Fast incremental syncOnly differences are transferredShort backup window after the first run
No compression or deduplicationCopy occupies the same space as the sourceHigher storage cost than repository-based tools
Single restore pointEarlier versions are overwrittenNo recovery from older mistakes
Deletion propagationAccidental deletions are mirroredData can vanish from both locations
Ransomware exposureEncrypted files replace good copiesMirror alone cannot recover the data
Advantages and drawbacks of a mirror backup

Plain-file storage also means the mirror inherits file permissions and ownership only if the tool and destination file system support them. Copying a Linux server to an exFAT drive, for example, silently drops ownership and symbolic links.

Using mirror backups safely

A mirror backup is safe to rely on only when it is combined with versioned protection. On its own, it fits data that changes rarely or can be recreated, and it serves well as a fast-restore tier in front of a deeper backup system.

  • Pair the mirror with snapshots on the destination, for example ZFS or Btrfs snapshots taken after each run.
  • Use the backup-dir or archive options of the sync tool to move replaced and deleted files into dated folders.
  • Add a delay or soft-delete period so that deletions on the source reach the mirror only after several days.
  • Keep at least one separate versioned or immutable backup to satisfy the 3-2-1 backup rule.
  • Monitor runs for unusual deletion counts, which often signal ransomware or a misconfigured path.

A classic configuration mistake is reversing source and destination in a mirror command. Because the mirror deletes everything that is absent from the source, pointing it at an empty directory can erase the entire backup in one run, so dry runs such as rsync -n are a sensible habit before changing a job.

Understanding it simply

A mirror backup is a second copy of your files that always looks exactly like the original. Add a file and the copy gets it; change a file and the copy changes too; delete a file and it disappears from the copy as well.

Picture a photocopy of a notebook that is refreshed every evening. If you spill coffee on the notebook, you still have yesterday’s photocopy. But if you tear out a page and wait until the evening, the photocopy loses that page too. The key takeaway: a mirror protects against a broken disk, not against your own mistakes, unless older versions are kept somewhere else.

Applied in practice

A small design agency stores about 2 TB of project files on a Linux file server. Every night at 01:00, an rsync job mirrors the share to a second server in another building, using the backup-dir option to move replaced and deleted files into a dated folder that is kept for 30 days. The destination also takes a daily ZFS snapshot.

When the main server’s storage controller fails on a Monday morning, the administrator points the team’s mapped drive to the mirror server. Staff are working again within 20 minutes, because the files are ordinary folders with no restore step required.

A week later, a designer realizes that a client folder was deleted the previous Thursday. The mirror itself no longer contains it, but the dated deletion folder still does, and the files are copied back in minutes. The incident shows why the agency treats the mirror as its fast-recovery layer and keeps an encrypted, versioned offsite backup as well.