You are not logged in.

#1 2010-08-11 14:14:37

atriya
Member
From: Kolkata, India
Registered: 2008-09-09
Posts: 31

Disaster! I used 'dd' on the wrong drive! :(

I was using 'dd' to write the arch installation image to a usb drive, but I used /dev/sdc instead of /dev/sdb by mistake. sdc was a connected external hard disk, which got totally overwritten! sad sad sad I lost gigs of important stuff! Does anyone know of any way to undo this? Any help will be deeply appreciated. Thanks.

Offline

#2 2010-08-11 14:16:22

ablepharus
Member
From: Berlin
Registered: 2010-05-23
Posts: 129

Re: Disaster! I used 'dd' on the wrong drive! :(

I guess, there is no way to do so. You'd need a undo button for you life wink

Offline

#3 2010-08-11 14:21:42

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Disaster! I used 'dd' on the wrong drive! :(

http://www.gnu.org/software/ddrescue/ddrescue.html
Google for "disc recovery" or "file recovery".

Offline

#4 2010-08-11 14:44:07

Ashren
Member
From: Denmark
Registered: 2007-06-13
Posts: 1,229
Website

Re: Disaster! I used 'dd' on the wrong drive! :(

dd is an abbreviation for "Destroy Disk".

I don't think you'll get that data back.

Sorry.

Offline

#5 2010-08-11 14:52:21

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,549

Re: Disaster! I used 'dd' on the wrong drive! :(

I very, very highly doubt you will be able to get back the first 700MiB (or whatever the size of the image you dd'ed) of that drive.

It MAY be possible to get back the rest.  I wish you the best of luck in doing so!

Offline

#6 2010-08-11 14:59:44

KlavKalashj
Member
Registered: 2008-10-09
Posts: 376

Re: Disaster! I used 'dd' on the wrong drive! :(

I did the same thing two years ago, on a 500gb drive filled with music/movies and irreplaceable photos. I noticed it after a only a few seconds, still I got nothing back.

Offline

#7 2010-08-11 15:02:42

atriya
Member
From: Kolkata, India
Registered: 2008-09-09
Posts: 31

Re: Disaster! I used 'dd' on the wrong drive! :(

Well, ddrescue isn't working. It's just recovering the contents of the arch image I (mistakenly) wrote. That's only 103 MB. I don't care if I lose the first 103 MB! I had around 140 gigs on that drive. sad

Offline

#8 2010-08-11 15:26:24

tom5760
Member
From: Philadelphia, PA, USA
Registered: 2006-02-05
Posts: 283
Website

Re: Disaster! I used 'dd' on the wrong drive! :(

sad  Like others said, it may be possible to get back some stuff past the data that you wrote, but it will probably be difficult.  Hopefully, you'll keep backups of important stuff from now on!

Offline

#9 2010-08-11 15:35:49

Andy Mack
Member
Registered: 2008-06-16
Posts: 133

Re: Disaster! I used 'dd' on the wrong drive! :(

I feel for you mate, horrible thing to happen. I lost 60gig of music doing something similar to you, I could have cried!

I've used recuva before and that worked great although it is windows only, wont get back what you overwrit? with arch image but possible the rest.

It gets easier smile

Offline

#10 2010-08-11 16:11:28

hiciu
Member
Registered: 2010-08-11
Posts: 84

Re: Disaster! I used 'dd' on the wrong drive! :(

atriya wrote:

Well, ddrescue isn't working. It's just recovering the contents of the arch image I (mistakenly) wrote. That's only 103 MB. I don't care if I lose the first 103 MB! I had around 140 gigs on that drive. sad

ddrescue won't help, it's just tweaked dd used when you have damaged cd drive, or your dvd disk is scratched, etc.
Did you had any partitions on that drive? If yes, then only first one (if it was bigger than 103MB) is damaged.
Anyway, try with testdisk, i'm sure you will be able to recover some stuff from that drive (i've successful recovered files from formatted ntfs partition using it). If you have enought space on other drives do dd if=/dev/damaged of=backup.img and use testdisk on backup.img. Don't write anything on /dev/damaged.

extra/testdisk 6.11.3-3 [2,38 MB]
    Checks and undeletes partitions + PhotoRec, signature based recovery tool

Last edited by hiciu (2010-08-11 16:13:18)

Offline

#11 2010-08-11 16:24:22

Bregol
Member
Registered: 2008-08-15
Posts: 175

Re: Disaster! I used 'dd' on the wrong drive! :(

ddrescue will just clone the drive.  It is useful when doing computer forensics so that you do your work on a image of the drive rather than the drive itself.

Anything overwritten will not really be recoverable.  But like has been said, that will only be a jumpdrive sized amount of your data.  The important thing is to not keep using that partition because if you keep writing to that partition, you will keep writing over data you probably want to try to save.  Which is one reason forensics is usually done on an image rather than the drive itself.  That way there is always a clean copy to work on in case it gets written to or something bad happens.

That said, testdisk's photorec will probably allow you to scrape some of the data out.  I believe it is classified as a data carver.  I have used it before to recover stuff deleted from jump drives accidentally.  It will search through the partition and look for headers of files and pull out the files.  I dont think it will preserve the file names and folders and so forth, so you will have to go through what it pulls and figure out what is what.

Another tool I played with once is SleuthKit/Autopsy.  I know some livecds come with that on it, such as Backtrack.  Its a little harder to use than photorec but capable of a little more.


Nai haryuvalyë melwa rë

Offline

#12 2010-08-11 16:24:50

atriya
Member
From: Kolkata, India
Registered: 2008-09-09
Posts: 31

Re: Disaster! I used 'dd' on the wrong drive! :(

testdisk is analyzing the drive as I type. Keeping my fingers crossed. sad

Offline

#13 2010-08-11 17:15:37

atriya
Member
From: Kolkata, India
Registered: 2008-09-09
Posts: 31

Re: Disaster! I used 'dd' on the wrong drive! :(

So... the disk had two partitions on it, and (as hicui noted) only the first one was damaged. The good news is that I was able to undelete the entire second partition with testdisk. No damage was done to it whatsoever. testdisk preserved my file names, directory structure - worked like magic! The bad news is that all the important data was on the first partition. Looking into it now.

Last edited by atriya (2010-08-11 17:17:26)

Offline

#14 2010-08-11 18:38:58

atriya
Member
From: Kolkata, India
Registered: 2008-09-09
Posts: 31

Re: Disaster! I used 'dd' on the wrong drive! :(

MAGIC! I did the deep search for lost partitions with testdisk and it detected my damaged first partition from a 'backup boot sector' (or so it said), and recovered it! Of course, the parts that were overwritten by the 103MB will be damaged, but now I can browse the files, and most of them are fine! Now, the disk was pretty fragmented, so many files could have corrupted bits. But still, I never expected that I would recover so much! Yay!

Offline

#15 2010-08-11 19:51:12

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,804

Re: Disaster! I used 'dd' on the wrong drive! :(

Congratulations :-)

Back it up -- now!

Remember, it isn't really backed up unless there are 2 copies, one of which is off-site.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#16 2010-08-11 20:29:59

Acecero
Member
Registered: 2008-06-21
Posts: 1,373

Re: Disaster! I used 'dd' on the wrong drive! :(

Ashren wrote:

dd is an abbreviation for "Destroy Disk".

I don't think you'll get that data back.

Sorry.

According to Wikipedia, dd is an abbreviation for "Data Description."

Though it has been jokingly called "Disk Destroyer" because of what happens when you use "dd on the wrong drive."

Offline

#17 2010-08-18 23:17:51

LookTJ
Member
From: Clovis, California
Registered: 2009-08-20
Posts: 29
Website

Re: Disaster! I used 'dd' on the wrong drive! :(

What about testdisk? It worked well for its purpose when I used it.

Offline

#18 2010-08-19 00:24:13

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: Disaster! I used 'dd' on the wrong drive! :(

LookTJ wrote:

What about testdisk? It worked well for its purpose when I used it.

I think if you read the thread you will notice that the op did use testdisk

https://bbs.archlinux.org/viewtopic.php … 82#p807382

also atriya, please mark your thread as solved so it may be of use to others as well.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

Board footer

Powered by FluxBB