Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I had some text files I deleted acidentally. I want to recover them and I know the filename, but as they are all alike inside I can't use foremost or scalpel. The testdisk recovers the files but without the original filename so it's useless. Any help?

share|improve this question
    
What's the filesystem? FAT32? –  neon_overload Jun 18 '13 at 0:23
1  
If you can remember any of the text that was in the files that you want to recover, then take a look at this command –  karel Jun 18 '13 at 0:25
add comment

1 Answer 1

up vote 1 down vote accepted

testdisk has multiple modes of operation, and I think in simple mode it just does a sector-by-sector scan of the disk looking for things that look like files.

You'll want to follow to the letter this guide, which details going into advanced mode and then selecting the desired partition.

The ability to recover the filename from a deleted file depends on the filesystem used.

In FAT filesystems (including, I believe, FAT32) when a file is deleted the first character of its filename is overwritten and thus can't be recovered, but the rest of the filename can. When testdisk recovers a deleted file on a FAT filesystem, it substitutes the missing first letter with an underscore. So after recovery with testdisk (assuming you chose the right mode), instead of looking for "myfile.txt" you'll want to look for "_yfile.txt". I'm not sure what testdisk does for multiple files that have identical names from the second letter onwards.

Note that testdisk is designed for use on an entire partition or drive at once and it's designed to be able to recover from a partition you can no longer mount, so when it recovers files it doesn't recover them in-place, it must recover them to a separate drive.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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