You are not logged in.

#1 2015-08-01 04:47:31

labelle
Member
Registered: 2015-08-01
Posts: 2

Recover old partition from dd

Hi! I am not sure if this's in the right section of the forum. I couldn't find my issues discussed as specific as it is in my case.

I used sudo dd in the wrong partition. Instead of sdb3, I typed sda3. And twice! Hehehe.

That never happened to me before, and it's been years already using shell. So well, this is what I did, accidently:

sudo dd if=linux.iso of=/dev/sda3 bs=4M count=0

(by mistake I've typed count=0, still don't know why, I was very sleepy at the time)
noticing the mistake, I up'd it, and deleted the count=0 part?

sudo dd if=linux.iso of=/dev/sda3 bs=4M

Then I noticed the biggest screw up I ever did...

Well, I wonder if somebody would like to go on a journey with me to find out how to recover an old partition in this specific case tongue
Because the linux.iso is only 256MB long, so I guess it didn't screw up phisically that much (out of 60GB). From what I understand (and with a little help from my friends), this was written linear phisically, but shouldn't be linear virtually, so random 256MB of data corrupted random files accros the virtual data in the old partition as was written before the dd. I don't care, I just would like to recover as much as I can.

The partition is hfsplus from the Mac OSX dual-boot, it's non-journaled already. Can't find out the filesystem it is now after the dd. It has been used for some years now, so it should be failry defragmented. After the dd, the partition is still 60GB big.

Any additional information I need to provide, I'll happily provide. Links would be great! Help greatly appreciated! Thank you all in advance.

Offline

#2 2015-08-01 05:28:51

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Recover old partition from dd


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2015-08-01 15:22:25

labelle
Member
Registered: 2015-08-01
Posts: 2

Re: Recover old partition from dd

Oh, I thought it was already in the Newbie-Corner, Sorry. Thank you for the link.

So I've read the extundelete section, and it says:

It can recover all the recently deleted files from a partition and/or a specific file(s) given by relative path or inode information.

I am not sure what "recently" really means, since it's been a day, and I performed nothing else in the partition, other than leaving it mounted.

This is what it prompts me:

extundelete: Bad magic number in super-block when trying to open filesystem /dev/sda3

I can't get past this, even using --superblock (default for no ptions given) and --before 1435665720 (which is Jun 30). I should know what the blocksize was before the dd.

It might be corrupted through-out? Any ideas?

The manual for extundelete is here: http://extundelete.sourceforge.net/options.html (it's the same version of my extundelete)

Offline

#4 2015-08-01 18:48:56

nstgc
Member
Registered: 2014-03-17
Posts: 393

Re: Recover old partition from dd

I just came to say I feel your pain. I did the exact same thing last March. Instead of spending Spring Break playing, with Arch, I spent it recovering data with PhotoRec and Testdisk. It won't necessarily recover the partition, but it should get most of your files off.

I wish you the best of luck.

Offline

Board footer

Powered by FluxBB