USB File System

Meaning
Available
Retention
Bad
Finally, a cluster file
Under a cluster file
 

 

 
 

 

DOS boot record formula:
z file allocation table º number of reserved sectors
z root directory º number of reserved sectors + FAT sectors per FAT × number of
z data area º root of the logical sector number + (32 × number of directory entries in the root directory) / number of bytes per sector
z absolute sector number º logical sector number + hidden sectors
z Sector Number º (absolute sector number% number of sectors per track) +1
z head number º (absolute sector number / number of sectors per track)% of heads
z track number º (absolute sector number / number of sectors per track) / heads
Highlights:
1) DBR located at cylinder 0, head 1, sector 1, the logical sector number 0
2) DBR contains a DOS boot program and BPB.
3) BPB is important, thereby calculating the logical addresses and physical addresses.

 

File allocation table (FAT)
 
Absolute sector number is: FAT_LBA = DBR_LBA + BPB_wReservedSec is that the file allocation table is a DOS file group
The main part of the weave structure. We know that DOS is the basic unit of allocation of clusters. File Allocation Table is a reflection of the hard disk
The use of all the clusters, the file allocation table by checking that the use of any cluster. Points to a file in DOS
The total space of the first scan with FAT, find the first available cluster, the space allocated to the file, and the cluster in to fill the head
Recorded in the corresponding segment. That formed a "cluster number chain." FAT is the cluster number of a log file table. The first two fields in order to protect the FAT
Left field of 3 bytes is FAT12, FAT16 is 4 bytes. In which the first byte is used to describe the medium
The remaining bytes FFH. BPB same media format.
FAT structure of meaning: The first general FAT table is FF8H or FFF8H.
FAT12
000H
FF0H-FF6H
FF7H
FF8H-FFFH
×××H
FAT16
0000H
FFF0H-FFF6H
FFF7H
FFF8H-FFFFH
××××H
 
For FAT16, cluster number × 2 for offset address, remove the word FAT is the domain from the FAT.
= Logical sector number data area start logical sector number + (number of clusters -2) × number of sectors per cluster
Cluster number = (logical sector numbers - the data area starting logical sector number) / number of sectors per cluster +2
Highlights:
1) the use of all cluster FAT reflect on the hard drive, it records the file specific location (cluster) on the hard disk.
2 The first cluster number) file (in the table of contents) and the FAT file documented cluster number to string together "cluster number chain"
Repair the damaged file is based on this chain.
3) can be counted by the cluster number of the logical sector number, and vice versa, by a logical sector number can be calculated from the cluster numbers, the formula above.
4) FAT located DBR after its DOS sector numbers starting with 1.
File directory table (FDT)
 
 
Absolute sector number is: FDT_LBA = FAT_LBA + BPB_bNumFATs * BPB_wSecPerFAT is that the file directory table,

 

Another important part of the DOS file organization structure. File directory is divided into two categories: the root directory, subdirectory. Root directory
One can have multiple subdirectories. You can also have a subdirectory under the subdirectory, which form a "tree" file directory structure.
Subdirectory is actually a special kind of file, DOS allocate 32 bytes of directory entries.
Directory entry is defined as follows:
typedef struct {
char FileName [8]; / / ofs:. 0 filename
 
char ExtName [3];
uchar attribute;
 
/ / Ofs:. 8 extension
/ / Ofs:. 11 file attributes. Typical values: Archive (0x20), label (0x08).
 
char reserved [10]; / / ofs: 21 Reserved.
 
uint time;
uint data;
uint StartClus;
ulong FileLength;
}DIR_tag;
/ / Ofs:. 22 hours
/ / Ofs:. 24 date
/ / Ofs:. 26 start cluster number
/ / Ofs:. 28 file length
 

 

Filename directory entry in the first byte of the area also has a special significance:
    00H representatives unused.
    05H represents the actual name E5H.
    E5H representative of this file has been deleted.
The significance of this byte directory entry attribute area of ​​each bit is as follows:
7     6     5     4     3     2     1     0
No     repair     repair     sub-     volume     series     implicit     only
With     change     change     target     standard     system     of Tibetan     Reading
Standard     Standard     recorded
Chi     Chi
Genus     genus     genus
Sex     sex     sex
 
 

 

 

WINDOWS use long file names on the table said "reserved" this area.
Time: time = Hr * 2048 + Min * 32 + Sec + 2.
Date: time = (Yr-1980) * 512 + Mon * 32 + Day.
Relationship between the cluster number and the logical sector number is:
Logical sector number = (cluster number - 2) × number of sectors per cluster + data area starting logical sector number.
Highlights:
     File directory is to record all the files subdirectory name, extension attributes, create, or delete the last modified date. Culture
Pieces start cluster number and a registration form file length.
     DOS DIR content listed in the table is obtained according to the file directory.
     Fill in the file start cluster number of the file directory, and the remaining clusters are filled in on the FAT cluster position.
The data area (DATA)
 
z Data Area absolute sector number º root of the absolute sector number + (32 × number of directory entries in the root directory) / number of bytes per sector
Expression: DATA_LBA = FDT_LBA + (32 * BPB_wRootEntry) / BPB_wBytesPerSec.

 

PrePage12
<< Solution for Available System Memory Loss in the Process of File Image >>Windows File System
Check all comments
 
Domain name: www.mrtlab.com | | Telephone: +86-27-82621261 | Terms of use
MRT data recovery website,provides professional HDD firmware repair and data recovery technical resources!
Copyright 2003-2019 Powered By MrtLab