파편화된 파일 복구 테스트: 카빙 결과

파편화된 파일 복구 테스트

A 파편화된 파일 복구 테스트 먼저 다음을 확립해야 한다 파일의 각 부분이 저장되는 위치. NTFS에서는 비상주 $DATA 속성은 데이터 런(Data Runs)을 통해 해당 레이아웃을 설명할 수 있습니다. 우리는 연속된 PNG 파일과 세 개의 익스텐트에 분산된 동일한 PNG 파일을 비교한 다음, 분할된 레이아웃을 연속된 클러스터로 해석하는 것이 왜 실패하는지 보여줍니다. 마지막으로, 보존된 클러스터 매핑을 따르고 SHA-256 및 PNG CRC 검사를 사용하여 재구성된 바이트를 검증합니다.

목차

연구 질문: 파일이 조각화되면 어떤 변화가 일어나는가?

파일의 저장 공간 할당이 논리적으로 연속적이지 않더라도 파일 자체는 논리적으로 연속적일 수 있습니다. 애플리케이션은 파일 순서대로 바이트를 요청하고, 파일 시스템은 이러한 요청을 볼륨상의 위치로 변환합니다. 그러나 원시 콘텐츠 스캐너는 이러한 변환 과정을 거치지 않고 위치를 추론해야 할 수도 있습니다. 이 차이는 파일의 시그니처가 여전히 식별 가능하지만, 뒤쪽 클러스터들이 더 이상 인접해 있지 않을 때 중요해집니다.

이번 조각난 파일 복구 테스트에서는 두 가지 조건, 즉 두 번째 및 세 번째 데이터 클러스터의 위치와 독자가 해당 클러스터의 순서를 알고 있는지 여부를 변경합니다. 반면, 파일 삭제, NTFS 레코드 손상, 덮어쓰기는 클러스터나 그 매핑 정보가 계속 사용 가능한지 여부에 영향을 미치기 때문에 추가적인 문제를 야기합니다.

Fragmented File Recovery Test Setup and File Layout

파편화된 파일 복구 테스트는 다음을 사용합니다. 60 × 60 픽셀 RGB PNG ~를 포함하는 10,928바이트. 세 가지 시나리오 모두에서 그 내용은 동일하게 유지됩니다. 각 클러스터에는 4,096바이트, 이 PNG 파일은 세 개의 클러스터에 걸쳐 있습니다. 따라서 세 번째 클러스터에는 파일의 논리적 끝 지점을 넘어 1,360바이트의 할당 공간이 포함되어 있습니다. 아래에 제시된 클러스터 번호는 볼륨 상대적 LCN 주소 체계를 따르며, 물리적 섹터 주소가 아닙니다.

이 레이아웃은 파일 순서를 지정하는 데 NTFS 방식의 가상 클러스터 번호(VCN)를 사용하고, 볼륨 내 위치를 지정하는 데 논리 클러스터 번호(LCN)를 사용합니다. 연속 레이아웃의 경우, VCN 0, 1, 2는 LCN에 매핑됩니다. 40, 41, 및 42. 반면, 분할된 레이아웃은 이를 LCN에 매핑한다 40, 73, 및 106. 한편, 나머지 위치에는 관련 없는 바이트들이 저장되어 있습니다. 조각난 파일 복구 테스트가 진행되는 동안 PNG 콘텐츠는 변함없이 유지됩니다. 클러스터의 배치와 리더가 사용할 수 있는 매핑만 변경될 뿐입니다.

데이터 실행 비교: 1개 익스텐트 대 3개 익스텐트

다음 사항을 점검하십시오. 비거주자 내의 쌍 매핑 $DATA 속성 추출된 파일 바이트를 살펴보기 전에. 각 런의 첫 번째 바이트는 필드 크기를 나타내며, 다음 값은 클러스터 단위의 런 길이를 나타내고, 부호 있는 LCN 델타는 해당 런의 시작 클러스터 위치를 지정합니다. 이 테스트에서, 연속 레이아웃에는 데이터 런이 하나 있고, 조각화된 레이아웃에는 세 개가 있습니다. 마지막 00 런리스트를 종료합니다. 이러한 매핑 쌍 바이트는 실험 할당 정보에서 인코딩된 것이며, 물리적 MFT 레코드에서 추출된 것이 아닙니다.

