This question already has an answer here:

I had a serious problem during my Ubuntu 14.04 installation. I had a Windows 7 partition and a separate partition to install Ubuntu, where I already had Ubuntu 12.04 installed.

During the Ubuntu installation, I was asked if I wanted to either "Upgrade Ubuntu" or install it fresh new. When I chose to install it (which would delete the existing Linux installation along with all its files), I thought it would delete files only on the existing linux partition. However, for my surprise, it deleted all the existing partitions and created a single one for the new Linux install.

I had some backup of my data, but some very important documents were lost due to this repartitioning and formatting of my hard drive.

I know that there was a way to avoid this during installation, but it did not seem very intuitive to me. In previous versions it was easier to install Ubuntu alongside with Windows without risking all my data.

So, what I want to know is... Is there a way to recover my data, even if the partition has been deleted and reformatted? The partition I want to recover data from was NTFS.

I am aware that I may not be able to recover everything, but I want to try to recover as much data as I can. I read testdisk might be useful... but I don't know how it could be used in recovering files from a partition that has already been formatted.

marked as duplicate by Panther, user117103, Braiam, Danatela, Eric Carvalho Apr 24 '14 at 11:07

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    It is likely you will have data loss. Your first line of defense is to restore from backup. If you do not have a backup, lesson learned the hard way, always back up your data. Work through this link - help.ubuntu.com/community/DataRecovery ask a more specific question if you get stuck. – Panther Apr 18 '14 at 21:56

testdisk is a great tool. I had your same situation one year ago, testdisk helped me to recover too many files, but remember that is better to use testdisk using Ubuntu in Live mode, try to recover your files using testdisk as soon as you can.

  1. open your terminal and type

    sudo  testdisk

    then enter your password and select the first option "create" to create a logo file

  2. select the HDD that you want to search for delete files

  3. the program will chose it self the correct option for you, if your computer have EFI support it will select it for you, if you are using a Mac select Apple partition map, if you are using an Intel PC or AMD PC select the first option "Intel/PC partition"

  4. select analyse your hard disk for partitions

  5. select tip QUICK SEARCH to let testdisk find all your partitions, be carefully while you navigate in the terminal the later D means Delete

    testdisk will ask for search for partition created under Windows Vista or later. select the correct answer tipping Y for yes or N for no

  6. after explorer your disk It will show you all your partitions, select the partition that you have been deleted/formatted

    then select DEEP SEARCH, after scan the partition that you have been selected, it will ask you to select the destination, is recommended to select an external device like External Hard Drive.

Check this link in my Google+ https://plus.google.com/u/0/100263103486581717464/posts you can see step by step how to use testdisk. If you have any question or you did understand what I wrote just ask.

  • Hi Hilario... It's good to hear I am not the only one who experienced the same problem. I am watching some videos about how to use testdisk to recover files from a formatted partition. It is however difficult to find out the exact steps I should follow. Could you please give me some tips on how you used testdisk to recover your files? – Rafael Apr 18 '14 at 22:18
  • 2
    you should NOT attempt this on a live/mounted filesystem. use a live cd/usb to boot and start testdisk from there. – amc May 25 '14 at 20:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.