How to recover deleted files from [formatted] FAT32/NTFS drive in Linux?

Is there like EasyRecovery for Linux? Free open source command-line based software strongly preferred.

Expecting something like:

$ fat32_recovery --some-arcane-options dump.img dir/
Recovery in progress...
    ~ILE1.TXT -> dir/XILE1.TXT
    ~IR1 -> dir/XIR1/
    ~IR1/ololo.txt -> dir1/XIR1/ololo.txt
    ~IR1/kekeke.avi -> dir1/XIR/kekeke.avi [damaged 10%]
    goodfile.txt -> dir1/goodfile.txt

Is there special things for jpg photos or documents (like in EasyRecovery)?

There are numerous step-by-step recovery GUI tools for Windows, I'm looking for console-based ones targeted for power users.


Solution 1:

You can try PhotoRec, which works natively on Linux. It works with all Windows and Linux filesystems. If the filesystem itself is damaged beyond what PhotoRec can handle, you can also use TestDisk (from the same company) which can repair and recover an entire filesystem if possible. Both of these tools are free, open source, and cross platform. From the website:

PhotoRec ignores the file system and goes after the underlying data, so it will still work even if your media's file system has been severely damaged or reformatted.

Alternatively, you might have some luck using Recuva under Wine. From the entry in WineHQ, it appears as though it works with Windows-based filesystems (e.g. NTFS/FAT32), but not Linux-based ones (e.g. Ext3, XFS).