How NTFS Reserves Space for its Master File Table (MFT)

ID: Q174619


The information in this article applies to:

IMPORTANT: This article contains information about editing the registry. Before you edit the registry, make sure you understand how to restore it if a problem occurs. For information about how to do this, view the "Restoring Registry" Help topic in Regedit.exe or the "Restoring a Registry Key" Help topic in Regedt32.exe.

SUMMARY

The NTFS file system contains at its core, a file called the master file table (MFT). There is at least one entry in the MFT for every file on an NTFS volume, including the MFT itself.

Because utilities that defragment NTFS volumes cannot move MFT entries, and because excessive fragmentation of the MFT can impact performance, NTFS reserves space for the MFT in an effort to keep the MFT as contiguous as possible as it grows.


MORE INFORMATION

NTFS uses MFT entries to define the files they correspond to. All information about a file, including its size, time and date stamps, permissions, data content, and so forth is either stored within MFT entries or in space external to the MFT but described by the MFT entries.

(Directory entries, external to the MFT, also contain some redundant information regarding files. But a full discussion of all the structures on NTFS is beyond the scope of this article.)

As files are added to an NTFS volume, more entries are added to the MFT and so the MFT grows. When files are deleted from an NTFS volume, their MFT entries are marked as free and may be reused, but the MFT does not shrink. Thus, space used by these entries is not reclaimed from the disk.

Because of the importance of the MFT to NTFS and the possible impact on performance if this file becomes highly fragmented, NTFS makes a special effort to keep this file contiguous. NTFS reserves a percentage of the volume for exclusive use of the MFT until and unless the remainder of the volume is completely used up. Thus, space for files and directories will not be allocated from this MFT zone until all other space is allocated first.

Depending on the average file size and other variables, either the reserved MFT zone or the unreserved space on the disk may be used up before the other as the disk fills to capacity.

Volumes with a small number of relatively large files will exhaust the unreserved space first, while volumes with a large number of relatively small files will exhaust the MFT zone space first. In either case, fragmentation of the MFT starts to take place when one region or the other becomes full. If the unreserved space becomes full, space for user files and directories will start to be allocated from the MFT zone competing with the MFT for allocation. If the MFT zone becomes full, space for new MFT entries will be allocated from the remainder of the disk, again competing with other files.

With this hotfix, Windows NT can better accommodate volumes that must hold a large number of small files. A new registry parameter is being introduced that can increase the percentage of a volume that NTFS will reserve for its master file table. NtfsMftZoneReservation is a REG_DWORD value that can take on a value between 1 and 4, where 1 corresponds to the minimum MFT zone size and 4 corresponds to the maximum. If the parameter is not specified or an invalid value is supplied, NTFS will use a default value of 1 for this parameter. The exact ratios that correspond to each setting are undocumented because they are not standardized and may change in future releases. In order to know what setting is best for your environment, it may be necessary to experiment with different values.

To determine the current size of the MFT, type the following command on an NTFS volume:

dir /a $mft
Note that the results returned by the DIR command may not be current. The size reported by the DIR command may reflect cached data that reflects the size of the MFT at the time the system was started following an orderly shutdown.

WARNING: Using Registry Editor incorrectly can cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk.

For information about how to edit the registry, view the "Changing Keys And Values" Help topic in Registry Editor (Regedit.exe) or the "Add and Delete Information in the Registry" and "Edit Registry Data" Help topics in Regedt32.exe. Note that you should back up the registry before you edit it.

To add this value, perform the following steps:

  1. Run Registry Editor (Regedt32.exe), and go to the following subkey:

    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\FileSystem


  2. From the Edit menu, click Add Value.


  3. Type the following information in the dialog box:

    Value Name: NtfsMftZoneReservation
    Data Type : REG_DWORD
    Data : (valid range is 1-4)


  4. Quit Registry Editor and restart your computer.


NOTE: This is a run-time parameter and does not affect the format of a volume. Rather, it affects the way NTFS allocates space on all volumes on a given system. Therefore, in order to be completely effective, the parameter must be in effect from the time that a volume is formatted throughout the life of the volume.

Additional query words: mftzone


Keywords          : kbenv ntfilesys ntregistry NTSrvWkst 
Version           : winnt:4.0
Platform          : winnt 
Issue type        : kbinfo 

Last Reviewed: March 26, 1999