Recover HDD overridden with dd

If none of the more specific forums is the right place to ask

Recover HDD overridden with dd

Postby Pybash » 2018-02-21 13:54

Hi, I idiotically overrode my harddisk with dd
Code: Select all
dd if=mini.iso of=/dev/sdc bs=1M conv=sync

not interrupted or something, but
and choosed the wrong device(sdc instead of sdd).
I wanted to install a mini debian on my USB pen drive which is ~40 MB (compressed) and installed it on my 500GB USB-HDD.
I hope not everything is overridden.

So I probably wrote an
ext4 filesystem over a ntfs filesystem with 1 partition and a MS-Dos partition table

I guess.
(As these are the defaults)

Could I recover the data? And how exactly should I do this?

Im a little bit afraid, I could make it even more worse..
Last edited by Pybash on 2018-02-21 22:41, edited 3 times in total.
Pybash
 
Posts: 8
Joined: 2018-02-10 12:04

Re: Recover HDD overridden with dd

Postby GarryRicketson » 2018-02-21 21:14

Could I recover the data? And how exactly should I do this?

Well you could just use the backup you made before you started messing with things, restore from the backup.

I hope not everything is overridden.

So I probably wrote an ext4 filesystem over a ntfs filesystem with 1 partition and a MS-Dos partition table I guess.


You hope, and probably, and you guess, but you do not show us anything, (use code boxes),
How ,exactly did you wrote the 'dd' command, ? What did it say when it finished ? or if you aborted it, how long did you let it run ? No details = no answers.
Ever wonder why your post isn't getting answered?
The third most likely reason is that you have not provided enough information on your problem for someone to help you. Try adding as much detailed information on the problem as you can along with what machine you have and it's specifications as well as specifically stating which version of Debian you are using.

============================================
What does it show, on the drive you wrote too ? You can use 'du' and 'df' to get information,
Code: Select all
man du
or 'man df'.

Did you try this, ?
Recover HDD overwritten with dd command
User avatar
GarryRicketson
 
Posts: 5040
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Recover HDD overridden with dd

Postby Pybash » 2018-02-21 22:17

Well I have backup but not here at the moment,

and yes I havé read a lot things about recovering data
testdisk, photorec, ddrescue, scounge-ntfs


or with Windows
chkdsk, file inspector

and so on

And, well, there are at least 3 folders I would need to recover. which are all not bigger than 1Mb.
Pybash
 
Posts: 8
Joined: 2018-02-10 12:04

Re: Recover HDD overridden with dd

Postby Pybash » 2018-02-21 22:22

Code: Select all
df -hva /dev/sdc

/dev/sdc         34M   34M     0 100% /media/x/ISOIMAGE
 


And, ok making a backup or image of the disk, and hacking around until something works..

But maybe someone has experience how it would work?

Regards Pb
Pybash
 
Posts: 8
Joined: 2018-02-10 12:04

Re: Recover HDD overridden with dd

Postby steve_v » 2018-02-21 22:40

The first ~40MB of that disk is gone. Testdisk may be able to reconstruct the partition table, but the filesystem will almost certainly be corrupted.
Restore from backup, that's what they're for.

FWIW, I use the long /dev/disk/by-id/ paths when doing destructive things, it makes it a lot harder to nuke the wrong drive by mistake.
steve_v
 
Posts: 695
Joined: 2012-10-06 05:31
Location: New Zealand

Re: Recover HDD overridden with dd

Postby Pybash » 2018-02-21 22:54

Will have access to my backup in 10 days, but would like to get my working files to keep on working in between
Pybash
 
Posts: 8
Joined: 2018-02-10 12:04

Re: Recover HDD overridden with dd

Postby steve_v » 2018-02-22 06:55

Testdisk + luck. If those files were not at the start of the disk, you might recover them.
steve_v
 
Posts: 695
Joined: 2012-10-06 05:31
Location: New Zealand

Re: Recover HDD overridden with dd

Postby TonyT » 2018-02-22 21:33

I used testdisk many times to recover previous partitions and files. Try it.
TonyT
 
Posts: 545
Joined: 2006-09-04 11:57


Return to General Questions

Who is online

Users browsing this forum: No registered users and 1 guest

fashionable