Teste de recuperação de arquivos fragmentados: resultados da recuperação de dados

A teste de recuperação de arquivos fragmentados deveria primeiro estabelecer onde cada parte de um arquivo é armazenada. No NTFS, o arquivo não residente $DATA O atributo pode descrever esse layout por meio de sequências de dados. Comparamos um arquivo PNG contínuo com o mesmo arquivo PNG distribuído por três extensões e, em seguida, mostramos por que a interpretação do layout fragmentado como agrupamentos consecutivos não funciona. Por fim, seguimos o mapeamento dos agrupamentos retidos e verificamos os bytes reconstruídos usando as verificações SHA-256 e CRC do PNG.
Índice
Questão de pesquisa: O que muda quando um arquivo fica fragmentado?
Um arquivo pode ser logicamente contínuo mesmo quando sua alocação de armazenamento não o é. O aplicativo solicita bytes na ordem do arquivo, enquanto o sistema de arquivos traduz essas solicitações em locais no volume. No entanto, um analisador de conteúdo bruto pode ter que inferir esses locais sem contar com essa tradução. Essa distinção se torna importante quando a assinatura do arquivo permanece reconhecível, mas os clusters posteriores não são mais adjacentes.
Neste teste de recuperação de arquivos fragmentados, alteramos duas condições: as localizações do segundo e do terceiro clusters de dados e o conhecimento do leitor sobre a ordem entre eles. Em contrapartida, a exclusão de arquivos, os danos nos registros NTFS e a sobrescrita criam problemas adicionais, pois afetam a disponibilidade dos clusters ou de seu mapeamento.
Fragmented File Recovery Test Setup and File Layout
O teste de recuperação de arquivos fragmentados utiliza um PNG RGB de 60 × 60 pixels contendo 10.928 bytes. Seu conteúdo permanece idêntico nos três cenários. Como cada cluster contém 4.096 bytes, o arquivo PNG abrange três clusters. Consequentemente, o terceiro cluster contém 1.360 bytes de espaço de alocação além do fim lógico do arquivo. Os números de cluster a seguir utilizam um esquema de endereçamento LCN relativo ao volume; não se trata de endereços de setores físicos.
O layout utiliza números de cluster virtual (VCNs) no estilo NTFS para a ordem dos arquivos e números de cluster lógico (LCNs) para as localizações no volume. No layout contíguo, os VCNs 0, 1 e 2 correspondem aos LCNs 40, 41, e 42. Em contrapartida, o layout fragmentado os mapeia para os LCNs 40, 73, e 106. Enquanto isso, as outras posições contêm bytes não relacionados. Ao longo do teste de recuperação de arquivos fragmentados, o conteúdo do PNG permanece inalterado. Apenas a localização dos clusters e o mapeamento disponível para o leitor mudam.
Comparação de execuções de dados: uma extensão versus três
Inspecione o mapeamento de pares na categoria de não residentes $DATA atributo antes de analisar os bytes do arquivo extraído. O primeiro byte de cada sequência identifica os tamanhos dos campos; o valor seguinte indica o comprimento da sequência em clusters; e o delta LCN com sinal localiza o cluster inicial. Neste teste, o layout contíguo possui uma sequência de dados; o layout fragmentado possui três. O último 00 encerra a lista de execução. Esses bytes de pares de mapeamento são codificados a partir da alocação do experimento; eles não foram extraídos de um registro físico da MFT.
S1 · Alocação contígua
Extensão única — sem lacunas entre os clusters do arquivo
11: comprimento da sequência de 1 byte + delta LCN com sinal de 1 byte; 00: fim da lista de execuções.| Executar | Bytes | VCN | LCN | Comprimento |
|---|---|---|---|---|
| 1 | 11 03 28 | VCN 0–2 | LCN 40–42 | 3 |
| Deslocamento do arquivo | VCN | LCN real | Leia a LCN |
|---|---|---|---|
0x0000 | VCN 0 | 40 | 40 ✓ |
0x1000 | VCN 1 | 41 | 41 ✓ |
0x2000 | VCN 2 | 42 | 42 ✓ |
Todos os três blocos solicitados seguem a sequência do volume. Um leitor sequencial reproduz o arquivo.
S2 · Alocação fragmentada / leitura sequencial incorreta
Three extents — actual second and third clusters are elsewhere
11: comprimento da sequência de 1 byte + delta LCN com sinal de 1 byte; 00: fim da lista de execuções.| Executar | Bytes | VCN | LCN | Comprimento |
|---|---|---|---|---|
| 1 | 11 01 28 | VCN 0 | LCN 40 | 1 |
| 2 | 11 01 21 | VCN 1 | LCN 73 | 1 |
| 3 | 11 01 21 | VCN 2 | LCN 106 | 1 |
| Deslocamento do arquivo | VCN | LCN real | Leia a LCN |
|---|---|---|---|
0x0000 | VCN 0 | 40 | 40 ✓ |
0x1000 | VCN 1 | 73 | 41 ✕ |
0x2000 | VCN 2 | 106 | 42 ✕ |
A basic contiguous reader skips the actual VCN 1 and VCN 2 locations. The first wrong file byte occurs at 0x1000.
The encoding makes the difference explicit. In S1, 03 significa three clusters e 28 sets the starting LCN to 40. In S2, each run has length 01. Its signed LCN deltas are 28 (+40), 21 (+33), and 21 (+33), producing LCN starts 40, 73, and 106. Unlike file-offset Hex, these bytes describe the file’s allocation layout. For the NTFS encoding rule, see NTFS Data Runs documentation.
The test uses three scenarios:
- Scenario1 — Contiguous baseline: Read the PNG sequentially from LCN
40por meio de42. - Scenario2 — Fragmented, mapping unavailable to the reader: Keep the file at LCNs
40,73, e106, but continue reading consecutive clusters beginning at LCN40. - Scenario3 — Fragmented, mapping available: Read the fragmented clusters in the correct VCN order, then trim the result to the original logical file length.
Method: We placed the PNG bytes in a cluster-addressed test array and extracted them using the three read paths. We then checked each stream through full-byte comparison, SHA-256, and PNG chunk CRCs. We supplied the cluster map instead of extracting it from an NTFS MFT record. Therefore, these checks establish byte reconstruction outcomes, not physical-drive or recovery-software performance.
Procedimento do experimento
This fragmented file recovery test uses the same original bytes in every scenario. The five steps below isolate layout and mapping from file-content changes.
- Establish the source. Create the PNG, record its length and SHA-256 digest, and verify its signature, chunk structure, and chunk CRC values.
- Build S1. Place successive 4,096-byte portions of the file into LCNs
40,41, e42. Read forward from the PNG signature and validate the reconstructed stream. - Build S2. Place the same portions at LCNs
40,73, e106. Leave the intervening positions filled with unrelated bytes. Apply the same forward, consecutive-cluster read beginning at LCN40, without supplying the reader a cluster map. - Build S3. Keep the fragmented storage layout unchanged, but supply the ordered VCN-to-LCN mapping. Next, reassemble the three portions and remove padding beyond the original file length.
- Compare outcomes. First, inspect the cluster boundaries at file-relative offsets
0x1000e0x2000. Then validate PNG chunk CRCs and compare the full reconstructed stream with the source digest.
For direct comparison, S2 reads exactly 10,928 bytes, matching the source file length. A signature-based carver would not automatically know that length; it would need to determine the file boundary from PNG structure, available metadata, or other evidence. Even so, the consecutive read already fails PNG validation, independently of how the reader determines file length.
Fragmented File Recovery Test Results
S1: Contiguous File Recovery Success
S1 starts with the nonresident $DATA lista de execuções 11 03 28 00. It describes one extent containing three clusters starting at LCN 40. Therefore VCN 0, 1, and 2 resolve to LCN 40, 41, and 42. The simple consecutive reader follows exactly those locations, so its 10,928-byte output matches the source SHA-256 and passes PNG chunk CRC checks.

