Select font size:          

 

Linux file recovery

Note that by 'deleted' we do not mean 'put in the dustbin'.
When deleting a file, they are actually not really deleted yet. They are marked as to be overwritten. The exact place where the system would put a newly created file is rather random. It could overwrite delete files any time.
When trying to recover files that you deleted accidentally avoid by all means to touch the partition where the deleted files are located. So, either you have it already installed, in that case you are anyway safe, or you use a portable version which you can start for instance from an external hard disk.
There are several tools as you can see below. However, as a recommendation and in order to make your choice easier, we would first try Testdisk. Only if it does not work with Testdisk, try one of the other tools.


Testdisk

If you do not see your partitions for some reason or accidentally removed one, then testdisk is a candidate. See here: Recover partitions using testdisk and here: Recover files using testdisk. Test disk is Open Source and is being offered together with PhotoRec.

ddrescue

Ddrescue is a data recovery tool. It copies data from one file or block device (hard disc, cdrom, etc) to another, trying to rescue the good parts first in case of read errors.

Ddrescue is Free Open Source. For more information check here:

https://www.gnu.org/software/ddrescue/

However, for the installation we recommend to use the default installer of your Linux distribution.

The software is available for Linux and MacOS.

Foremost

Foremost is a console program to recover files based on their headers, footers, and internal data structures. This process is commonly referred to as data carving.

Foremost is Free Open Source. For more information check here:

https://foremost.sourceforge.net/

However, for the installation we recommend to use the default installer of your Linux distribution.

Although quite outdated, it should be still working on new Linux distributions.

PhotoRec

PhotoRec is a file data recovery software designed to recover lost files including video, documents and archives from Hard Disks and CDRom and lost pictures from digital camera memory. PhotoRec ignores the filesystem and goes after the underlying data, so it will still work even if your medias filesystem has been severely damaged or re-formatted.

PhotoRec is Free Open Source. For more information check here:

https://www.cgsecurity.org/wiki/PhotoRec

However, for the installation we recommend to use the default installer of your Linux distribution.

The software is available for Windows, Linux and MacOS. It is portable and comes together with testdisk.

Extcarve

Extcarve is a ext2/ext3/ext4 file recovery and semantic file carving tool. It can recover a range of file formats, including PNG, JPG, GIF, PDF, C/C++ programs, PHP, and HTML.

Extcarve is Free Open Source. For more information check here:

https://github.com/Lakshmipathi/extcarve

However, for the installation we recommend to use the default installer of your Linux distribution.

Extcarve is deprecated, but should still work.

Extundelete

Extundelete is Free Open Source. For more information check here:

https://extundelete.sourceforge.net/

However, for the installation we recommend to use the default installer of your Linux distribution.

Ext4magic

Ext4magicFor more information check here:

https://sourceforge.net/projects/ext4magic/

However, for the installation we recommend to use the default installer of your Linux distribution.

grep

This command might not look like the first choice for file recovery, but it is very powerful. If you are searching for strings that are present in the files to be recovered, this might be your preferred tool. It is quite a lot used as a part of computer forensics.


Note that you can get more information about each command with command -h or command --help.



Check for more Linux related articles.