How To Recover Deleted Files/Data In Ubuntu Linux

If you are using Windows, there are many 3rd party tools that can help you recover your files easily. But if you are using Ubuntu, then it can be quite a huge problem. But worry not, since now you can recover your files in Ubuntu too.

Scalpel is one of the best command line tool to recover deleted files in Ubuntu Linux. It can recover almost all types of files. It visits data blocks of files sequentially and identifies deleted files and recovers them instantly. You can install it by running following command in your terminal.

apt-get install scalpel

Once installation is complete, you can start to recover your deleted data by using a simple command. Run the following command in terminal to recover your data.

scalpel /dev/sda1 -o output

where ‘output’ is the name of directory in which scalpel places the recovered files. You can specify any name to this directory, just make sure that this directory should not exist in your system because Scalpel create directory itself. Check the following snapshot to get an overview of how Scalpel searches deleted file.

scalpel2

The time taken by scalpel to recover files depends upon the total disk space and the amount of deleted data in your machine. Further you can check logs of recovery process by viewing audit.txt file in output directory. Enjoy!

  • Share this article!

    • Digg this!
    • Bookmark on Reddit
    • Bookmark at Delicious
    • Stumble this!
    • Share this post at Facebook
    • Tweet this!
    • Share on Yahoo! Buzz
    • Add AddictiveTips to your Technorati favorites
    • Share on Friendfeed
This entry was posted in Ubuntu Linux and tagged , , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