Figure 1. Contiguous file: a single Data Run maps VCN 0–2 to LCN 40–42.
A correctly identified file signature is useful here because the following data happens to remain sequential. In other words, sequential allocation explains this instance of contiguous file recovery success. A signature by itself does not establish complete recovery; the content must still satisfy the relevant format and integrity checks.
S2: File Carving Fragmented Files Experiment
In S2, the file contents do not change, but the nonresident $DATA runlist becomes 11 01 28 11 01 21 11 01 21 00. Decoding it reveals three separate one-cluster extents: VCN 0 → LCN 40, VCN 1 → LCN 73, and VCN 2 → LCN 106. A basic signature-based reader that ignores those extents instead assumes the next clusters are LCN 41 and 42. That incorrect assumption, not fragmentation itself, causes the candidate file to contain unrelated bytes from file offset 0x1000.

Figure 2. Fragmented file: three Data Runs map VCN 0, 1, and 2 to LCN 40, 73, and 106.

Figure 3. S2 Hex evidence at file offset 0x1000: the sequential read enters unrelated LCN 41 instead of LCN 73.
The Hex comparison therefore shows identical bytes before 0x1000 and a clear mismatch at the boundary. Thus, S2 has a correct 4,096-byte prefix followed by unrelated data. As a result, the PNG parser reports an IDAT CRC mismatch. In addition, the candidate stream has a different SHA-256 digest from the source. The incorrect data placement—not a change in the original image—is enough to explain the failure.
S3: Reconstructing a Fragmented File With Its Cluster Map
S3 uses the same fragmented runlist and the same cluster contents as S2. It does not defragment the file or rewrite a Data Run. Instead, the reconstruction reads LCN 40 → 73 → 106 in VCN order and trims the allocation padding to the original 10,928-byte file length. The resulting output matches the source SHA-256, and its PNG chunk CRCs pass. This is metadata-guided reconstruction, not signature-only file carving.

