How to Recover Deleted Files from Linux Partition?

Try these tested and proven methods to recover deleted files from Linux partitions.

best software to recover deleted files from Linux partitions

Data is something no one wants to compromise on. We all go the extra mile to protect our sensitive information. Still, there are a number of incidents worldwide when people lose their data accidentally. Have you just lost some important data files in Linux? Don’t you know where they go once deleted? Want to get them back? This is the read you can’t miss, as it lists the 6 best ways to recover deleted files from Linux partitions. The contents we will be discussing in today’s article are as follows.

Part 1. Is It Possible to Recover Deleted Files from Linux Partitions?

Well, the answer to this question is yes and no at the same time. It all depends on how your computer is configured. Deleting a directory or a data file in Linux does not mean that you have lost it forever. Before these files are erased from your system, they go to a few folders’ layers.

These layers of folders can be user-created, sensitive, outdated, or corrupt. Regardless of how the files or data have been deleted, they still take up some space on your disk, even if they have nothing in them.

Usually, in Linux partitions, deleted data goes to a specific folder, commonly known as a “Trash Can.” You can see this folder on your computer by the name of “Trash.” Using the hidden folder view option, you can access the trash folder at any time. In addition, you can also access the same folder by going to “~/. local/share/Trash/files/.”

Part 2. 6 Best Ways to Recover Deleted Files from Linux Partitions

If you have pressed the “Delete” button to delete data from your Linux system, you can visit the “Recycle Bin” or “Trash” folder to get it back. But if the files are deleted by pressing the “Shift + Delete” buttons, you must use a data recovery tool to restore all the stuff. Below is a list of the top 6 methods you can use to recover your deleted data.

1. Recover Deleted Files from Linux Partitions Using Recoverit - The Easiest & Quickest Method

Wondershare Recoverit is an amazing data recovery software that offers profound support for Linux recovery. It is known for performing a smooth scanning process and ensuring accurate Linux data file recovery. Great support for the Ext4 file system is available.

If you are looking for a dependable, highly secure, and efficient tool to get your data back from Linux computers, look no further than Recoverit. More than 50 million users trust this software when it comes to recovering their sensitive data. In addition, over 95% data recovery rate adds more value to the credibility of this program. Give it a try and see the miracles happen.

How to Use Recoverit?

Video Tutorial on How to Recover Files on Linux?

Within 3 simple steps (as listed below), you can restore permanently deleted data with Recoverit.

Free Download

For Windows Vista/7/8/10/11

Free Download

For macOS X 10.10 or later

Step 1: Once you download, install and open the tool on your computer, navigate to “NAS and Linux.” You will find this option in the left bar. Now, tap on “Linux Recovery.”

recover data from linux partitions with recoverit

Step 2: A new window will now ask you to enter some information, including User Account, Password, IP, and Port. Provide the required information and hit “Connect.”

create a remote connection to recover linux os files

Recoverit will start an automatic scan to search for your deleted data files right after the remote connection is established successfully.

Step 3: The scanning process takes some time to complete. It depends on how big or small data files you wish to recover. You can see the scanning progress at the bottom of the program’s window. More importantly, if you have found the file you want to restore before the scanning is completed, you can stop it immediately.

preview deleted files before restoring

You can preview all the deleted files once the scanning gets completed. Has the program shown you the right file in the preview mode? If yes, click on “Recover.”

restore lost or deleted files using recoverit

It is time to select the path where you want to save the restored data files.

save recovered linux data files on your system

Quick and effective way to recover your data

Offers precise Linux data recovery

Features secure data restoration

Highly responsive customer support services


Support for the Ext2 and Ext3 file systems is yet to be added

2. Recover Deleted Files from Linux Partitions Using TestDisk

This tool provides you with an efficient way to recover permanently deleted data from Linux partitions. Moreover, it is an open-source program which means you can take online help on how to use this software.

How to Use TestDisk?

You can restore data with this tool using the 7 steps listed below.

Step 1: Right after installing TestDisk, open the tool and type the command “sudo testdisk.”

