How to recover data from formatted swap?

I am using Ubuntu 12.04. I have 4 partitions of hard disk. 1st of 43 GB contains Windows 7, 2nd (43 GB) and 3rd (32 GB) contained valuable data and 4th of 42GB contains Ubuntu.

Now, while installing Ubuntu 12.04, by mistake I made whole 32GB hard disk SWAP. Now I am unable to access that data neither from Windows nor from Ubuntu. So I installed Gparted and formatted that disk to FAT32 (which was a horrible mistake from my side).

Now I used a recovery software from Windows to recover the lost data but to no avail. I thought may be the disk is in FAT that is why I am unable to recover. So I formatted it again into NTFS. But all the same I am unable to get my precious data back.


Solution 1:

What was the original format of the 32 GB partition?

You need to download and use testdisk from Ubuntu; you can do it with sudo apt-get install testdisk. DO NOT use data recovery tools from or even start Windows -- it is more likely to write to a FAT32 or NTFS drive, erasing any traces of your previous data.