Three-Tier Recovery for very large volumes

A volume of several hundred terabytes does not behave like one big hard drive. Three-Tier Recovery splits the work into three processes — Find, Link and Save — so the volume never has to be understood in one go.

Large volumes need a different approach

The data is spread over dozens of disks. The file system keeps track of itself through trees and references that are scattered across the whole volume, and copy-on-write systems such as ZFS and Btrfs often hold several versions of the same structure side by side.

Standard recovery software tries to read and interpret such a volume in a single pass. At this scale it runs out of time or memory, or drowns in intermediate results.

Which systems this applies to

  • ZFS pools on TrueNAS, Solaris, Proxmox and other platforms, including RAID-Z1, RAID-Z2 and RAID-Z3
  • Btrfs, XFS and ext4 on large Linux servers and NAS systems
  • NTFS and ReFS on Windows servers
  • Large volumes on SAN storage and in virtualised environments

Not sure whether your system qualifies? Send us the details of your setup and we will tell you.

Three processes

Our own software splits a recovery into three consecutive processes. No single process has to hold the entire volume at once, and each delivers a result for the next to build on.

  1. Find

    We scan the volume for the building blocks of the file system, wherever they are: nodes, fragments and snippets of metadata and data.

  2. Link

    The pieces are mapped, chained, stitched and sorted until the folder and file structure is consistent again.

  3. Save

    The reconstructed files are consolidated and transferred to the target storage.

The three processes and the coordinator in the monitor, during linking and saving. Example with simulated data.

What makes Three-Tier Recovery different

Three-Tier Recovery handles very large volumes without trying to rebuild the entire file system in one operation. At this size the raw data is only part of the challenge: the software also has to deal with enormous numbers of file system structures, references and candidate fragments.

That challenge is greatest on tree-based copy-on-write (CoW) file systems. ZFS is built as a block-pointer tree; Btrfs has its own on-disk format with tree roots, B-tree nodes, extents and generation information. What they share: a change never overwrites the existing structure. New tree nodes and data blocks are written and new references created, so blocks from several generations of the file system tree can remain on disk at the same time.

What Find looks for

Find reduces hundreds of terabytes of raw storage to a far smaller set of relevant structures. Depending on the file system:

  • file and directory records
  • inodes and metadata records
  • extents and allocation information
  • directory indexes
  • tree nodes, including those from different generations
  • journal and transaction records
  • block references and checksums
  • fragments of files and metadata

How Link puts it together

Finding the structures is half the work; deciding which belong together is the other half. Link works on the findings — a fraction of the original volume — and sorts, groups and connects them using:

  • the tree hierarchy and parent/child references
  • object or inode identifiers
  • block addresses and extents
  • transaction or generation numbers
  • checksums and timestamps
  • the relationships between copies or generations

This keeps structures from different file system states apart, so a consistent tree can be rebuilt from what is available. The expensive scan of hundreds of terabytes is separated from the much smaller problem of sorting and reconstructing what was found. Save then reads the data of the reconstructed files and gathers it on the target storage.

Coordinator, workers and a live monitor

A coordinator distributes the work and keeps the keys found so far in memory. The processing itself is done by workers, a separate set per process: Find workers scan the volume, Link workers connect the pieces, Save workers write out the files.

A monitor shows the state of a case at any moment:

  • per process: progress, throughput and the number of active workers
  • for the coordinator: memory use, the number of keys and operations per second
  • totals: data scanned, structures found, files linked, data read and written, checksums verified and repaired, and read errors
  • per worker: status, memory and CPU use, throughput and errors

The full monitor during the scan (Find). Example with simulated data: a ZFS RAIDZ2 pool of 24 × 18 TB, with 12 Find workers on 3 nodes.

Spread over several machines (nodes)

Workers do not have to run on a single machine. The scan is distributed over several nodes, each handling part of the volume. For a volume of hundreds of terabytes we deploy as many workers as the case requires, and monitor each one individually.

Find workers spread over three nodes while Link and Save wait. Example with simulated data.

ZFS in particular

ZFS never writes over existing data. It writes new versions and points to them from a tree of block pointers, with the most recent state of the pool at the top. If that top level is damaged — by a failed disk, an error during import or a power failure — the pool often refuses to import, even though the data is still there.

Because ZFS does not immediately overwrite older versions of its structure, a recovery can often fall back to an earlier, consistent state. Locating such states is exactly what Find is for.

Multi-layer recovery

Multi-layer recovery is a separate technique from the three processes, but the two often meet in the same case. It covers setups where data sits in several layers stacked on top of each other:

  1. partitioning
  2. the native file system of the disk or volume, possibly with deduplication
  3. virtualisation, such as VMware or Hyper-V
  4. virtual disk images such as VMDK or VHDX, often spread out in fragments
  5. the guest file system inside that virtual disk, again possibly with deduplication
  6. application files such as an Exchange database, which may themselves be fragmented

When one layer is damaged, the other layers help to rebuild it:

  • the file system inside a partition shows where that partition started and ended
  • the structure inside a virtual disk shows the order in which its fragments belong
  • the internal layout of a database allows loose pieces to be joined back together

What to do

  • Stop all writes to the pool or volume.
  • Keep the output of management commands such as zpool status and zpool import, together with the most recent messages.
  • Write down the layout: number of disks, RAID level or vdev configuration, and any cache and log devices.
  • If the pool or volume is encrypted, find the encryption keys or passphrases.

What not to do

  • No forced import, and no repair options that write to the disks.
  • No new pool or volume on the same disks.
  • No disk replacements or rebuilds before the cause is clear.

How we work on it

  1. Analysis

    We review the setup, the condition of the disks and what happened, and draw up a plan.

  2. Copies

    We make a full copy of every disk. Physically damaged disks are repaired first in our Class 1 lab.

  3. Three processes

    Find, Link and Save, with our own software.

  4. Verification

    You see the list of recovered files before the data is delivered. With escrow, payment is only released after you accept the delivery.

  5. Delivery

    The data is transferred to storage large enough to hold it, supplied by you or by us.

If the data may not leave your building, we can recover on site with our mobile cleanroom cabinet.

Questions businesses ask

Does Three-Tier Recovery work on the original disks?

No. We first make a full copy of every disk; the three processes run on those copies.

Our ZFS pool will not import. Is the data lost?

Often not. ZFS keeps older versions of its structure, and a recovery can frequently fall back to an earlier consistent state. Do not force an import; keep the output of zpool status and zpool import and contact us.

Can you work on site?

Yes. When data may not leave the building we bring a mobile cleanroom cabinet and our recovery equipment.

A large pool or volume is down

Stop writing to it, keep the output of the management commands, and send us the details of your setup.