Step 2: An interactive prompt will be opened. Use your keyboard’s arrow buttons, choose the desired option, and press “Enter.” The first option you will see on your screen is “Create a new log file.” Proceed and create a log file.

use testdisk to create a new log file

Step 3: Now, you will be able to see the storage devices connected to your computer. Select the disk containing your deleted stuff. This example is using /dev/sdb media. You are free to select yours and go ahead.

choose the disk with deleted data

Step 4: Now, you have to choose the correct partition for your drive. TestDisk itself will help you find the right partition. If you are unsure, choose the one selected by TestDisk.

choose the right partition with testdisk

Step 5: The new screen will display multiple options, like Analyze, Advanced, Geometry, Options, and others. In this example, we have chosen the “Advanced” option to restore permanently deleted Linux data files.

recover deleted data with test disk

Now, the program will show all the partitions on your screen. All you need is to choose the one with the deleted data files and select “[Undelete]”. You will find this option at the bottom of the program’s screen.

select the disk with deleted data files

Step 6: TestDisk will start scanning your lost data. In this example, we are searching for the file “picture.jpg” as shown below.

scan lost data files with testdisk

Once you select the desired files (you wish to get back), copy them by pressing “C” from the keyboard.

copy data files you wish to restore

Step 7: TestDisk will now ask you to choose the path where you want to save the restored data files. As soon as you select one, tap on “C.”

save restored data on your computer

User-friendly interface

Features portable options

Performs secure data recovery


Some users claim that deep scan takes longer than other similar tools

3. Recover Deleted Files from Linux Partitions Using PhotoRec

The TestDisk developers have built another powerful software - PhotoRec - to recover deleted or lost data files. Earlier, the major feature of this program was to restore photos only, but later it became a full-fledged data recovery tool. Now, you can use this program to restore any kind of deleted data files.

How to Use PhotoRec?

This software asks you to follow 5 convenient steps as follows.

Step 1: Open PhotoRec with the command “sudo photorec.” The layout and navigation of PhotoRec and TestDisk are pretty similar. Now, choose the correct media and go ahead.

use photorec to recover deleted files

Now, choose the correct partition and select “[File Opt]”. You will see this option at the bottom.

select the appropriate partition to recover data

Step 2: The program will select all file types. You can select a specific type of file as per your needs. This example considers the “JPG” file type to recover files from the same format.

choose the right file type to restore

It is time to press “q” to go back and choose the “Search” option to initiate the recovery process on the Linux partition.

use photorec to recover deleted files

Step 3: Now, choose the right file system type. If the file system is not Ext3 and Ext4, select the “Other” option.

choose the file system type

Step 4: It is time to tell the program whether you want to search for the desired files in the free space or the whole partition. In order to look for the deleted files, this example has chosen to search in the “Free Space” only.

search free space or whole partition to find deleted data

Step 5: This step is about saving the recovered data on your computer. Choose a different location and save the files by tapping on “C.”

save restored files from linux partitions

Now, the program will save the files on your chosen destination and scan the free sectors. The restored data will be saved under the “recup_dir” directory.

get lost data back and save on your system

You can use it for free

Recovers multiple files, including HTML, ZIP, graphics, documents, etc.

Offers support for a wide range of storage media


GUI is not appealing

Customer support is not much responsive

4. Recover Deleted Files from Linux Partitions Using Foremost

It is another wonderful software to get your permanently deleted data files back without even paying a single penny. Foremost comes with a user-friendly GUI, so you can easily use this software even if you are not a tech-savvy person.

How to Use Foremost?

The steps to benefit from this data recovery program are listed below.

Step 1: Using the below commands, you can install this software on Linux.

# Ubuntu and Debian
sudo apt install foremost
# Fedora
sudo dnf install foremost
# Arch Linux
sudo pacman -S foremost

Step 2: As soon as you install Foremost, you can use the below command to list different options available in the program.

foremost -h

To restore the “picture.jpg” file, try using the below command.

foremost -v -t jpg -i /dev/sdb1 -o ~/recovery/

The above command will start searching for all JPG images deleted from “/dev/sdb1.” Once the images are found, the same command will recover them to “~/recovery.” Other variables in this command are associated with different parameters as shown below.

