I dropped my laptop when Windows was getting ready for hibernation, and as a result, I had a crash on my hard drive. (Teaches me the next time to get a hard drive and / or laptop with a free fall sensor.) In any case, starting SpinRite to recover data led to the fact that all spare sectors on the disk were all used up for all sectors being restored. SpinRite is still going right now, but since there will no longer be spare sectors, I think it will be a fruitless exercise, except to tell me where all the bad sectors are.
In any case, I plan to write an application to try to save data from the hard drive. From my past defragmentation raids, I know that I can use FSCTL_GET_RETRIEVAL_POINTERS to determine the logical cluster numbers for any given file.
How can I try to read sectors for this actual cluster? My copying through the MSDN list for device, drive, and volume device control codes did not cause me anything, as I get the actual cluster data.
Should I not even try to read at this low level? Should I make SetFilePointer () and ReadFile () calls instead to go to the corresponding cluster size offsets in the file and read the cluster-sized chunks?
If the file I'm trying to read has a bad sector, will NTFS mark the entire file as bad and prevent me from accessing the file in the future? If so, how can I tell NTFS not to mark the file as bad or dead? (Remember that HD is now disconnected from the spare sectors to be reassigned.)
Should I turn off my knowledge and figure out how to read / dev /?
Update: I found the answer to my question. :-) The solution is SetFilePointer () and ReadFile () in the volume descriptor, and not in the file descriptor.
source
share