S.G
Posts: 2
Joined: Sat Jul 28, 2012 9:20 am

HDD recovery after DD mistake

Sat Jul 28, 2012 9:51 am

Hi,
Am I the only one (who'll admit) to have done this? I could really use some advice to get the remains of my NTFS external drive back. . .

Used DD to write the Raspbian image to the start of my 2TB external HDD by mistake! Copied the DD command from a web page and it started writing before I changed the destination from /dev/sdd to sdi.

I hit the power button as soon as my jaw bounced back up from the floor, but 10 sec or so was enough.

sudo fdisk -l gives me this:
| Disk /dev/sde: 2000.4 GB, 2000398931968 bytes
| 255 heads, 63 sectors/track, 243201 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: 0x000714e9
|
| Device Boot Start End Blocks Id System
| /dev/sde1 1 8 57344 c W95 FAT32 (LBA)
| Partition 1 does not end on cylinder boundary.
| /dev/sde2 8 236 1832960 83 Linux
| Partition 2 does not end on cylinder boundary.
| steve@ubun3:~$

The drive is/was NTFS
testdisk doesn't find a backup boot sector.
I'm loath to use photorec as there was no structure last time (recovering broken linear RAID drive)
Win7 doesn't see the drive at all when I plug it into the USB3 or 2 ports
Google has _not_ been my friend in this case.

I'd really appreciate a few pointers here, so I can stop panicking about lost data and get back to playing with my Raspbmc and Raspbian distros.

Thanks in advance!
Steve

User avatar
jojopi
Posts: 3135
Joined: Tue Oct 11, 2011 8:38 pm

Re: HDD recovery after DD mistake

Sat Jul 28, 2012 10:40 am

I would want to first find out exactly how much data was overwritten, and overwrite that data again with zeros, to avoid any possibility of recovering the Pi filesystems instead of the one you want. If you have not attempted to mount or otherwise write to the drive since, then "sudo cmp IMAGE /dev/sdX" should tell you what byte the first difference is at.

(I do not know anything about NTFS disk formats, or the programs that can work with them.)

khh
Posts: 49
Joined: Thu Jul 26, 2012 12:16 am

Re: HDD recovery after DD mistake

Sat Jul 28, 2012 11:28 am

Try the trial version of this http://www.diskinternals.com/ntfs-recovery/ If it works, torrent or pay, depending. If you have to recover the files by themselves, rather than the partition, you should copy them to another harddrive.

S.G
Posts: 2
Joined: Sat Jul 28, 2012 9:20 am

Re: HDD recovery after DD mistake

Sun Jul 29, 2012 10:50 am

Thanks khh!!
- After 5h15m it's about 25% done and has found 44 folders and 78k files - I think it's the place I saved all the photorec recovered files from the crash of my linear raid a year ago (thousands of tiny .txt files) - we'll see. Shoulda used the USB3 port (!!!)
- I'll have to see what happens next when it's finished tomorrow, but I am very grateful for the recommendation.
- If I was my child I'd have barred myself from using the linux box for a month!!

Cheers, Steve
khh wrote:Try the trial version of this http://www.diskinternals.com/ntfs-recovery/ If it works, torrent or pay, depending. If you have to recover the files by themselves, rather than the partition, you should copy them to another harddrive.

Return to “Troubleshooting”