- •The project has been funded by the European Commission. The Education, Audiovisual and
- •concept behind NTFS
- •Everything in NTFS is a file.
- •Physical position of the systemfiles
- •Bootblock
- •Bootblock
- •block parameter Bios
- •Number of sectors
- •exersize
- •Master File Table
- •Master File Table
- •NTFS-System
- •Metadata Files
- •Master File Table
- •MFT Record Header
- •Master File Table
- •Master File Table
- •Header of a MFT-entry
- •MFT Record Header
- •MFT Record Header
- •Attribute Headers
- •Attribute Headers
- •Resident Unnamed Attribute Header
- •Resident Named Attribute Header
- •Non-resident Unnamed Attribute Header
- •Non-resident Named Attribute Header
- •Header of a MFT-entry
- •Attribute: resident unnamed
- •Attribut: non-resident without name
- •Attribut: resident with name
- •Attribut: non-resident with Name
- •Standard Information Attribute
- •Standard Information Attribute
- •Standard Information Attribute
- •Standard information attributes always resident
- •Standard information attributes
- •Filename Attribute
- •Filename Attribute
- •File Name Attribut
- •File Name attribute always resident
- •File Name attribute always resident
- •File Name Attribut
- •The pointer to the father directory, ie the directory where the file is
- •Data Attribut (ID 0x80)
- •MFT record with resident data part
- •Exercise
- •Data Runs
- •Data attribute
- •Data Runs
- •MFT record with non-resident data part
- •MFT record with non-resident data part
- •MFT record with non-resident data part
- •Data Runs
- •Example with a Run
- •Decoding Single Data Run
- •Example with two runs
- •Runlist
- •Example 1 - Normal file
- •Example 2 - Normal file Fragmented
- •Example 3 - Normal file, noncontiguous blocks
- •By default, the attributes are present only once in a Record. NTFS allows,
Data attribute
If the data type of the attribute is too large to fit in the MFT record, the data must be somewhere, stored in unallocated clusters on the disk.
In the MFT must be a reference to be one or more contiguous ranges of clusters.
Such contiguous clusters chain is called Run
Header |
Standard Info |
Name: |
Date: |
End-ID |
03.06.2004, 19.38 |
BIG.txt |
31 02 00 4F 3C 00.. |
FF FF FF FF |
|
|
|
|
|
Data Runs
In a FAT file system requires each of a file allocated clusters a table space in the FAT.
Ex. A file needed by the Cluster 2 to Cluster 1002 has, accordingly, has 1000 entries in the FAT.
Start Cluster is a directory entry (here Cluster 2) in the FAT
3
4
5
6
7
8
9
10
11
12
..
..
..
..
..
..
1000 1001
EOF
Meanwhile, a run in NTFS is determined by its starting cluster and its length.
In the above example NTFS would only save the starting cluster and the number of clusters required. -> 1000 cluster from Cluster 2
MFT record with non-resident data part
|
Attrib.-Type (Std.) |
Lange of Attr. |
|
|
Attrib.-Type (Name) |
Lange of Attr. |
|
Attrib.-Type (Data) |
Lange of Attr. |
non-resident Flag |
|
Offset |
Lange |
Description |
10 |
8 |
Start VCN |
18 |
8 |
Last VCN |
20 |
2 |
Offset to Data run |
22 |
6 |
Compression and 4 padding bytes |
28 |
8 |
Physical size = multiple of the cluster size |
30 |
8 |
Actual size |
38 |
8 |
Actual or Initialized size |
MFT record with non-resident data part
|
Attrib.-Type (Std.) |
Lange of Attr. |
|
Attrib.-Type (Name) |
Lange of Attr. |
Offset to the data portion |
Header of the attribute $ Data |
|
|
|
|
Offset |
Lange |
Description |
10 |
8 |
Start VCN |
18 |
8 |
Last VCN |
20 |
2 |
Offset to Data run |
22 |
6 |
2 bytes compression and 4 padding bytes |
28 |
8 |
Physical size = multiple of the cluster size; here: 0x9B8000 |
30 |
8 |
Actual size; here: 0x9B5800 |
38 |
8 |
initialized size |
MFT record with non-resident data part
Header of the Attributs $Data |
Side portion of the attributes (Runlist)
Data Runs
A run is constructed as follows:
The first byte of the run, the header, contains both the length as well as the offset of the runs.
The byte is divided into two half-bytes or nibbles, wherein the lower nibble represents the number of bytes that make up the length of the run and the upper nibble is the number of bytes that make up the offset of the run.
Example: Byte header is 32, i.e., the lower nibble contains 2, the upper nibble 3 > After the header, the next two bytes are the length of the run and the subsequent three bytes offset i.e. the run is 6 bytes represents (1 byte header and 5 bytes in length and offset).
This sequence is continued until both the length and the offset is zero.
Example with a Run
Number of bytes for the offset
(3)
Cluster number relative to the previous Run (0x053ABA)
Number of bytes for the |
|
Number of clusters in this run |
|
Beginning of the next Runs |
length of the run (2) |
|
(0x1370) |
|
0x00-> no other available Run |
Decoding Single Data Run
Data Run 31 03 58 BC 37
Second Nibble
The number of bytes used to indicate the number of contiguous clusters in stream
Number of contiguous clusters in stream (3)
3 1 |
03 |
58 BC 37 |
First Nibble
The number of bytes used to indicate starting cluster
Offset – when there is only one data run this value is the starting Logical Cluster Number (3652696)
61
Example with two runs
Number of bytes for the offset
(3)
Cluster number relative to the previous Run (0x021A1F)
Number of bytes for the |
|
Number of clusters in this run |
length of the run (1) |
|
(0x04) |
