How can I retrieve my deleted files on Ubuntu?

Asked By 0 points N/A Posted on -
qa-featured

I was recently clearing out my old files when suddenly I deleted some of my new files as well. In Windows OS you could retrieve your deleted files and restore it in a matter of clicks. I’m trying to figure it out with Ubuntu. Is there a way to retrieve and restore my original files?

SHARE
Best Answer by james1
Best Answer
Best Answer
Answered By 0 points N/A #87136

How can I retrieve my deleted files on Ubuntu?

qa-featured

Yes, you can retrieve deleted file in Ubuntu but you need to know first that the process isn't that easy. Know first that due to its multiuser policy, your file can be overwritten by other users, so you to turn to single user mode by using :
$ init 1

Notice: with root privilege
Now the general syntax for recovering you file is the following, Notice that this method fits only txt files!!!
#grep -i -a -B10 -A100 'name_of_txt' /dev/sda1 > new_file.txt
If your file system is ext2 you try with the recover command line, which is actually dedicated for the purpose of recovering deleted files;

you need to provide the partition you want  to scan, it will do the job
another possible solution is to use scalpel, the syntax is the following :
$scalpel /dev/sda1 -o output

you need to be root, output is the directory where you want to put you recovered files, sda1 the name of the parition, and of course you need to install scalpel first as it is not installed by default!!
hope this is helping!!
thanks

Answered By 0 points N/A #87137

How can I retrieve my deleted files on Ubuntu?

qa-featured

 

Losing data is so sad. But don’t be sad I have almost all the solution you need.

First you need to know that the folder in the desktop called “Trash”  in Ubuntu is just like “Recycle Bin” of  windows , so make sure to search  your deleted file there first.

Than if your deleted file is not there you have another thing it is called “Scalpel” it is a tool to recover deleted files. Open a terminal than type this “sudo apt -get scalpel” it is a commend that download the Scalpel and install it.

For normal going just leave default setting in the installation process, you are ready to recover your file.

Open a terminal than write “scalpel/dev/sda1 -o (the location where you want to save the recover file)”

Remember one thing also that “sda1” is the default name of the user drive of Ubuntu, so if you changed the name replace sda1 with that name of the drive.

After running the commend   Scalpel will search lost data in your drive. The searching time is depend on your drive capacity. After the end of the search you have to go to the location did you give.

 

Answered By 0 points N/A #87138

How can I retrieve my deleted files on Ubuntu?

qa-featured

 

Hi Monicasanchez,
 
To answer your question if there is a way to retrieve and restore your original files, I can say yes! If you look carefuly there are software online that can help you in restoring and retrieving all of the files, examples of the software: scalpel, foremost, photorec.
 
I want to explain one by one,
 
Scalpel easily used to recover any kind of files, and it is one of the top in the industry as it can recover files really quick in flash second. To use it, you will need first to install the software by inputting this command into your terminal, apt-get install scalpel. Press enter and terminal will prompt you to install, wait till installation finish, once its done, you can launch the program using command scalpel/dev/sda1-o output. For this command, output you can replace it with any place or directory you want the files placed.
 
Foremost is second software I recommend, it works to recover files looking from its header and footers. It is really flexible and can read an image file produced by dd, safe back, encase and other kind of program. When using it, you can have the option to select what kind of header you want to become headers and for the footers it is specified by configuration files that come with the program or you can use special command line to switch the default setup in the application. The foremost software can be installed using code sudo apt-get install foremost.
 
Later after installed you can type command for the type of files to recover.
Lastly Photorec, this software specially made to recover video files, documents and file archived in the hard disk. It does not need any command, and  it is extremely faster than other program mentioned. What you  need to do only typing photorec as root while opening the terminal, a dialog box will appear. And you follow every step to choose based on the system you use.
 
Hope this can help you

Related Questions