Monday, January 18, 2016

How to recover files in Linux

Recovery is necessary thing  todays computer world because of the value of the computer data is higher. I have explained how a file can be recovered if it has been deleted and I have explain how it happen in a previous post. So in this post I'm going to discus a technique/ tool to recover files in Linux systems because there are lots of tools to achieve this on windows.

There are many command line tools to recover files in Linux systems which are working in different way. Here I will mention about the Testdisk tool which is very use full tool when recovering damaged hard disks also. In this article we are focusing only how to recover a file which has been deleted from the linux file system.

Installing Testdisk



Fire up terminal and type
sudo apt-get install testdisk

How to recover files using Testdisk.

After installing the testdisk type the sudo testdisk on the terminal.
Then you will come to the main menu of the testdisk. In here you can select Create  to create a new log. or if you do not need a log select No log. And press enter.

Then It will show the all storage devices connected to. If you have connect  your thumb drive it also shows here. Now select the correct drive which your deleted files resides. Make sure Proceed has highlighted and press enter to proceed. Then you will have to select the Partition table type. If this selected wrongly it will not shows the files. Most of times [Intel  ] Intel/PC partition works. Select the correct partition table type and press enter. Then you have several options. In here select Advanced and press enter.

Now the testdisk will show you all the partitions of the selected drive including swap. Select your partition and select the on List using left and right arrow keys and press enter. Then you will see you file system in root. Go through your files you will see some files are highlighted with red colour. Those are the files which has been deleted from your drive. When you go on to the deleted file press 'c' to copy the file. Then testdisk go to the root directory and it will ask you to select a destination to copy the file. When next time you are copying it will automatically copy to the same directory that you have selected.

So that's all. It's how you can recover deleted files in linux system easily.

No comments:

Post a Comment