-v = this flag activates verbose logging

-i = it is used for specifying the source partition

-o = it indicates the output directory

-t = it allows you to select which file you want to search for in partition

use foremost to restore permanently deleted data

Note: You can search executable files, text, videos, photos, and much more with Foremost.


Offers data recovery for free

Features easy-to-use interface

Performs efficient data recovery


Not much popular as PhotoRec or TestDisk

5. Recover Deleted Files from Linux Partitions Using extundelete

Have you deleted or lost important data from the Ext3 or Ext4 file system? Worried about restoring the stuff you just lost? extundelete will surely be your reliable partner in getting your data back. Let’s look at how you can use this software for data restoration from Linux partitions.

How to Use extundelete?

A simple, 3-step guide is presented below.

Step 1: Use the below commands to install extundelete on your computer.

# Ubuntu and Debian
sudo apt install extundelete
# RHEL and CentOS
sudo yum install extundelete
# Arch Linux
sudo yay -S extundelete

Step 2: Try using the below command to recover a particular file immediately.

sudo extundelete - - restore-file picture.jpg /dev/sdb1

use extundelete to restore deleted data files

The command presented below will recover all files from “/dev/sdb1” partition and change the name of the partition to match the source.

sudo extundelete - - restore-all /dev/sdb1

Step 3: You can use the “-o” option to save the restored data on a particular directory.

sudo extundelete  -o ~/recovery - - restore-all /dev/sdb1

The restored data files go to the sub-directory “Recovered_Files” by default.


Easy to install

Offers support for the Ext 3 and Ext 4 file systems

Features quick data recovery


Data recovery possibility becomes low if the file system you want to recover is on the system’s disk

6. Recover Deleted Files from Linux Partitions Using R-Linux

It is a GUI software to recover data files from Linux partitions. R-Linux is not an open-source program but you can use its features for free. It is highly compatible with the Ext2, Ext3, and Ext4 file systems when it comes to restoring your deleted or lost data.

How to Use R-Linux?

You just need to follow the three simple steps, as listed below.

Step 1: Go to the applications menu and open R-Linux after installing it on your computer. Now, enter the sudo password.

restore deleted files with r-linux

Step 2: It is time to select the source partition from where you want to recover the deleted data. Scan this partition using the graphical user interface. You have the option to select from different scanning approaches available.

scan source partition to restore deleted files

Step 3: Once the scanning completes, you will see a number of files deleted from your drive. Select the one you need to restore and save it to your system.


Free to use

Easy to download and install

Offers support for the Ext2, Ext3, and Ext4 file systems


It is not an open-source program

Frequently Asked Questions (FAQs)

As soon as you softly delete data, it goes directly to the “Trash” or “Recycle Bin”. The deleted files stay there temporarily and you can easily recover them later.

The files like entire folders, groups of files, or single files can easily be deleted from Linux at any time.

If the files are deleted permanently, you can use different third-party data recovery software, like Wondershare Recoverit, PhotoRec, TestDisk, and others, as listed above.

No, Linux applications do not track your data because they don’t have any incentive to do so.


Do you intend to recover deleted files from Linux partitions? Never gone through this condition before? Don’t know how to get your lost data back? Well, do nothing but try any of the above-listed Linux data recovery tools. Wondershare Recoverit is on top of all when it comes to efficient and trusted data recovery for Linux partitions. However, you can also use other software, like PhotoRec, extundelete, TestDisk, and others.

Free Download

For Windows Vista/7/8/10/11

Free Download

For macOS X 10.10 or later

You May Also Like

How To Remove Files or Directories Recursively in Linux

Here are the steps to recursively remove files or directories/folders in Linux

How To Use Foremost to Recover Files on Linux and Its Alternative

Here’s how to install and use Foremost to recover data in Linux and its best alternative.

How To Install and Use TestDisk on Linux and Its Alternative

Detailed here are the ways to install and use the TestDisk Linux data recovery tool, plus its alternative.

Top 10 Linux Partition Recovery Tools

Restore your deleted or lost data with the 10 best Linux partition recovery software.