I wanted to copy a image to one of my SD cards using Win32DiskImager. But I clicked too fast and it written to one of my external harddrives instead of my SD drive, so I disconnected as fast I could do..

But it was too late, the ext HDD has overwritten my NTFS partition, with the partition what was in the image (4gb +/-, actually the wheezy raspbian image). There are two partitions on the drive it self, a NTFS one from 0-1.3TB and FAT32 at the end of the drive.

Is there a way to recover my partitions? I already made a DD backup from the current state just to be sure if I could get it back.




There are really two types of recovery involved:

  • Partition table -- This data structure defines where your partitions reside on the disk (their start and end points, or start point and length, plus other associated metadata such as type codes). Your action overwrote the partition table at the start of the disk. If your disk uses the older Master Boot Record (MBR) partitioning system, then the partition table is gone. If, OTOH, your disk uses the new GUID Partition Table (GPT) system, then your backup GPT data are almost certainly intact and can be used to recover your disk's partition table. See this page for information on repairing GPT disks. Most (but not all) Windows 7 installations use MBR, whereas the vast majority of factory-delivered Windows 8 machines use GPT (at least originally; a re-installation can change that).
  • Filesystem -- Whether your disk originally used MBR or GPT, chances are at least part of the first filesystem on your disk was destroyed. If you can recover the partition table, though, it's conceivable that enough survived to recover the rest using fairly conventional tools such as CHKDSK or its GUI equivalents. I'm not an expert on NTFS data recovery, though, so others might be better able to help you with that. It's likely that at least some files will be lost, and if you booted from the disk, you may need to completely re-install Windows. In a worst-case scenario, you might need to use a file-level recovery tool to pull files off the disk one at a time. PhotoRec is one tool that can help with that, although it's cross-platform and I've heard that there are Windows-specific tools that may work better with NTFS. I'm afraid I don't have pointers to them, though.

In some cases, tools like TestDisk can locate filesystems even if the partition table has been completely lost, enabling recovery of the partition table. This is most likely to work if your disk had multiple partitions and your accident did not intrude into the start point(s) of some of your partitions. For instance, if you overwrote the first partition but left the second intact, TestDisk might help you recover the second partition, even if your disk used MBR and you lost your original MBR data.

I usually include advice to make a low-level backup with dd in a case like this, but I'll keep that short this time, since you say you've already done it. (I want to get in some mention of this for the benefit of other readers, though.)

As you tackle this problem, be patient. Thoroughly read documentation and begin writing to the disk only once you've understood something. You don't want to read something like "type d," then type d in response, only to continue reading "only if you want to lose all your data." ;-)

Good luck with your recovery!

| improve this answer | |

I know this is an older topic but I made exactly the same thing as Dnstje did, and maybe this answer could help other people.

First of all, thanks Rod Smith for the excellent explanation about this issue. I did use your references to solve my problem.

After a long research, I found a software called Active@ Partition Recovery, which is not free but it worth the price. I bought the personal license for $39.90.

At the first time, it found the lost partition with Quickscan but it couldn't be recovered because the Win32DiskImager has created 2 linux partitions: /boot and /. So it showed me a warning telling me it cannot override the current partitions.

I closed the APR and opened the Windows Disk Manager (Control Panel -> Admin Tools -> Computer Management -> Disk Management) to delete the booth partitions.

Then, opened APR again, did a SuperScan on entire disk, and it did found my "lost" partition again. I clicked on the partition with the right button and clicked Recover. Now the APR show that is possible to recover due to disk had no partition (I leave all default option and clicked on recover button on first tab). But the task was not finished yet.

The drive letter appears on Windows but Windows cannot read information due to corrupted files, so I opened a command prompt as administrator and run chkdsk [drive_leter] /f to fix the disk.

After chkdsk terminates it tasks, I was able to access my files, but all the files at the beggining of the disk was lost (as expect, because Win32DiskImager wrote data on it). It was about 250MB lost, and it's nothing compare to entire disk.

So, I hope this post can help other people wich is facing a similar problema. Sorry for any english mistakes.

Bests, Fabricio.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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