But I prefer
sudo apt-get install foremost
Take a look at
to learn how to use foremost.
First make an empty writable directory to save recover files in a partition other than that you are going to recover.
Then run foremost.
I am going to recover my home partition ( let's say
$ sudo foremost -t jpg -i /dev/sda5 -o /recovery/data
Finally set user permission to /recovery/data/ to view image. type
$ sudo chown YOUR_USER_NAME /recovery/data -R
Some important foremost command line arguments.
-i :- partition/image to recover
-o :- location to store recovered files.
-t :- built in file filter options. you can give multiple filters by separating using commas. (e.g: for jpg and pdf: -t jpg,pdf )
-q :- quick mode.