How to recover data in formatted hard disk and already installed a new OS

Help how to recover formatted hard disk and already installed a new OS but not yet installed applications.

Edit: I have two 500g hard drives lets say HD1 has my personal files and the other is HD2 where I need to install my OS, but I accidentally formatted my HD1 and installed the OS on it.

I just want to know if I can recover some data on it estimated 200g of data.


Solution 1:

You are not guaranteed that you will recover all your files. If you have anything precious in deleted files then the next worth giving it a try.

You are not recommended to write on partition any more in order to keep data chains at the drive as they are. In other words avoid sectors overwriting. Stop using this drive immediately!

Boot from Live CD (or even better from the different drive with installed OS) and run any software which is supposed to recover deleted files. It's general recommendation. As you didn't include what OS do you have it will be below explained how to do this in Linux, for example from Ubuntu Live CD.

So you should run the software which find and recovers files/data from your physical storage. It is still possible although Operating Systems can not see deleted files due to their references were deleted from File Table, or File Table was corrupted.

  • Scalpel

This is a filesystem-independent recovery tool for Linux. The latest version is 2.0. Install it in Ubuntu with

sudo apt-get install scalpel

Next is some text editing — the configuration file is /etc/scalpel/scalpel.conf. You will find that everything has been commented out — uncomment the specific file format that you want to recover. For example, if I want to recover a deleted zip file, I will uncomment the .zip file section in scalpel.conf

Next, in a terminal, run:

sudo scalpel  [device/directory/file name] -o [output directory]

The output directory, in which you want to store recovered files, should be empty before running Scalpel; otherwise, you will get an error.

  • Photorec

This is the fastest utility of the three. It’s installed by the testdisk utility package. If you don’t want to mess with the command-line, this is the best utility for you. Just run photorec as the root user in a terminal, and you will see a nice ncurses-based UI.

Select the device to search, and it will ask you for the partition table type. Select yours; in my case, it’s Intel. Next, you have to select the filesystem or partition of the device disk. Next, it prompts you to choose the file system.

Last, it will ask for an output folder in which to store recovered files. After making a selection, press y to proceed.

Note: The above utilities will not recover replaced files, because in the case of replacement you are replacing the inode itself, so it’s not possible to recover it.