19 Comments

  1. Brad Smith
    Posted July 7, 2009 at 5:34 am | Permalink

    I got an error when I ran the command:
    ERROR: The configuration file didn’t specify any file types to carve.
    (If you’re using the default configuration file, you’ll have to
    uncomment some of the file types.)

    I had to edit the config file to get it to work:
    sudo gedit /etc/scalpel/scalpel.conf

  2. shaun w
    Posted November 2, 2009 at 1:00 pm | Permalink

    when you type the command to install scalpel, you should type:: sudo apt-get install scalpel

  3. nivir
    Posted November 19, 2009 at 3:04 pm | Permalink

    How to retrieve from the output file really stuck in there

  4. nivir
    Posted November 19, 2009 at 8:04 pm | Permalink

    How to retrieve from the output file really stuck in there

  5. nivir
    Posted November 20, 2009 at 1:04 am | Permalink

    How to retrieve from the output file really stuck in there

  6. Posted March 17, 2010 at 2:36 pm | Permalink

    I got an error when I ran the command:
    ERROR: The configuration file didn't specify any file types to carve.
    (If you're using the default configuration file, you'll have to
    uncomment some of the file types.)

    how to solve this dude ?

  7. asdasd
    Posted March 18, 2010 at 2:30 pm | Permalink

    read line 4… uncomment file types from /etc/scalpel/scalpel.conf using something like gedit / nano

  8. dsa
    Posted March 28, 2010 at 11:32 am | Permalink

    delete # <<<<<<

  9. Felipe
    Posted May 8, 2010 at 11:01 pm | Permalink

    suppose that i just wanna to recover one file that i just deleted by error… how suppose i do that?

  10. Shapu
    Posted May 13, 2010 at 8:04 pm | Permalink

    I need to recover over 400GB of files that I placed on a hard drive that I use as a back up drive.its a long story that happened 4 hours ago. but I too am stuck with this error:

    “ERROR: The configuration file didn’t specify any file types to carve.
    (If you’re using the default configuration file, you’ll have to
    uncomment some of the file types.)”

    please help, Yes I am a newbie. if there is need to elaborate what I did please let me know,I need those files… :(

  11. Sri
    Posted June 21, 2010 at 7:26 pm | Permalink

    I am getting this error while trying to run scalpel

    Written by Golden G. Richard III, based on Foremost 0.69.
    ERROR: You have attempted to use a non-empty output directory. In order
    to maintain forensic soundness, this is not allowed.
    Aborting.

    Please help.

    • jesse
      Posted June 23, 2010 at 12:22 am | Permalink

      The default directory is in your home folder. If you have run the program once then there will be a log file in this folder. You must specify a different folder or delete the contents of the specified folder.

  12. Vitor
    Posted June 28, 2010 at 9:41 pm | Permalink

    Hello, good afternoon.
    I’m still getting trouble with scalpel. First thing:
    1. The destination directory is empty, although scalpel informs me that it has carved 397 files
    2. At the config file, there’s no mention to open documento format documents or rtf. How can I tell scalpel to carve this ones too?
    Thanks a lot

  13. Posted July 12, 2010 at 1:08 pm | Permalink

    Hi guys.

    I’m getting the following message:
    Written by Golden G. Richard III, based on Foremost 0.69.
    ERROR: You have attempted to use a non-empty output directory. In order
    to maintain forensic soundness, this is not allowed.
    Aborting.

    and when I check my home folder I do not see the output folder.

  14. bill
    Posted August 19, 2010 at 6:07 am | Permalink

    I was quite hopeful for this, but it turns out to be FUCKING USELESS
    partly because of the lazy, idiosyncratic documentation, with undefined terms & silly mistakes,
    partly because of the assumption that I would know all sorts of things I really could not be expected to know, including how to set the parameters you don’t explain,
    the lazy assumption that I would be working in Sudo,
    and in the right directory (if I knew how to set a directory)

    (hey, you’re talking to non-tech newbies here,
    WHO JUST WANT TO RECOVER THEIR DAMNED FILES,
    not to technical geniuses, who if they were technical geniuses, would not need this anyway.)

    then when I get past all that, it crashes with a ‘run out of memory’ thing, WHAT???
    at about 1.7% done.

    So, thanks for trying, COULD DO BETTER though.

  15. bill
    Posted August 19, 2010 at 6:25 am | Permalink

    Now that I’ve calmed down and got past that (wanker!)

    here’s what I need:
    I was working with GEDit (another heap of crap, that), and it lost a draft piece of writing I had done (because it, or I, got confused when I tried to re-name it. Unbelievable.)
    These seem to be suffix-less files, in this case initially on my (Mint) desktop, a good page of prose.
    Can I limit the search to the desktop? To GEDit-type files?

    So, I wonder if you could tell me in plain English, without assumptions about my (poor)
    inside knowledge of Linux, exactly how I might recover my lost draft (without incurring some odd undocumented memory error).

    Then perhaps do some decent documentation so I don’t have to be fucked around next time I or anyone else needs to use you no-doubt excellent utility :-)
    It is, after all, my time and patience that is wasted.

    ANd, meantime, perhaps help my poor fellow sufferers above with what they want to do in the real world.

    ….Oh, for Christ’s sake, does it have to be like this? I wasn’t expecting to go into the flames….

  16. bill
    Posted August 19, 2010 at 6:28 am | Permalink

    that was, by the way:

    [sudo] password for mint:
    Scalpel version 1.60
    Written by Golden G. Richard III, based on Foremost 0.69.

    Opening target “/dev/sda1″

    Image file pass 1/2.
    /dev/sda1: 2.0% | | 250.0 MB 27:09 ETA** MEMORY ALLOCATION FAILURE **
    ERROR: Memory exhausted at line 286 in file dig.c. Scalpel was
    allocating memory for header array when this condition occurred.
    Scalpel will abort.

  17. bill
    Posted August 19, 2010 at 6:31 am | Permalink

    and if it did anything at all, it left the recovery file locked, apparently empty.

  18. Tom
    Posted August 31, 2010 at 6:50 pm | Permalink

    So far, this seems to be working fine for me. I’m about 1/2 way through the first pass, and no errors coming up. So, to recap the recommendations of others, here’s how to make scalpel work with very little wailing or gnashing of teeth:

    When using this is to uncomment (remove the # in front of) the file types in the config file. To do that, open a terminal and run gksudo gedit /etc/scalpel/scalpel.conf. Then, save the changes and return to the terminal.

    To download the scalpel program, remember to add sudo to the command when you type it in to your terminal (sudo apt-get install scalpel).

    To run the scalpel command correctly, you must again add sudo to it (sudo scalpel /dev/sda1 -o output). Remember, sda1 is the default name for your computer’s hard drive, so if you have a dual drive setup, or an external drive, verify the correct device name by opening the System Monitor and checking the File Systems tab.

    If you’ve previously run scalpel, change “output” to something else, or clean out the contents of the output file before you start the process. If you don’t, you will get an error message regarding trying to work with a “non-empty” directory.

    I wrote a simple script that executes the scalpel command. All you need to do is put the file in your bin folder, and create a desktop shortcut for it. If you’d like the script, drop me a PM on the Ubuntu Forum. My name there is tacantara.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


More in Ubuntu Linux,Windows (5 of 5 articles)