Accidentally DD’d first few megs of external hdd

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

acquacow

Well-Known Member
Feb 15, 2017
787
439
63
42
Dude, always, ALWAYS do a read from the device so that you can see and verify exactly which device is active before you ever put that of=/dev/sdx in there =)

You can probably still scrape the drive and get some data back, but anything on the front of that drive is toast.
 

gigatexal

I'm here to learn
Nov 25, 2012
2,913
607
113
Portland, Oregon
alexandarnarayan.com
Dude, always, ALWAYS do a read from the device so that you can see and verify exactly which device is active before you ever put that of=/dev/sdx in there =)

You can probably still scrape the drive and get some data back, but anything on the front of that drive is toast.
I know I’ve been using Linux for years and I screwed up here. I’ll try the suggested methods of recovery.
 

EffrafaxOfWug

Radioactive Member
Feb 12, 2015
1,394
511
113
I've not tried it with HFS filesystems, but when I accidentally did the same thing and dd'd the first few MBs of a drive once I successfully used testdisk to scan and repair it with minimal loss of data (couple of small files were hosed IIRC, the rest was fine).

Naturally any attempts to repair the partition table can be potentially destructive so generally it's a good idea to create an image of the disc in question and perform the recovery operations on that if possible. If you can handle the time taken, disc space used, and the level of irony, dd the drive into an image file and point yer tools at that instead of the actual disc so you can test if it works first.
 
  • Like
Reactions: gigatexal