

Since we used the root user account to recover the file, we need to change the file ownership back to the normal user and confirm the file data validity. Let us confirm if our file was recovered: $ ls -l recovered You can now quit TestDisk by using the button to navigate back to the button. Once your press the key, you will be redirected to this menu once the lost data is recovered. We will need to navigate to this directory first… Choose File Recovery DirectoryĪfterward, we will press the keyboard button to copy the recovered data. Let us assume we created a sub-directory called recovered inside the Desktop directory. We might want to copy our recovered file to the highlighted Desktop directory using the keyboard key.

Navigate to the home directory and press. Choose Destination to Recover Deleted File Since we are dealing with a single file, we will use the keyboard key which will redirect us to the following terminal window. To copy a single/current file, use the keyboard key. To copy multiple selected files, use the keyboard key.

If you have more than one file that needs recovering, use the keyboard key to select/deselect them. There is even a timestamp of the exact date the file was created. Choose Undelete OptionĪs you can see, the linuxshelltips file we created at the root level of our directory is present. Navigate to the partition option that reveals the option at the bottom of the terminal window and press on your keyboard. Select the option and hit on the keyboard. In this step, go with the default option for partition table type by pressing on the keyboard. TestDisk has a tendency of highlighting the most viable option. Next, use the keyboard arrow keys and navigate to the menu option at the bottom of the disk drive list. Navigate to the one from which you wish to recover your lost data. You will be presented with a list of all the disk devices present on your system. Once installed, switch to the root user account and launch testdisk, and press on the highlighted option that states “ Create a new log file”.
#Testdisk recover deleted files install#
It can be installed on major Linux distributions as depicted below: $ sudo apt install testdisk The TestDisk data recovery tool is not only effective in recovering lost data but also in repairing corrupted filesystems in a Linux environment. Recover Deleted File in Linux Using TestDisk Data Recovery Tool We can now look at a viable solution to recovering our lost data. We have successfully deleted our file and confirmed that is it no longer available on the disk drive.
