Research of File Recovery in Windows FAT32

Na Zhang, Jia WangAdvances 2015 · DOI

Abstract

Files missing in file system often results in serious consequences. To solve this problem on Microsoft Windows, the file recovery solutions in FAT32 was proposed. File system structure in FAT32 was introduced. The specific processes of DBR recovery in FAT32 were illustrated. On the basis of file storage features in FAT32, an available recovery scheme about the deleted files was analyzed and proposed.

Introduction

Despite the emergence of more advanced file systems like NTFS and exFAT, the FAT32 file system remains a critical component in legacy computing environments, embedded systems, and portable storage devices. However, FAT32 is susceptible to data loss through accidental deletion, formatting, or corruption of the DOS Boot Record (DBR). When the DBR—the first sector of a partition—is damaged, the operating system fails to recognize the partition, leading to perceived data loss. This paper explores technical strategies to reconstruct these parameters and recover deleted files by analyzing the underlying architecture of FAT32.

Methodology

Addressing Mode Conversion

A fundamental step in file recovery is navigating the physical disk. The relationship between physical disk geometry (Cylinder/Head/Sector or C/H/S) and Logical Block Addressing (LBA) is established through the standard conversion formula: $$LBA = C \times 255 \times 63 + H \times 63 + (S - 1)$$ This conversion allows recovery tools to map logical file structures to physical locations on the storage medium.

DBR Reconstruction via Signature Searching

When the primary DBR and its backup (typically located at Sector 6) are both compromised, the partition becomes inaccessible. To recover, one must locate the File Allocation Table (FAT) by searching for the hexadecimal signature F8FFFF0FFFFFFFFF. Once the starting LBA of the FAT tables is identified, the partition's core parameters can be recalculated.

The following formulas are utilized to derive the necessary values for DBR reconstruction:

Formulas for calculating FAT32 partition parameters including FAT size, data area size, and sectors per cluster.

By determining the FAT_Size, Data_Size, and S_per_C (sectors per cluster), a technician can rebuild a functional DBR, restoring access to the partition.

Directory Entry Parsing

For files that have been deleted but not overwritten, recovery hinges on parsing the File Directory Entry (FDE). In FAT32, deleting a file does not immediately erase its data. Instead, the operating system modifies the first byte of the filename in the directory entry to the hexadecimal value 0xE5. By identifying this marker and reading the associated metadata—such as the starting cluster and file size—the data can be manually extracted from the data area.

Key Insights and Discussion

The "E5" Marker and Data Persistence

The use of the 0xE5 marker is a critical feature for data recovery. Because the rest of the metadata remains intact, the file's physical location on the disk is still known until the directory entry or the data clusters themselves are overwritten by new data.

Redundancy as a Recovery Lifeline

FAT32 typically maintains two copies of the File Allocation Table. The distance between these two tables (FAT2_LBA - FAT1_LBA) provides the exact size of the FAT, which is a vital parameter for rebuilding the file system structure.

The Fragmentation Challenge

A significant limitation in FAT32 recovery is file fragmentation. When a file is deleted, its entries in the FAT are zeroed out. If the file was stored in non-contiguous clusters, the "chain" linking these pieces is lost. In such cases, simple recovery methods that assume contiguous storage will fail to retrieve the complete file.

Results

The research establishes a theoretical and practical framework for FAT32 recovery:

  1. DBR Recovery: Derived mathematical models to calculate essential partition parameters from FAT table locations.
  2. Deletion Recovery: Outlined a systematic process to read FDEs into memory, identify starting clusters, and reconstruct files.
  3. Formatting Recovery: Confirmed that since formatting primarily resets the FAT and root directory while leaving the data area untouched, recovery is feasible for non-fragmented files located outside the root directory.

Conclusion and Future Work

This study demonstrates that data recovery in FAT32 is highly achievable provided the data area has not been overwritten and the files were not heavily fragmented. Future research will focus on applying similar reverse-engineering principles to the NTFS file system, which utilizes a more complex Master File Table (MFT) structure. Additionally, the development of automated software tools based on these formulas is planned to streamline the recovery process for end-users.

Summary updated

Abstract

Files missing in file system often results in serious consequences.To solve this problem on Microsoft Windows, the file recovery solutions in FAT32 was proposed.File system structure in FAT32 was introduced.The specific processes of DBR recovery in FAT32 were illustrated.On the basis of file storage features in FAT32, an available recovery scheme about the deleted files was analyzed and proposed.
BibTeX
@inproceedings{zhang2015research,
  author = {Na Zhang and Jia Wang},
  title = {{Research of File Recovery in Windows FAT32}},
  booktitle = {Advances},
  year = {2015},
  doi = {10.2991/isrme-15.2015.9},
}
Figure