LAZARUS RECOVERY SYSTEM // L04
Imaging & Rescue Mode
Chunked, resumable raw capture preserves healthy and damaged media while separating source evidence from the health of the resulting image.
OperationalPreserve first
Lazarus reads the complete logical source rather than trusting filesystem allocation metadata. This keeps unsupported, deleted, damaged, and structurally confusing content available for later analysis.
A damaged GPT, MBR, NTFS volume, or master file table does not make raw capture a failure. Lazarus records the structural problem, preserves what can be read, and escalates the case without repairing the original.
Normal and Rescue policies
Named presets choose policy deliberately. Backup Before Repair and Data Recovery select Rescue Mode, which retries unreadable ranges, records failures in a bad-sector map, and fills only unrecoverable bytes in the logical image so offsets remain stable.
The standard path uses Zstandard compression and full post-image verification. Custom jobs can expose expert choices, but Lazarus does not silently claim a custom image was verified when verification was not requested.
Resume from proven work
- Write INCOMPLETE before the first data chunk
- Record source identity and job journal before imaging
- Hash each logical source chunk and each stored representation
- On resume, verify the contiguous stored prefix before trusting it
- Trim storage to the final verified stored byte
- Continue only with the same proven source identity
- Replace INCOMPLETE with FINALIZED only after clean close and metadata completion
A visible retry decision
Retry policy should not be hidden in a loop that only specialists can understand. This ArcoBASIC sample makes the decision depend on the selected mode, attempt count, and requested floor while keeping the result inspectable.
' Decide whether Lazarus should retry an unreadable range.
FUNCTION RescueDecision(mode, attempt, bytesRequested)
' Normal imaging stops rather than inventing recovery behavior.
IF mode <> "RESCUE" THEN
RETURN {"Retry": FALSE, "NextBytes": bytesRequested}
END IF
' Every retry is bounded. Endless retries can damage failing media.
IF attempt >= 3 THEN
RETURN {"Retry": FALSE, "NextBytes": bytesRequested}
END IF
' Smaller reads may recover sectors around a damaged region.
nextBytes = bytesRequested / 4
IF nextBytes < 4096 THEN nextBytes = 4096
RETURN {"Retry": TRUE, "NextBytes": nextBytes}
END FUNCTION
decision = RescueDecision("RESCUE", 1, 1048576)
IF decision.Retry THEN
PRINT "RETRY WITH " + decision.NextBytes + " BYTES"
ELSE
PRINT "RECORD UNREADABLE RANGE"
END IFZero elision without skipped evidence
Lazarus can omit the stored payload for a chunk proven to contain only zero bytes, but it still reads that chunk through the ordinary raw or Rescue policy first. The chunk map records its logical size and source hash.
Verification and restore synthesize the zero range and recompute the logical hash. This reduces image storage and decompression work on zero-filled media without trusting a damaged filesystem to identify unused space.
Bounded retries and not making things worse
RescueDecision, three attempts and a shrinking read size, is tuned for failing spinning disks and worn flash. Almost nothing else will retry in exactly that shape. What is transferable is the reasoning behind capping the retry at all, and behind treating the healthy path and the damaged path as genuinely different problems.
The same logic governs retry-with-backoff in distributed systems, circuit breakers that stop hammering a failing dependency instead of retrying forever, and any batch job deciding whether one corrupt record poisons a whole run or gets skipped and logged. Persistence without a limit is not resilience; it is a second failure mode.
- Do not let a recovery strategy become its own hazard. Rescue Mode retries a bounded three times specifically because endless retries can further damage failing media; the cap is a deliberate acknowledgment that persistence has a cost.
- Read the complete input rather than trusting the input to describe itself. Lazarus captures the whole logical source instead of relying on filesystem allocation tables, because a damaged structure is exactly the thing that cannot be trusted to say what is safe to skip.
- Keep offsets stable even when content is unrecoverable. Unreadable ranges get filled rather than omitted, so everything downstream can still address the image by position instead of needing to know about every gap.
- Do not spend the expensive operation on data already proven trivial. Zero-elided chunks are still read once through the normal policy and hashed; the shortcut applies to storage and decompression, never to verification.
Key terms, in plain language
You do not need a systems background to follow the work. These are the specialized terms used on this page.
- Resumable imaging
- A recovery process that records completed and failed areas so it can pause, retry difficult regions, and continue without starting over.
- Rescue Mode
- An imaging policy for failing media that retries unreadable areas with bounded smaller reads and records ranges that could not be recovered.
- Bad-sector map
- A record of source ranges that could not be read successfully. It preserves where evidence is missing instead of silently presenting substituted bytes as recovered data.
- Zero elision
- Omitting the stored payload for a chunk proven to contain only zero bytes while retaining its logical length and hash so it can be reconstructed and verified.
- Chunk hash
- A compact fingerprint calculated from one region of data. Lazarus uses SHA-256 hashes to detect whether stored and reconstructed chunks changed.