Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
there's a hard disk from which dd can read some blocks and it fails after about 7.2MB of read. then it fails even if it reads again from first. i don't know what happens after this that causes me to unplug the hard disk and plug it again. but this time can't continue. i didn't find an option for dd to begin from where it had failed. it begins from the first and leads to the same result.
for this, i thought to write a program to read absolute sectors from the hdd regardless of its file system and regardless of whether it's a block device. i thought to write a program to read from the hdd sector by sector and write to another one (i've a free hdd) the sectors i've read. the program may output which sectors it could read and may retries. it may get from which sector it begins. it's a sever manual process, but my data worth.
for this, i need to know how can i do this preferably under linux. if C# maybe a better choice, i will write the program in Windows with this language. but i don't know also how to do it in C# too.
i remember when we were programming in DOS, there were absread and abswrite functions. i don't know how to do it nowadays.
Posted
Comments
Tomas Takac 8-Jan-16 7:15am    
Did you try ddrescue[^]?
Richard MacCutchan 8-Jan-16 7:26am    
It would be quicker to contact a company that does disk recovery.
Jochen Arndt 8-Jan-16 7:28am    
Maybe this link is helpful: https://help.ubuntu.com/community/DataRecovery
ilostmyid2 8-Jan-16 7:32am    
Tomas: no, i didn't. how can i install it?
Richard: I'll do it after my tries fail.
Jochen: thx, going to view
ilostmyid2 8-Jan-16 7:51am    
since the partition is indeed an NTFS partition encrypted by BitLocker, i prefer not to use any higher level program like testdisk and dislocker, etc. i prefer to make a sector-by-sector copy to another hard disk. for the effect i told, which causes the source hdd not to be readable even from safe sectors after i read from special sectors by dd, i still prefer to write a program for this purpose. ddrescue is doing something, but at the same i want to begin writing the program.

What's also screwing you over is the partition is BitLockered. Using a program outside of the O/S that's installed on the drive is useless. Every sector of the partition is encrypted and you have no hope of decrypting it.

You have to use something that will work while the installed O/S is running. There is no piece of code that you can write that's going to do a better job than the commercial tools. I know what you're trying to do and it's pointless as the resulting disk image will be unusable. Since the tools you've used have stopped near the beginning of the operation, you have no idea who many "holes" are in the drive and no idea if the data is still intact.

Seriously, if the data is worth that much, use a commercial data recovery service. It's really expensive so you have to make that call yourself.
 
Share this answer
 
Comments
ilostmyid2 8-Jan-16 8:53am    
how u say that? regardless of the source hdd how encrypted, the resulting hdd should be the same, because contains the same data. if Windows may unlock the source hdd (which is the case), the same Windows may unlock the destination hdd too, because it encounters the same data. maybe i'm talking about a lower-level treating with an hdd.
please just tell me the way to programmatically copy the source hdd into the dest hdd. this is a programming forum.
Dave Kreskowiak 8-Jan-16 9:45am    
I say that because the data cannot be read from the original drive. That means the data on the resulting copy will have holes in it! That means .EXE's and .DLL's that won't run anymore and corrupted data files that cannot be used by their respective applications.
ilostmyid2 8-Jan-16 10:53am    
yes, the holes will exist anyway. i say the result will be the best approach to the data i can retrieve.
Dave Kreskowiak 8-Jan-16 12:07pm    
ilostmyid2 8-Jan-16 12:42pm    
i need something simpler preferred in ubuntu, like:
void main()
{
char buf[512];
for (int i=begin; i<end; i++)
{
absread(i, "/dev/sdc", 512, buf);
abswrite(i, "/dev/sda", 512, buf);
}
}
Because the drive is encrypted using BitLocker, the so far discussed methods won't work. But you can try if the Microsoft BitLocker Repair Tool[^] can restore some of yor files.
 
Share this answer
 
Comments
ilostmyid2 8-Jan-16 10:54am    
this is the higher level method. first, i've to try to make an exact copy.
Jochen Arndt 8-Jan-16 11:13am    
See my comment below your question. The link describes what you can do (using ddrescue as suggested by Tomas).

But even if you are able to save an image: How will you decrypt the data?
As far as I know that is not possible with BitLocked volumes stored as image.
ilostmyid2 8-Jan-16 10:55am    
how can i make sure that the problem is the disk surface, head etc. or the controller?
anyway, you don't give me a method for writing the program.
Jochen Arndt 8-Jan-16 11:09am    
Why you care what part is defective?
You should care how to get your data. However, when portions can be read while others can't (especially when the failure occurrs always for the same sectors), it indicates that it is a physical disk error rather than a controller error.
[EDIT]
You may try to read the SMART attributes from the drive. That may give you some hints about what is going wrong.
[/EDIT]

The MS tool has been especially developed to help people like you:


"This tool helps access data encrypted with BitLocker if the hard disk has been physically damaged. This tool attempts to reconstruct critical data from the drive and salvage any recoverable data."

It does this by writing the rescued data to another medium. I'm telling such behaviour writing.
ilostmyid2 8-Jan-16 12:02pm    
i'll certainly try the solution. but the problem is something different. consider and example. sectors 0 to 100 may be read successfully. then sector 101 is read. it's defective. (it's an example). dd or ddrescue tries to read, can't and so skips. my word is that reading from sector 101 causes the drive to fail any further reads, even 0 to 100. for this, i need a program and i think i've to write it to have control over it. if so, i turn the hdd off, and on again, and relaunch my program and tell it to begin from sector 102. maybe 102 to 157 reads successfully and the process will begin with sector 159.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900