Testdisk/Photorec – Recover Data from Unallocated Partition

data-recoveryhard drivepartitioningtestdiskwindows 7

Recently, I screwed up a partition resize on a Windows machine (an HP Pavallion dv7 3180-us to be precise) and found through gparted that my entire Windows partition is now unallocated space!

Since it's an unallocated partition, TestDisk won't add it to the table. However, I can see the files with Photorec, and it can recover them until I run out of space, but I can't figure out how to get them off the computer! I can't use the USB drive to transfer the files, it says it's "read only".

Any help would be appreciated, though I am not an expert Linux user. Thank you.

Edit
I can see the files through Photorec and create the recovery directory, but I don't know how to get them off the local /home/ directory

Best Answer

[I've posted this as an answer as its to long for a comment. It may also be particularly helpful to solving your problem]

Once you have backed up your data, you might be able to rebuild the partition and get it back (but it is high risk - so back up all data you can first). I might use sfdisk -d /dev/sda > filename to dump the current layout, then delete partitions 2 and 3. Using the values from sfdisk as a guide I would then create partition 2 covering exactly the empty space, then partitions 3 and 4 for sda2 and sda3 respectively. With some luck this should recreate the missing partition.

Alternatively, and more simply, just delete partitions 2 and 3 and create a new partition 2 covering the unallocated space and the space of partition 2 and 3. This will wipe out the Recovery partition and HP_TOOLS partition, but, I suspect, is likely to make your data partition available - albeit smaller then the actual space available to it as you have grown that partition.

Related Question