SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Jesper de Jong wrote:You would not need to program in assembly language for this
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Prime wrote:
I'm still not sure it's not needed. Not for JNI, no, but accessing drives without using the file system is very low level. I'm not sure plain old C is enough for it, you may need to go lower. And then you essentially get to assembly code.
Rob Prime wrote:
I'm still not sure (assembler) is not needed. Not for JNI, no, but accessing drives without using the file system is very low level. I'm not sure plain old C is enough for it, you may need to go lower. And then you essentially get to assembly code.
For a task like this I'd choose a special utility usually provided by HDD manufacturer. Otherwise it cannot be guaranteed that the data were really overwritten precluding any possibility of their reconstruction, which seems to be the goal.
On unix, it's possible to do this from Java itself -- assuming that you have permission to read/write to the device files in the "/dev" directory.
Michael Kato wrote:I guess I don't need to kill the MBR and such for my purposes which the OS might not give permission to do, right.
Any approach based on files will necessarily NOT be able to write the entire disk since the operating system will have to keep file bookkeeping data on the disk somewhere.
If you manage to write to physical sectors on the disk, the OS is already out of the way. No one will stop you from overwriting the MBR, if that is what you order the disk to do.
Preserving MBR is also of little value in the scenario you've presented.
All in all, any HDD you give this treat will probably have all data and structure lost and will have to be repartitioned and reformatted. Make sure your users will be very, very clear what HDD they are operating on.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Paddy spent all of his days in the O'Furniture back yard with this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|