Maximum size of file that can be stored entirely in NTFS Master File Table (MFT)

5,195

Any files can be deleted securely, as long as you use the correct tool. For example Sysinternals' SDelete is capable of handling this

On NTFS drives SDelete's job isn't necessarily through after it allocates and overwrites the two files. SDelete must also fill any existing free portions of the NTFS MFT (Master File Table) with files that fit within an MFT record. An MFT record is typically 1KB in size, and every file or directory on a disk requires at least one MFT record. Small files are stored entirely within their MFT record, while files that don't fit within a record are allocated clusters outside the MFT. All SDelete has to do to take care of the free MFT space is allocate the largest file it can - when the file occupies all the available space in an MFT Record NTFS will prevent the file from getting larger, since there are no free clusters left on the disk (they are being held by the two files SDelete previously allocated). SDelete then repeats the process. When SDelete can no longer even create a new file, it knows that all the previously free records in the MFT have been completely filled with securely overwritten files.

Surely you've chosen the wrong tool because if you've read the documentation you'd see that

Recuva cannot:

  • ...
  • Securely delete certain very small files that are held in the Master File Table (MFT) and files of zero-byte length.

Introducing Recuva - What it can and can't do


Why 640 bytes? Thought it was 512 bytes maximum for MFT entries for wiped files?

Size of files that can be stored in MFT (called resident files) varies depending on each file, each system and which information is stored in MFT. The more data is used for metadata in MFT, the less is left for the file, thus there's no defined limit, but according typically Files smaller than approximately 900 bytes are stored within the directory entry at the MFT

The figure MFT Entry with Resident Record shows the contents of an MFT record for a small file or folder. Small files and folders (typically, 900 bytes or smaller) are entirely contained within the file’s MFT record.

How NTFS Works

As an example I created an example 1000-byte file with very minimal metadata that can be stored completely in the MFT. But as soon as I added more metadata to the file (hard links, longer names, streams, permissions...) the maximum space that can accommodate the resident file quickly reduces

Share:
5,195

Related videos on Youtube

Jeff
Author by

Jeff

Updated on September 18, 2022

Comments

  • Jeff
    Jeff over 1 year

    I'm using Windows 7 and NTFS. I've noticed the MFT is a huge security risk because it can store sensitive document files without user knowledge for a long time before they get overwritten.

    All tests I've run tell me that files smaller than 640 bytes are resident in the MFT and cannot be securely deleted. However, any files that are 640 bytes or more can be securely deleted immediately - this is true for my 500GB HDD and my 128GB Flash Drive (both NTFS).

    I've tested this by creating a bunch of text files and writing words to them to create different file sizes. Deleting them, emptying recycle bin and running Recuva and then securely deleting highlighted. It fails to securely delete any file under 640 bytes (file is resident in MFT message will come up).

    Is this the same for SSDs with Trim Enabled? Why 640 bytes? Thought it was 512 bytes maximum for MFT entries for wiped files?

    Any input much appreciated.

  • Jeff
    Jeff about 7 years
    seems different file formats can have more bytes in the MFT than others then.. do SSDs with DRAZT or DRAT on trim command change any of the information stored in the MFT for those small files?
  • phuclv
    phuclv about 7 years
    I don't know about DRAZT or DRAT but SSDs will remap sectors and/or move data for wear levelling so all bets are off. I believe the secure cleaning on remapping will be handled by the SSD firmware so on top of the OS you just need to use a cleaning tool just like on HDD
  • phuclv
    phuclv over 4 years
    as I said, any limit are wrong since it depends on the metadata size. But by default I an store files more than 900 bytes long in the MFT and not only 640 bytes
  • user3685427
    user3685427 over 4 years
    I think I covered that contingency in the last paragraph of my post - 1024 bytes is the standard metadata row size, but it can be set to a different size. Or is there some other aspect you are addressing?
  • GabrielB
    GabrielB about 2 years
    "your computer has two identical MFTs" ... "the main is on the outer edge" ... "second one is located halfway in" => Sorry to be blunt but this is BULLSHIT. MFTMirr is only a backup of the first 4 MFT records, and is located near the beginning of each partition (not one per computer, not even one per NTFS partitioned device), at sector 16, while the actual $MFT is located at the 3GB mark – starting with Win 7, it used to be different. This can be checked easily with WinHex for instance. See: superuser.com/questions/1332970 & thestarman.pcministry.com/asm/mbr/IntNTFSfs.htm
  • GabrielB
    GabrielB about 2 years
    I quickly checked the article you linked – the link is no longer valid but it can still be accessed here: tinyurl.com/mr2fjws6 – it seems highly technical at first glance, but it contains egregious errors as the ones I mentioned above, as well as egregious typos like "MTF" or "NTSF". The link I provided above is definitely a much better resource for anyone who wants to learn about NTFS in-depth.