I had just started doing a lot of Java development off of one of my thumb drives for portability and constant access to my most recently worked on version of some piece of software and things were great.

I however made the mistake of not backing these files up for a few weeks and lost a considerable amount of work when an Android device of mine (OUYA) decided to format the drive when all I did was simply plug it in to said device.

I have no clue why the OUYA formatted my drive and I don't really care to be honest but I would like some pointers on recovering these files.

I downloaded Recuva because I had heard about it recently and it did really well recovering screenshots and zip archives but nothing along the lines of *.java and *.class files. I tried probably 6 other data recovery suites only to realize that they're ALL specifically designed for specific file types which I imagine is necessary to pick up on specific signatures of the now deleted files.

This is problematic because I can't find anything that boasts recovering deleted source code or generic text formats. The only luck I can get is with media of the picture and sound variety and a bunch of other popular formats.

So, how can I recover Java related files like *.class and *.java?

  • 7
    In the future, you should use a version control system so that all your machines + a server in the cloud hold all the data. – assylias May 20 '13 at 11:50
  • Have you tried Restoration 2.5.14? – Steve May 20 '13 at 11:51
  • @assylias Such as GitHub – stommestack May 20 '13 at 12:25
  • @com.BOY Or bitbucket if you don't want to share your code with the rest of the world. – assylias May 20 '13 at 12:30
  • @assylias Yeah. You can use GitHub for closed source code, but that is going to cost money. – stommestack May 20 '13 at 12:31

Try PhotoRec. It will scan your disk and let you navigate through files and folders as if they were still there. The usage is a bit weird, but it works nicely. Please read the manual before using it.

On the website of PhotoRec you will see that .class and .java are explicitely named as "known" file types.

Also, create an image of the disk as soon as possible. Use dd or dd_rescue for this, because PhotoRec can work with them as if they were a disk.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.