What Is BorgBackup and How Does It Deduplicate Data?

BorgBackup, commonly known as Borg, is an open-source, deduplicating backup tool designed for Linux and Unix-like operating systems that provides secure, space-efficient storage for critical data. This article explores what BorgBackup is, highlights its primary features, and explains the content-defined chunking process it uses to eliminate redundant data across backup archives.

What is BorgBackup?

BorgBackup is a command-line backup program built with an emphasis on speed, security, and storage efficiency. Unlike traditional backup utilities that create full or differential image archives, Borg stores data in a dedicated repository where individual backups—termed "archives"—function as complete snapshots while only consuming storage for newly introduced changes.

Key features of BorgBackup include:

How BorgBackup Deduplicates Data

Borg achieves exceptional storage savings through chunk-based data deduplication. Rather than comparing entire files or using rigid block boundaries, Borg evaluates incoming data streams dynamically to detect repeated content across different files, directories, and past backups.

1. Content-Defined Chunking

Borg splits files into variable-length pieces called chunks using a rolling hash algorithm (specifically, a cyclic polynomial algorithm known as Buzhash). As a file is read, the rolling hash slides byte-by-byte over the data stream. When the hash value matches a specific mathematical pattern, a chunk boundary is declared.

Because chunk boundaries are determined by the content itself rather than fixed offsets:

2. Cryptographic Hashing and Chunk Identification

Once a chunk is created, Borg computes an authentication hash or HMAC (such as HMAC-SHA256 or BLAKE2b) for that specific block of data. This hash functions as the chunk's unique fingerprint ID.

3. Repository-Wide Index Lookup

Borg maintains a repository-wide index that tracks every unique chunk ID that has already been stored. Before saving a chunk:

4. Cross-Archive Deduplication

Deduplication in Borg is global across the entire repository. This means:

By combining content-defined chunking with cryptographic indexing, BorgBackup provides Linux systems with efficient daily backups, drastically lowering bandwidth requirements and disk footprint.