Retrieving deleted files on Ubuntu

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

 

Is there any way for me to retrieve the corrupted files on my external hard disk drive? I was transferring my new files into the hard disk drive and plugged it out. I plugged it again and tried to open my files but I can’t do it because it has been corrupted already. Thank You!

SHARE
Answered By 0 points N/A #87129

Retrieving 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 multi-user 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

Related Questions