Take the 2-minute tour ×

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?

share|improve this question
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 –  Jop 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. –  Jop May 20 '13 at 12:31
show 2 more comments

migrated from stackoverflow.com May 20 '13 at 12:19

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
Thank you very much as that worked perfectly! It pulled just about everything off that I could imagine and then some, apparently there were things on there from the manufacturer as well. Thank you very much! –  rosscowar May 20 '13 at 19:10
No problem :) PhotoRec helped me in a similar situation. –  damaltor May 20 '13 at 22:20
Yeah the results were a little clumsy as it appeared that it was taking the "have it and not need it approach" with file beginnings and endings plus it wasn't perfect with knowing the file types but it was the only program that I had used thus far that even hinted that they were there. It took about an hour to reconstruct the data I needed and I'm back in business now! It will definitely stay in my tool box from here on out! I might even build a gui for it :) –  rosscowar May 20 '13 at 23:28
add comment

Your Answer


