How to recover missing folders in a Windows-Ubuntu dual-boot system?

I have Windows 7 and Ubuntu 12.04 as dual-boot and on the same 500GB HDD.

I have partitioned the drive into NTFS file system from Windows before I installed Edubuntu 12.04 in the remaining free space.

Now, there is a drive(G:) accessible through Windows and has few folders.

  • I boot into Edubuntu and create a folder "LinTor" and download movies and few software from torrentz. Before I download, it showed 49GB free out of 62GB. After all the downloads it showed 31GB free out of 62GB.

  • Then I boot into Windows and I couldn't find this "LinTor" folder. I wondered that might be happening as I hibernate Edubuntu (using sudo pm-hibernate) and then boot into Windows. I then create another folder in the same drive(G:) with the name "001" to check if this was accessible from Edubuntu.

  • Now I reboot into Edubuntu to find that "LinTor" folder has disappeared and "001" folder wasn't showing up either. Surprisingly, the drive size still shows 31GB free out of 62GB but when I check it from Windows, it shows 49GB free of 62GB.

There is one thing I would like to mention. When I was trying to unmount the NTFS drive(G:) from Edubuntu before booting into Windows, it prompted me with this message:

Do you want to empty the trash before you unmount the drive? Once the trash is emptied the data is permanently deleted and cannot be recovered.

Please help me understand what could be the problem and how do I recover the missing folder?


Before you reformat the drive there is a lot you can do to recover your data or attempt a repair. One option is to install testdisk from a Terminal with

sudo apt-get install testdisk

With no other disk attached (including USB media) run it by typing

sudo testdisk

From the first screen choose the option to create a new log. From the next screen you should see just one disk - press enter to proceed. On the next screen, press enter to select an Intel partition table type. Choose analyze on the next screen. You may be asked it you want Testdisk to check for Windows created partitions - select yes if so.

At the next screen you should see a list of partitions - how many depends on how you installed Linux. You can choose each one in turn by highlighting the appropriate one and pressing "P" to list the files and from there you will get the option to press "C" to copy files and or directories. They will go, by default, to the directory you were in when you started Testdisk. Make sure you have enough space before you start (run du -h in another Terminal tab if you can't remember).

At this point you will have a copy of your data without changing anything on your disk - Testdisk can read partitons which Windows cannot see and Linux hasn't got mounted. If you start running anything that attempts to repair the partition table (for example) you risk losing access to the data. A Format is your data's tombstone for sure.