thank you.
So, there is no way around it without writing a device driver to handle the read/write operations? Is that right?
I have a utility written in python which able to identify the bad sectors exactly as the same way as the C program. I am not sure, if python would have implemented anything internally (a device driver) to achieve this. I'm currently downloading the python source code to analyse.
I am sure C is more low level then python (which is btw the dumbest statement, i've said
) and should be able to achieve it. It's little weird that the program fails to identify the bad sectors. I have analysed the following programs so far for such an implementation. And all have the same code.
Testdisk, dd, ddrescue, badblocks etc.,.
So does this conclude that the none of the above available usermode linux opensource programs are really doing what they are claiming for? (data recovery / forensics utilities?) All the above program implements O_DIRECT options too.
Well, I guess I am in need of a fix now!
It also sounds a little weird that there are no user mode programs (not even one?) available in linux that can do a direct I/O with the disk. (Except that I am willing to write one using the libata / scsi libraries which can directly talk to the ATA (PATA / SATA) devices using ATA protocol (i've done this in dos using assembly) and SG / SCSI protocol to the scsi devices).
Anyways, thanks for all your input and guidance. Atleast it got me to do the O_DIRECT implementation. Please update this thread if there are any more information to be shared / assisted.
Thanks again for all the help.