Skip to content
WebsiteHosting.com

concept Data & storage

Block deduplication and shared-data references

Deduplication saves data space when multiple file positions refer to one stored copy of identical bytes. Deleting a file makes only blocks that lose their last reference reclaimable, which may mean none at all.

Latest recorded source check · P0228

What it means

Two independent files can share a stored block when its contents are verified to be identical. Each file position still has its own reference to that block. Deleting one file removes its references, but the block stays allocated if the other file still needs it.

The files need not match in full: they can share one block and differ everywhere else. Sharing in this model depends on content, not on snapshot ancestry or on one file being a reflink copy of the other.

Try it

Use synthetic inputs only. This simulation does not measure your storage or delete any files.

Block deduplication and shared-data references

Create synthetic files with repeated blocks; deduplicate only verified-identical content and inspect references, metadata overhead and reclaimable blocks.

Simulation

Synthetic inputs only. This is not a measurement of your hardware or service.

Computed under the stated assumptions

A block becomes reclaimable only when no remaining file reference uses its explicitly identical content.

Block deduplication and shared-data references: synthetic scenario inputs

Scenario: Starting example

Each preset replaces all fields. Editing any field preserves the other values exactly, including invalid entries.

Shared content and space accounting

Unique blocks before
3
Unique blocks after
2
Before: data plus stipulated metadata
12384 bytes
After: data plus stipulated metadata
8256 bytes
Blocks with no remaining references
B
A block remains while any reference uses it
BlockReferences beforeReferences after
AF1:0 · F2:0F2:0
BF1:1None
CF2:1F2:1

Evaluated evidence

File F1 blocks
A · B
File F2 blocks
A · C
Simulated reference removal
F1
Data bytes per unique block
4096
Metadata per unique block (bytes)
32
Content-identity evidence
verified-content

Token identity is synthetic verified-content identity. The metadata amount is stipulated per unique block; other metadata, filesystem accounting and actual deletion are excluded.

About this model

Every input is local synthetic evidence. Numbers stay as raw text until this model validates them. The shown evaluated values come from the same result as the explanation.

Presets replace the entire scenario. Reset restores all starting fields, scenario selection and model state; it does not change the open or closed state of this help or article FAQ.

No external request, device command, stored-input history or measurement is performed.

Start with A B in File F1 blocks, A C in File F2 blocks, and verified-content for Content-identity evidence. Each letter represents a full block; the two occurrences of A stand for exactly the same bytes. There are four logical references but only three stored blocks: A, B, and C.

With Simulated reference removal set to F1, follow each block rather than just counting the positions removed:

  • A starts with two references: F1:0 and F2:0, the first position in each file. It loses F1:0 but keeps F2:0.
  • B loses its only reference, F1:1. It is the only reclaimable block.
  • C keeps F2:1. The two blocks still needed are A and C.

The default Data bytes per unique block is 4096, and Metadata per unique block (bytes) is 32. Before removal, the total is 12,288 data bytes plus 96 metadata bytes, or 12,384 bytes. After removal, the two retained blocks account for 8,192 data bytes plus 64 metadata bytes, or 8,256 bytes. Although F1 described 8,192 logical data bytes, only B's 4,096 data bytes and 32 metadata bytes drop out of the total.

Choose Give both files identical content. Now both files contain A B. Removing F1 still drops two references, but F2 retains a reference to each block. Neither block is reclaimable, so both the data and the per-block metadata totals stay the same.

Choose Inspect the evidence boundary to return to A B and A C with hash-only evidence. The result is unknown, not zero savings: the model treats a hash match as a candidate, not as verification that the bytes match.

For your own example, use 1–32 tokens from A through H per file, separated by single spaces. Enter byte counts as whole-number decimal strings without spaces, fractions, or exponents: 1–65536 for data and 0–4096 for metadata. An empty file field or a value such as 4096.000000000000000001 for data bytes is invalid; no rounded result is computed. Reset restores the starting inputs and scenario, returns the step and virtual time to zero, and clears errors, history, and the comparison.

In practice

Check what establishes a content match in the implementation you're considering. With the OpenZFS 2.3 verify dedup option, matching signatures are followed by a byte comparison, as described in OpenZFS zfsprops(7). The Linux 6.12 dm-vdo design describes verifying candidate duplicate data and tracking references to shared blocks.

To estimate what a deletion could reclaim, list every live reference to each verified-identical block and cross out only those belonging to the file being removed. Account for metadata separately: the example's 32 bytes per unique block is an assumption, not a filesystem metadata formula. The totals exclude other metadata and allocation rounding, so they do not predict a change in reported free space.

In the declared model, logical deletion releases references. Count a block as reclaimable only if its complete list of remaining references is empty; that does not prove when a real allocator will free space.

Frequently asked questions

Editorial questions based on the listed sources and explicitly labeled local examples.

Why may deleting a file free little space?

A block remains needed while another file still references it. In the example, removing F1 from F1=A,B and F2=A,C releases B but retains the shared A.

Is hash equality enough to share data?

This model requires verified-identical content and returns unknown for hash-only evidence. Implementations differ: the cited OpenZFS verify option performs a byte comparison after matching signatures.

Does metadata consume capacity?

Yes in the declared accounting: each unique block has an explicit metadata allowance. Removing a shared reference need not remove either the data block or its per-block metadata. This is not an actual filesystem metadata formula.

How does this differ from a snapshot?

This example shares verified-identical blocks across separately listed files. It does not require a snapshot ancestry relationship or simulate the lifetime of snapshot versions.

Sources & model boundaries

Primary references used for this explanation. The interactive example is an educational model, not a live check.

  1. OpenZFS zfsprops(7)

    dedup/verify; compression; compressratio. The verify dedup option compares block bytes after matching signatures. Compression ratios depend on actual data and allocation rules.

    Checked .

  2. Design of dm-vdo

    Theory; deduplication index; write path steps8 and11–13. VDO verifies candidate duplicate bytes, tracks shared references, and stores incompressible or unpackable data without a compression saving.

    Checked .

Report an issue. Include the article URL and ID, not passwords or access keys.