how to recover after dd if=/dev/zero of=/dev/sdb

How to use TestDisk to recover lost partition
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
Locked
Message
Author
mail4me9999
Posts: 1
Joined: 20 Feb 2013, 18:17

how to recover after dd if=/dev/zero of=/dev/sdb

#1 Post by mail4me9999 »

I have done a stupid thing

dd bs=2048 if=/dev/zero of=/dev/sdb count=1024

Now, the drive had only one partition for the whole drive and it was formated as ext4

While the system was still running I did this:

hdparm -g /dev/sdb
/dev/sdb:
geometry = 243200/255/63, sectors = 3907012784, start = 0
-----------
hdparm -g /dev/sdb1
/dev/sdb1:
geometry = 243199/255/63, sectors = 3907007937, start = 63

when I run testdisk the regular search does not find anything, but the deep search shows the partition almost instantaneouly .
I did not wait till the end of the deep search and stopped it. (it will be several hours before it will finish)

I am asking if there is hope to recover the partition with data on it.
Since some of the information is available about the partition maybe something can be done to recover it

Thank you very much for your help

Lazar

a477932
Posts: 1
Joined: 09 Sep 2013, 22:22

Re: how to recover after dd if=/dev/zero of=/dev/sdb

#2 Post by a477932 »

Hi,

I did the same mistake as you...

Did you manage to recover your data?

Thanks,

User avatar
cgrenier
Site Admin
Posts: 5432
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France
Contact:

Re: how to recover after dd if=/dev/zero of=/dev/sdb

#3 Post by cgrenier »

The dd command hasn't overwritten the whole disk "only" the beginning. It's why TestDisk can locate NTFS backup boot sector or ext2/3/4 backup superblock after the zone that have been overwritten.
As written previously, use TestDisk, Analyse, Quick Search, Deeper Search to locate your partitions.

Locked