To get all unused clusters on an NTFS volume, you will need to build a map of all distributions of all files and streams. This is very difficult since you need to parse exnent lists for non-resident files. And MFT.
But you can use the IOCTL or fsutil queryallocranges file in a truncated file and read the last degree further. Calculate where the current file ends and you lose the file.
That is, if the file is not compressed or EFS-encrypted.
A free or commercial data recovery program will be a faster way.
source
share