단순히 추출된 바이트만 비교하는 것이 아니라 매핑을 비교하십시오.동일한 10,928바이트 크기의 PNG 파일 · 볼륨 내 서로 다른 위치
NTFS 비상주 $DATA · 매핑 쌍

S1 · 연속 할당

단일 범위 — 파일 클러스터 사이에 간격 없음

4096 B / 클러스터
데이터 실행 바이트 (16진수)
11032800
러닝 헤더 11: 1바이트 런 길이 + 1바이트 부호 있는 LCN 델타; 00: 실행 목록 끝.
실행바이트VCNLCN길이
111 03 28VCN 0–2LCN 40–423
파일 순서 읽기 대 실제 위치
파일 오프셋VCN실제 LCNLCN 읽기
0x0000VCN 04040 ✓
0x1000VCN 14141 ✓
0x2000VCN 24242 ✓

요청된 세 클러스터 모두 볼륨 내 시퀀스를 따릅니다. 순차 읽기 방식의 리더는 파일을 재현합니다.

NTFS 비상주 $DATA · 매핑 쌍

S2 · Fragmented allocation / wrong sequential read

Three extents — actual second and third clusters are elsewhere

4096 B / 클러스터
데이터 실행 바이트 (16진수)
11012811012111012100
러닝 헤더 11: 1바이트 런 길이 + 1바이트 부호 있는 LCN 델타; 00: 실행 목록 끝.
실행바이트VCNLCN길이
111 01 28VCN 0LCN 401
211 01 21VCN 1LCN 731
311 01 21VCN 2LCN 1061
파일 순서 읽기 대 실제 위치
파일 오프셋VCN실제 LCNLCN 읽기
0x0000VCN 04040 ✓
0x1000VCN 17341   ✕
0x2000VCN 210642   ✕

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 ~을 의미한다 three clusters 그리고 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 40 ~을 통해 42.
  • Scenario2 — Fragmented, mapping unavailable to the reader: Keep the file at LCNs 40, 73, 및 106, but continue reading consecutive clusters beginning at LCN 40.
  • 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.

실험 절차

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.

  1. Establish the source. Create the PNG, record its length and SHA-256 digest, and verify its signature, chunk structure, and chunk CRC values.
  2. Build S1. Place successive 4,096-byte portions of the file into LCNs 40, 41, 및 42. Read forward from the PNG signature and validate the reconstructed stream.
  3. Build S2. Place the same portions at LCNs 40, 73, 및 106. Leave the intervening positions filled with unrelated bytes. Apply the same forward, consecutive-cluster read beginning at LCN 40, without supplying the reader a cluster map.
  4. 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.
  5. Compare outcomes. First, inspect the cluster boundaries at file-relative offsets 0x1000 그리고 0x2000. 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 실행 목록 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.

fragmented-datarun-scenario1

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.

fragmented-datarun-scenario2

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

fragmented-scenario2

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.

fragmented-scenario3-reconstructed

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 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.

그리고 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, 및 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.

하지만, 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 그리고 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.

결론

이 파편화된 파일 복구 테스트 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

왜 연속된 파일의 데이터 추출이 대개 더 쉬운가요?

연속 파일은 연속된 논리적 바이트를 인접한 저장 위치에 보관합니다. 카버가 유효한 시작 시그니처를 찾아내면, 대개 그 뒤따르는 데이터를 순서대로 검사할 수 있습니다. 그렇다 하더라도 포맷의 내부 구조를 반드시 확인해야 합니다. 시그니처만으로는 데이터가 온전하게 복원될 것이라고 보장할 수 없기 때문입니다.

조각난 파일의 경우 파일 카빙이 항상 실패하나요?

