Files Lost, with Only an Image and Extent Locations Left?
Recover Data from Mapped Fragments
Scenario Description
An original collection file is lost or incomplete, but trusted logical extent mappings identify its ranges in an image. PDU reads scattered blocks and dependencies through declared logical addresses without pretending the source is a complete contiguous file.
Possible Causes
- A file was deleted, but physical extent mappings are available.
- Collection, HS or metadata ranges are scattered.
- Some logical ranges are missing and require explicit holes.
Challenges
Conventional recovery often requires complete files, a running instance or a usable backup. In these situations, choose a method based on the evidence that survives.
Common Errors and Symptoms
- - The original path is unreadable, but matching extents survive in the image.
- - Large-document dependencies require logical addressing.
- - Some ranges return EXTENT_SOURCE_PARTIAL.
Why Traditional Methods Fail
- - Directly joining fragments can change logical positions.
- - Overflow addresses cannot be guessed without mappings.
- - Matching filenames or _id values do not establish source identity.
PDU Solution
PDU reads the ranges declared in EXTENT_MAP or DIRECTORY_EXTENTS and records their actual source positions. A matching data directory can identify collection and HS relationships. Missing ranges are recorded separately. PDU does not zero-fill them or assemble records with missing pages into complete documents.
Recovery Principle
- Confirm Extent Mapping
- Declare Logical Sources
- Parse Blocks and Dependencies
- Save Data and Holes
PDU Core Capabilities
- Read physical fragments by logical file position.
- Declare sources and missing holes explicitly.
- Read overflow dependencies when mappings are known.
- Supplement bound missing sources in directory mode.
- Retain actual source coordinates and versions.
- Register new identity for changed sources while retaining old results.
Recovery Steps
- 1
Prepare Sources and Extent Manifests
Preserve a stable image and an extent manifest in project format. Ranges record logical file positions and actual source positions. Declare missing ranges explicitly without inferring sources from filenames or document _id.
- 2
Recover a Single Logical File
Known logical positions permit reading pages and large-document dependencies across physical fragments. Collection identity and generation still require independent evidence and are not established by mapping completion.
- 3
Recover Missing Directory Sources
DIRECTORY_EXTENTS supplements collections, HS and metadata bound by matching catalogs. Preserve readable WiredTiger.turtle. Automatic recovery of a missing turtle is not integrated, so scattered collection files alone do not establish complete directory recovery.
- 4
Handle Missing Ranges
Missing ranges return EXTENT_SOURCE_PARTIAL. Retain complete parseable documents first and errors for records dependent on missing ranges. Do not zero-fill, guess overflow addresses or assemble missing-page records into complete documents.
- 5
Continue the Recovery Task
If source files and mappings are unchanged, resume using recorded ranges and file metadata. Register a new source identity for added or replaced files. Keep old tasks and output without modifying existing export results.
Retain native success, failure, unresolved dependencies, original errors and checkpoints. Completed-run resume reads native records and file metadata without checking exported content for counts, JSON, UTF-8, hashes, redecoding or trial import.
Quick Command Examples
Preserve frozen sources and launch PDU outside them. Write configuration snippets to pdu.ini and execute PDU commands after startup. Replace example paths, versions, times and task identities with actual evidence.
# Recover a Single Logical File
DISK_PATH=/recovery-input/mongodb/source/image-source
EXTENT_MAP=/recovery-input/mongodb/source/collection-extents.json
SOURCE_VERSION=8.0.0
SOURCE_KIND=imagecopy
SOURCE_FROZEN=true
RESMODE=all
EXMODE=bson# Recover a Single Logical File
ds idx;
ds idx status;
ds unload all;# Recover Missing Directory Sources
MONGODBDATA=/recovery-input/mongodb/source/dbpath
DIRECTORY_EXTENTS=/recovery-input/mongodb/source/directory-extents.json# Recover Missing Directory Sources
b;
ds catalog status;
use appdb;
unload db appdb;Export Results
Recovered Documents
BSON or the selected data format at paths reported by the program.
Sources and Attribution
Retain namespace/UUID, source positions and candidate states; unresolved attribution stays unknown.
Tasks and Dependencies
The launch directory retains native tasks, checkpoints and original reasons for missing pages or overflow.
After export, record PDU’s native success and failure counts and original errors, retaining checkpoints. Resume uses native records and file metadata without rereading exported data or automatic trial import.
Prerequisites
- This documentation applies to Linux and source versions MongoDB 6.0.0, 7.0.0 and 8.0.0. Freeze source copies and launch PDU from a directory outside the sources. State and output use the launch directory without separate path settings. Confirm other versions and special layouts separately.
- The engineer explicitly declares logical ranges, sources and holes. Current support does not discover filesystem extents automatically.
- Prepare a matching program, license and sufficient space. Keep original evidence read-only and place the PDU launch directory outside the sources.
Important Notes
- PDU does not discover filesystem extents automatically; engineers must provide mappings.
- Completed mapping does not establish collection attribution; matching catalogs or independent evidence are required.
- Directory mode still requires readable turtle; a missing root is not reconstructed automatically.