2.4 Repositories and data format
PDC-Backup does not invent its own storage format. It uses the restic repository format. This page explains what that means for encryption, deduplication and compatibility, how Windows metadata, images and databases fit in, which storage backends exist and how the server separates machines from each other. How to operate repositories is covered in chapter 08 Repositories and Storage.
Why the restic format
The format brings deduplication, encryption following the restic scheme, compression (zstd), lock-free read access and a two-phase prune that can run while backups are running. Shadow copies, database streams and disk images are fed into the same format.
One consequence matters for disaster preparedness: because the format stays restic-compatible, a repository can be read with the stock restic program even if PDC-Backup no longer exists.
Layout in storage
Objects are laid out the way restic stores them for local folders and S3:
Path in the repository | Content |
|---|---|
| Repository ID and parameters (encrypted, readable only with the key) |
| Key files. Each wraps the same master key with a password |
| Snapshot files (description of a restore point) |
| Index files: which blob is in which pack |
| Lock files |
| Packs holding the actual data blobs and directory trees |
Chunking, deduplication, compression, encryption
Chunking: File contents are cut into blobs of variable size with a content-defined method. The chunker is a repository setting and stays restic-compatible in PDC-Backup.
Deduplication: Each blob is identified by the SHA-256 of its plaintext. A blob that is already in the repository is not stored again, not even when it comes from another machine in the same repository. That is why every snapshot is complete on its own and a full run stores only data that does not exist yet.
Compression: Data is compressed with zstd.
Encryption: AES-256 with Poly1305 authentication following the restic scheme, before the data leaves the agent. The storage sees only ciphertext.
Parent comparison: The latest matching snapshot of the job serves as the parent. Files with the same size and modification time are not read again.
Passphrase and keys
A passphrase is set when a repository is created. It protects the master key and cannot be recovered. A recovery kit (text file with location, repository ID and passphrase) can be exported.
The password that opens the master key stays on the server. Each agent gets its own restic key file in every repository it uses (created at its first job, random password in the secret store). The job order carries this agent password, which the agent keeps in memory only. Important: all restic keys wrap the same master key. Agent keys therefore protect the primary passphrase and the recovery kit, not the data of one machine from another. Isolation (below) does that.
The server stores repository passwords encrypted in the catalog. Anyone who wants to open the repository without a running server needs the passphrase (and the location).
How workloads fit the format
Workload | Representation in the repository |
|---|---|
Files | Ordinary restic trees. Windows permissions (security descriptor with owner and DACL, and SACL when the right |
Images and VM disks | A disk or volume appears as a directory of fixed-size segment files (default 64 MiB): |
Databases | Streams as single files under a stable path |
Hyper-V |
|
Snapshots carry tags: pdc:agent=<id>, pdc:job=<id>, pdc:workload=<kind>, for databases pdc:chain=β¦, plus host name and paths. The server's own state lives in the reserved group pdc:system=server in every repository marked as a target for configuration backups.
Storage backends
Only the server talks to storage. Agents reach repositories exclusively through the server's REST endpoint on port 8444.
Kind ( | Location ( | Note |
|---|---|---|
| Absolute path on the server | File system |
| UNC path (Windows server) or mount point (Linux server) | File system; the operating system connects the share |
|
| S3-compatible storage (AWS, MinIO, RustFS, Backblaze B2, Wasabi) |
| Folder on the SFTP server | Password or key, confirmed SHA256 host key |
| URL of the collection (HTTPS) | Basic authentication |
With SFTP and WebDAV, files appear under their final name only when complete: upload under a temporary name, then a non-replacing rename (SFTP RENAME, WebDAV MOVE with Overwrite: F) and a size check; prune removes leftovers after 24 hours. Listings are requested one folder level at a time.
When the server is busy, agent access retries 503 Retry-After answers for up to an hour per request.
Agent access: append-only and filtered
The REST endpoint under /repo/<repository ID>/ enforces these rules for agents:
Access only to repositories that a job of the agent (or a restore assigned to it) uses.
Append-only: no overwriting, no deleting except lock files, no changes to keys and
config. Uploads are checked against their content hash.Writes only during a running backup of the agent. Uploaded snapshot files are decrypted and checked before they are stored.
Lock files can be deleted only by the agent that created them (owners are kept persistently in the catalog; after a restart maintenance cleans up orphaned locks).
Read filter:
keys/shows only the agent's own key,snapshots/only its own registered snapshots (plus those an active restore needs).Repositories that serve as targets for configuration backups are closed to agents.
Forget, prune, check, copy and synthetic full run on the server only.
The server also keeps a snapshot registry: only snapshots it registered as results of its runs (tags and time are checked) take part in retention, restore, copies and DR.
Isolation between machines
The restic format needs the whole index for deduplication. In a shared repository an agent can therefore, in principle, read the blobs of other machines. The isolation chosen when a repository is created controls this:
Mode | Agents get | Machines read each other's data | Deduplication across machines | Cost |
|---|---|---|---|---|
| Whole index, all packs | Yes | At backup time | None |
| Own blobs only | No | By maintenance on the server | The server checks every uploaded pack; machines upload data another machine already stored |
| No key, no storage access | No | At backup time | Experimental, file backups only |
With per_machine_index an agent owns a blob when it uploaded it in a pack the server verified (proof of possession) or when the blob belongs to one of its registered snapshots. The server hands the agent a filtered index view and answers pack reads only for bytes the agent owns (everything else is zeroed). Inline deduplication (inline_dedup, default on) does not store blobs twice that already exist; a pass after the backup (dedup_after_backup, default off) and maintenance remove remaining duplicates. An existing shared repository can be converted; converting back is not possible. Before the conversion every machine could read everything; the conversion limits future access only. The options are in chapter 08 Repositories and Storage.
Locks and immutability
restic locks (
locks/): Read access is lock-free; prune works in two phases (packs are marked first and deleted after a grace period).S3 Object Lock: The server sets the bucket's default retention (
governanceorcompliance) so every uploaded object is locked fordays. Every job that writes into the repository needs a time-based retention longer than the lock; the API refuses shorter ones. Forget and prune skip locked snapshots and packs; locked index files that prune replaces are hidden behind delete markers. The bucket needs a lifecycle rule that expires noncurrent versions. One bucket per repository because the default retention applies to the whole bucket.Hardened repository (Linux): The service
pdc-immutable-helpersetschattr +ion data, index, snapshot, key and config files after writing; prune and forget treat them like Object Lock.Local folders: The folder is restricted to the service account (Linux: mode 0700; Windows: inherited permissions removed, SYSTEM full control, Administrators read-only). Network paths are never re-permissioned.
Operation and options in chapter 08 Repositories and Storage.