Figure 4. S3 reconstructed Hex at 0x1000: correct VCN-to-LCN reading restores the original bytes. Compare with Figure 3.
The reconstructed stream matches the source at both inspected cluster boundaries. Its SHA-256 matches the original digest, and all PNG chunk CRCs pass. These checks establish exact byte reconstruction when the correct mapping and every required cluster are available. However, an actual recovery case must first establish whether deletion, formatting, or file-system damage has destroyed the mapping or file bytes.
What the Byte Comparison Proves
The fragmented file recovery test produces exact 10,928-byte matches in S1 and S3, but not in S2. The first mismatch occurs at file offset 0x1000, exactly where the sequential read advances to the wrong cluster. The byte and CRC checks establish the central finding: a contiguous-read assumption works only when the file’s allocation follows that same sequence.
The Data Runs establish the allocation difference, while Figures 3 and 4 show the consequence at file offset 0x1000. Figure 3 shows unrelated data from LCN 41. Figure 4 shows the original bytes recovered by reading the actual second fragment at LCN 73. File-offset Hex is a secondary integrity check; the Data Runs are the evidence of fragmentation.
Why Fragmented File Recovery Results Differ
Microsoft’s explanation of clusters and extents distinguishes file-relative VCNs from volume-relative LCNs. Consequently, a single file can occupy several extents without placing them at adjacent volume locations. That is why a file whose logical bytes are ordered can nevertheless be scattered across a volume.
For example, on NTFS the nonresident attribute record structure can store the VCN-to-LCN mapping. Readers looking for the underlying file-record mechanism can consult the Tabela de arquivos mestre NTFS guide. For a fuller explanation of how surviving mappings affect recovery, see File System Metadata Recovery. Those resources explain how the file system maintains the mapping; this test demonstrates what happens when that order is preserved, ignored, or restored.
O W3C PNG specification provides a separate way to examine content. For example, a PNG starts with an eight-byte signature and contains structured chunks, including IHDR, IDAT, e IEND. In addition, every PNG chunk stores a CRC for its chunk type and data. Accordingly, a recognizable PNG header does not mean all subsequent image data are valid. In S2, the parser reaches incorrect bytes while checking IDAT, making the corruption detectable.
No entanto, file carving fragmented files is not limited to one naive forward-read strategy. Advanced carvers can examine chunk lengths, CRC constraints, compression properties, and candidate fragment relationships to infer missing boundaries. For example, a DFRWS study of syntactical PNG carving explores approaches that may recover fragmented PNG files without the original cluster map. The S2 result therefore describes the defined baseline method, not every existing or future carver.
Fragmented File Recovery: Practical Interpretation and Limits
The main lesson from this fragmented file recovery test is the difference between surviving file bytes e surviving knowledge of their order. All three PNG portions are present in S2, yet simple sequential reading cannot assemble them. In S3, the same portions form a valid file once the correct mapping guides the read. Therefore, neither a recognizable header nor a plausible filename proves that a recovered file contains all required content.
In a damaged or deleted-file case, the original mapping might no longer exist. For instance, later writes may overwrite an NTFS nonresident mapping or reuse its owning record. Likewise, a deleted FAT32 file may no longer retain its original FAT chain. An exFAT file can use contiguous allocation or a FAT chain, depending on its stream flags. For the relationship between metadata, allocation, and lost file links, see Orphaned Files and Lost Cluster Chains.
Moreover, reassembly is different from restoring bytes that no longer exist. Even with a correct mapping, recovery cannot reconstruct overwritten bytes. Similarly, a mapping cannot recreate old SSD content that the device no longer exposes after a discard operation. Although fragment-aware carving may help when the map is missing, it cannot guarantee correct ordering for every file format or storage condition.
For an actual recovery investigation, prevent further writes to the source and analyze a verified copy whenever possible. Then check allocation evidence and reconstructed content separately. Even so, a file that opens in an application may still be incomplete. A checksum match against a trusted original provides stronger evidence of exact reconstruction. By contrast, a digest calculated only after recovery identifies the output but cannot independently prove correctness.
Conclusão
Isso teste de recuperação de arquivos fragmentados shows why storage order matters, even when every fragment remains available. The contiguous read in S1 reproduces the original PNG, and the mapped fragmented read in S3 does the same. In S2, consecutive reading fails as soon as it crosses into an unrelated cluster. The first differing offset, failed PNG CRC, and SHA-256 comparisons make the distinction clear.
The Data Runs explain the allocation difference directly: S1 encodes one three-cluster extent, while S2 and S3 encode the same three one-cluster extents. What changes between S2 and S3 is whether the reader uses that mapping.
However, the broader lesson is not that fragmentation makes recovery impossible. It is that file carving, cluster mapping, and file-format validation answer different questions. Therefore, a reader must identify the correct fragments, place them in order, and verify the reconstructed content before claiming complete recovery. Ultimately, success on a real device depends on what evidence survives.
Fragmented File Recovery Test FAQs
Por que a recuperação de arquivos contíguos costuma ser mais fácil?
A recuperação de arquivos sempre falha em arquivos fragmentados?
Como os metadados do NTFS podem ajudar a recuperar um arquivo fragmentado?
$DATA O atributo pode fornecer informações de mapeamento de VCN para LCN que identificam as extensões do arquivo. Para um teste de recuperação de arquivo fragmentado, esse mapeamento explica quais clusters o leitor deve unir. Se o mapeamento ainda for válido e os clusters referenciados continuarem legíveis, um processo de recuperação poderá concatenar esses clusters em sua ordem original. Um mapeamento antigo não consegue restaurar conteúdo sobrescrito.Um cabeçalho de arquivo correto pode comprovar que a recuperação foi bem-sucedida?
Saber o tamanho do arquivo original é suficiente para reconstruir os fragmentos?
Um SHA-256 correspondente garante a recuperação de um arquivo desconhecido?
O que a incompatibilidade de CRC nos diz sobre o arquivo recuperado?
0x1000. O IDAT O CRC do bloco não corresponde mais ao valor armazenado. Essa incompatibilidade indica que o conteúdo do bloco está corrompido, embora um CRC válido, por si só, não comprove que todos os aspectos de uma imagem recuperada estejam corretos.Vasilii é um especialista em recuperação de dados com cerca de 10 anos de experiência prática na área. Ao longo de sua carreira, ele resolveu com sucesso milhares de casos complexos envolvendo arquivos excluídos, unidades formatadas, partições perdidas e sistemas de arquivos RAW. Sua experiência abrange métodos de recuperação manual usando ferramentas profissionais, como editores hexadecimais, e soluções automatizadas avançadas com software de recuperação. A missão do Vasilii é tornar o conhecimento confiável sobre recuperação de dados acessível tanto para profissionais de TI quanto para usuários comuns, ajudando-os a proteger seus valiosos ativos digitais.