아닙니다. S2에서 볼 수 있듯이, 연속된 블록을 전제로 하는 단순한 카빙 방식은 나중에 나타나는 조각들이 다른 곳에 위치할 경우 실패할 수 있습니다. 고급 포맷 인식 카빙 방식은 때때로 조각화 지점을 식별하고, 구조, CRC, 압축 정보 또는 기타 검증 방법을 활용하여 후보 세그먼트를 테스트할 수 있습니다. 궁극적으로 성공 여부는 파일 형식과 사용 가능한 바이트 수에 달려 있습니다.

NTFS 메타데이터는 조각난 파일을 복구하는 데 어떻게 도움이 될까요?

생존한 비거주자 $DATA 속성은 파일의 익스텐트를 식별하는 VCN-LCN 매핑 정보를 제공할 수 있습니다. 조각화된 파일 복구 테스트의 경우, 이 매핑 정보는 리더가 어떤 클러스터를 결합해야 하는지 설명해 줍니다. 매핑 정보가 여전히 유효하고 참조된 클러스터를 읽을 수 있다면, 복구 프로세스를 통해 해당 클러스터들을 원래 순서대로 연결할 수 있습니다. 오래된 매핑으로는 덮어쓴 내용을 복원할 수 없습니다.

올바른 파일 헤더만으로도 복구가 성공했음을 증명할 수 있나요?

아닙니다. S2의 경우, 시작 부분의 PNG 서명과 처음 4,096바이트는 원본과 일치합니다. 그 결과, 그 이후의 바이트는 잘못되어 있으며, PNG 청크의 CRC 검사가 실패합니다. 완전한 복구를 위해서는 유효한 내부 구조, 올바른 콘텐츠, 그리고 가급적이면 신뢰할 수 있는 원본 다이제스트와의 비교와 같은 추가적인 증거가 필요합니다.

원본 파일의 크기를 아는 것만으로도 조각들을 재구성하기에 충분한가요?

일반적으로 그렇지 않습니다. 파일 크기는 논리적 데이터의 양을 결정하지만, 후속 클러스터의 위치나 순서를 식별해 주지는 않습니다. S2는 비교를 위해 알려진 소스 길이를 의도적으로 사용하지만, 그 정보만으로는 잘못된 순차 읽기 문제를 해결할 수 없습니다. 따라서 다른 매핑 정보나 형식별 단서가 여전히 필요합니다.

SHA-256 해시값이 일치한다고 해서 알 수 없는 파일을 반드시 복구할 수 있는 것일까요?

원본 파일의 신뢰할 수 있는 다이제스트와 SHA-256 해시가 일치한다는 사실은 두 바이트 스트림이 동일하다는 매우 강력한 증거가 됩니다. 원본 다이제스트를 확인할 수 없는 경우, 복구된 콘텐츠의 해시를 계산한다고 해도 그것이 손실된 버전과 일치하는지 여부를 알 수 없습니다. 반면, 형식 유효성 검사는 또 다른 종류의 추가적인 증거를 제공합니다.

CRC 불일치는 복구된 파일에 대해 무엇을 알려주는가?

S2에서는 PNG 헤더와 첫 번째 클러스터는 그대로 유지되지만, 순차 읽기 과정에서 0x1000. . IDAT 청크의 CRC가 저장된 값과 더 이상 일치하지 않습니다. 이러한 불일치는 청크 내용이 손상되었음을 나타내지만, CRC가 유효하다고 해서 복구된 이미지의 모든 부분이 정확하다는 것을 증명하는 것은 아닙니다.

바실리는 이 분야에서 약 10년간 실무 경험을 쌓은 데이터 복구 전문가입니다. 그는 경력 전반에 걸쳐 삭제된 파일, 포맷된 드라이브, 손실된 파티션 및 RAW 파일 시스템과 관련된 수천 건의 복잡한 사례를 성공적으로 해결했습니다. 그의 전문 지식은 헥스 에디터와 같은 전문 도구를 사용한 수동 복구 방법과 복구 소프트웨어를 사용한 고급 자동화 솔루션을 모두 다룹니다. 바실리의 사명은 IT 전문가와 일반 사용자 모두에게 신뢰할 수 있는 데이터 복구 지식을 제공하여 소중한 디지털 자산을 보호할 수 있도록 돕는 것입니다.