Search code examples
c++windowsntfs

Developing a sector based partition copying program?


I want to develop a program that copies a partition's 'data' only, to another partition. And I want to do it such that the program starts from the first sector of source partition and checks if a sector is used.

If it is used copy it to the destination parition. Else don't copy.

In other words it's like copying only the contents of a partition to another, sector-by-sector.

Question: Is there a way to check if a particular sector on harddisk is used or not?

The programming language I am using is C++ and the underlying filesystem in NTFS.

Thanks a lot.


Solution

  • Your question is fundamentally flawed. NTS can store data and metadata in the same cluster. Both are handled as file attributes.

    I'm also wondering what the point is. Without the metadata, raw data is useless. You can't even tell where one file ends and another begins.