NTFS internals


  • Hello,
    I'm looking to develop a way to delete millions of small files from NTFS directories. The standard console command and Win32 APIs work but take many days or weeks to complete the job. Meanwhile, the machine is blogged down with the disk activity.

    Is there a forum that discusses NTFS internals?

    Help much appreciated.

    T McLeod
    Friday, June 05, 2009 10:19 PM


All replies

  • Hello thomas,


    Thank you for your post!  I would suggest posting your question in the 'Windows Server TechCenter > Windows Server Forums > General ' located here:

    Have a great day!


    SachinW Tier 2 Application Support Server and Tools Online Engineering Live Services Team
    • Proposed as answer by SachinW Friday, June 05, 2009 10:55 PM
    • Marked as answer by SachinW Friday, September 04, 2009 8:15 AM
    Friday, June 05, 2009 10:55 PM
  • Thanks, I can post there but I think the forum I'm looking for has more to do with file system drivers rather than admin. why don't I see any device driver forums on MSDN?

    Saturday, June 06, 2009 1:19 AM
  • Thomas,

    I'm interested in this subject.  I am looking for a way to identify the physical blocks on disk that are 'owned' by a specific file.  I've written and posted code to enumerate the Master File Table (MFT) and to use the USN Journal to identify the changes that occur on a volume. 

    Let me know where you've ended up and I'll be a frequent visitor/contributor.

    Tuesday, March 08, 2011 6:51 PM
  • Thomas Macleod,

    I think there is a way to do it quickly.  I've posted code about enumerating files by reading the Master File Table (MFT).  I you search the msdn forums for 'MFT' you'll find it.

    Anyway, each file in the master file table has a deleted bit that is set if the entry has been deleted.  It should be as easy as enumerating the MFT, finding the files you want to delete and setting the deleted bit.  I haven't done this but I remember reading about the deleted bit.

    Here is a link to a Code Project article that may help.  I haven't used it but I've skimmed through it.

    Let me know how it works out.


    Monday, April 11, 2011 8:54 PM
  • Sorry there is no OS support for MFT. Microsoft assumes you to access the file system via its File APIs so it can maintain integrity of the file system.

    If you want access NTFS without using File APIs, visit to license the technology.

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Wednesday, April 13, 2011 6:22 PM