1

I am new to Ubuntu. I have just installed Ubuntu on my system and unfortunately I have selected the "Erase disk and install Ubuntu"-option while installing the same.

It has deleted all my previous valuable data and an important project. Kindly tell me how I can recover all data.

I had Windows 7 before installing Ubuntu.

MadMike
  • 4,244
  • 8
  • 28
  • 50

2 Answers2

1
  1. Use an Ubuntu live CD and do not use the hard disk that was erased in any way
  2. Press super(Windows) key and try Software Sources. Enable to Universe repository
  3. Install testdisk using sudo apt-get update && sudo apt-get install testdisk
  4. Start testdisk using sudo testdisk
  5. Create a log, locate your partition and select its type (e.g.: Intel PC/ GPT etc.)

Read the options on the screen and proceed

Note: Save the recovered files (if any) to some other drive, preferably an external drive, not on the hard disk that was erased.

Anonymint
  • 164
-1

Generally when it says deleted all the data it doesn't actually refer to delete. Your partition has just been labeled for overwrites with use. That is, the information has been classified as worthless and will be overwritten when more useful data needs to be stored(i.e. your new data like installing Ubuntu) So the more data you use the more of your 'supposed deleted data' is going to get overwritten. Sadly there is no way to completely reverse the process, But There are many tools for recovery of deleted data

http://www.cgsecurity.org/wiki/TestDisk

Command line, could be a challenge if you aren't comfortable &

http://www.cgsecurity.org/wiki/PhotoRec

Are some of the tools you can use Do note this is only if the data is still present in some form hidden/ghost and has not been corrupted by overwriting of the bytes.

Some of the Steps you can perform Using testdisk: 1) Under Unix/Linux/BSD, you need to be root to run TestDisk (ie. sudo testdisk-6.13/testdisk_static). You must have installed testdisk in the first place using, in my case it was

tar -xjf /<path to>/testdisk-7.0.linux26-x86_64.tar.gz
cd testdisk-7.0.linux26-x86_64
./configure
make
sudo make install

After you download it, in that order.

Then you can try the following recommended steps from testdisk's intruction webpage:

1) To repair a filesystem not listed by TestDisk, run testdisk device, i.e.

testdisk /dev/mapper/truecrypt0 

or

testdisk /dev/loop0 

to repair the NTFS or FAT32 boot sector files from a TrueCrypt partition. The same method works with filesystem encrypted with cryptsetup/dm-crypt/LUKS.

To repair a filesystem on top of a Linux RAID device.

testdisk /dev/md0

2) Press Create in the next step, if it gives an error opt for 'No Log'

3) All hard drives should be detected and listed with the correct size by TestDisk:

Use up/down arrow keys to select your hard drive with the lost partition/s. Press Enter to Proceed.

4) Partition table type selection TestDisk displays the partition table types.

Select the partition table type - usually the default value is the correct one as TestDisk auto-detects the partition table type. Press Enter to Proceed.

5) Current partition table status TestDisk displays the menus (also see TestDisk Menu Items).

menus Use the default menu "Analyse" to check your current partition structure and search for lost partitions. Confirm at Analyse with Enter to proceed. Now, your current partition structure is listed. Examine your current partition structure for missing partitions and errors.

Analyse The first partition is listed twice which points to a corrupted partition or an invalid partition table entry. Invalid NTFS boot points to a faulty NTFS boot sector, so it's a corrupted filesystem. Only one logical partition (label Partition 2) is available in the extended partition. One logical partition is missing.

Confirm at Quick Search to proceed.

6) Quick Search for partitions TestDisk displays the first results in real time.
quick search During the Quick Search, TestDisk has found two partitions including the missing logical partition labeled Partition 3.

first results Highlight this partition and press p to list your files (to go back to the previous display, press q to Quit, Files listed in red are deleted entries). All directories and data are correctly listed.

Press Enter to proceed.

7) For the rest of the steps I highly recommend you visit the testdisk website as there are many exhaustive steps with complete details

http://www.cgsecurity.org/wiki/TestDisk
XChikuX
  • 250
  • While these tools probably will help (actually, more Testdisk than Photorec) this answer seems written in the form of a software recommendation, which is not the best way. You should update your answer writing how to perform the recovery with those tools. – Andrea Lazzarotto Jun 01 '16 at 10:52