Ubuntu – All files erased after installing Ubuntu

data-recoverypartitioningwindows 7

Yeah, I know I should have backed up my files before proceeding, I completely forgot. Well, the thing is that I had a dual-boot system with Windows 7 and Ubuntu 10.10. Yesterday, I installed Ubuntu 11.04 alpha 3 (through live USB). I chose that 11.04 would install over 10.10 on the installation wizard, where I have no important files. However, it overwrote Windows too, and its data, meaning that I can't find Windows as a grub entry and I can't find the corresponding NTFS partition. Is there some way to recover it? Thanks!

Here is the sudo fdisk -l output.

> > Disk /dev/sda: 160.0 GB, 160041885696
>     > bytes 255 heads, 63 sectors/track,
>     > 19457 cylinders Units = cylinders of
>     > 16065 * 512 = 8225280 bytes Sector
>     > size (logical/physical): 512 bytes /
>     > 512 bytes I/O size (minimum/optimal):
>     > 512 bytes / 512 bytes Disk identifier:
>     > 0x0004f536
>     > 
>     >    Device Boot      Start         End 
>     > Blocks   Id  System /dev/sda1   *     
>     > 1       19327   155241472   83  Linux
>     > /dev/sda2           19327       19458 
>     > 1046529    5  Extended /dev/sda5      
>     > 19327       19458     1046528   82 
>     > Linux swap / Solaris
>     > 
>     > Disk /dev/sdd: 3965 MB, 3965190144
>     > bytes 255 heads, 63 sectors/track, 482
>     > cylinders Units = cylinders of 16065 *
>     > 512 = 8225280 bytes Sector size
>     > (logical/physical): 512 bytes / 512
>     > bytes I/O size (minimum/optimal): 512
>     > bytes / 512 bytes Disk identifier:
>     > 0x00007732
>     > 
>     >    Device Boot      Start         End 
>     > Blocks   Id  System /dev/sdd1   *     
>     > 1         482     3871633+   c  W95
>     > FAT32 (LBA)

And the cat /proc/partitions output too

major minor  #blocks  name

   7        0     676440 loop0
   8        0  156290904 sda
   8        1  155241472 sda1
   8        2          1 sda2
   8        5    1046528 sda5
   8       48    3872256 sdd
   8       49    3871633 sdd1

Best Answer

After a partition table has been accidentally overwritten you will need Data Recovery Tools to restore the remainders of your data. Mind that the likelihood for successful recovery decreases with every write access to your harddisk. Therefore best advice is to run these tools after booting from a live disk.

By installing

testdisk Install testdisk

you may be able to recover whole partitions. Included in the TestDisk suite you will also find the tool PhotoRec that helps to recover individual files even in the case a partition can not be restored or the drive itself has a hardware defect.

Related Question