You are not logged in.

#1 2012-12-14 09:03:26

firestones
Member
Registered: 2012-11-14
Posts: 9

[Solved]USB disk written by dd, recovery possible?

I just did a stuipid thing. I was writing an arch iso to a USB drive using dd when instead of typing /dev/sdc I typed /dev/sdb and wrote the 417mb image to my 500gb External Hardrive full of files. Is there ANY or part possibility of recovering the file? Please help!!!!!

My command is

sudo dd bs=4M if=./archlinux-2012.11.01-dual.iso of=/dev/sdb

Thanks a lot!!


Continue: Thanks for your help!

BTW, my 500gb External Hardrive is NTFS filesystem before dd. After dd, the later part (after 417M) is unknown. Do I need to convert the part into NTFS first? And then using testdisk and PhotoRec to recover the data? If yes, how do I convert the harddisk into NTFS without destorying data? Like #mkfs.ntfs /dev/sdb1. I am afraid that the command can destory previous data. Thanks!

Solved:
Photorec can recovery most previous data! Photorec is a good tool!

Thank you!

Last edited by firestones (2012-12-21 07:17:10)

Offline

#2 2012-12-14 11:44:33

aesiris
Member
Registered: 2012-02-25
Posts: 97

Re: [Solved]USB disk written by dd, recovery possible?

You overwrote only the first 400 mb for the drive, so IMHO you have good probablity of recovering (almost) everything.

The first thing you have to do is to make a full image of the drive, then you can attempt recovering from there without doing further damage.

Have you already read the wiki https://wiki.archlinux.org/index.php/File_Recovery?
If you need specific help you have to tell how the drive was partioned and the filesystems.

PS. don't crosspost

Offline

#3 2012-12-14 16:10:12

chris_l
Member
Registered: 2010-12-01
Posts: 390

Re: [Solved]USB disk written by dd, recovery possible?

external drive... with a FAT partition?
If that's the case, then try to use photorec on it. Ignore the name, is not only for photos recovery, is for FAT files recovery. (SD cards for cameras normally use FAT)

Photorec is safe; it does not alter your partition, it tries to recover files (on read-only) and it save them on a different drive.

You can try to recover your FAT with testdisk... but since you overwrote about 400Mb, I don't think you are going to be able.


"open source is about choice"
No.
Open source is about opening the source code complying with this conditions, period. The ability to choose among several packages is just a nice side effect.

Offline

#4 2012-12-14 17:26:38

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: [Solved]USB disk written by dd, recovery possible?

Arch Linux's repo contains a program to recover partitions that were partly overwritten by dd.
pacman -Si ddrescue
Making a full image of the drive before is the best recommendation you can be given.

Offline

#5 2012-12-18 00:31:37

firestones
Member
Registered: 2012-11-14
Posts: 9

Re: [Solved]USB disk written by dd, recovery possible?

My 500gb External Hardrive is NTFS filesystem before dd. After dd, the later part (after 417M) is unknown.

How do I convert the part into NTFS?

Do I need to use partion software to format the harddisk by NTFS first, and then recover data? Like #mkfs.ntfs /dev/sdb1

I am afraid that the commandwould destory the previous data.

Thanks!

Last edited by firestones (2012-12-18 01:25:14)

Offline

#6 2012-12-18 03:57:18

chris_l
Member
Registered: 2010-12-01
Posts: 390

Re: [Solved]USB disk written by dd, recovery possible?

Like teateawhy said, do a mirror of your hard disk on its actual state. That way, if your mkfs.ntfs ruins it, you can undo it


"open source is about choice"
No.
Open source is about opening the source code complying with this conditions, period. The ability to choose among several packages is just a nice side effect.

Offline

Board footer

Powered by FluxBB