How to identify allocated blocks on NTFS disk

Is there a way to determine which clusters on an NTFS drive are allocated? I think along the lines of the display you see in the defrag program before starting to defrag.

I think you could parse the MFT, but it seems to me that this could take a long time on a system with potentially hundreds of thousands of files.

thank

+2


source to share


1 answer


The easiest way is to get a bitmap of the disk with I / O controls. There is a good open source defragmenter that can give you a good example of how to do this: JkDefrag (NOTE: MyDefrag is not Open Source). Jeffey Wall WebLog also contains a bunch of links that might interest you.



Another interesting article on FSCTL_GET_VOLUME_BITMAP

I / O Control is provided by Microsoft.

+2


source







All Articles