Monday, December 8, 2014

linux - Recovering data on drive after dd'ing an iso on it

I have a 1 To hard drive which was formatted in ext4 or NTFS (not sure..but I'd say ext4), containing only one partition.
I mistakenly copied three iso in a row (I was testing several Linux live USB) to /dev/sdb (this hard drive) instead of /dev/sdc. The biggest one was 244 Mb.


My understanding is that I have only overwrite the first 244 Mb of the hard drive, erasing the partition table and some data.


A colleague advised me to zero the hard drive for size of the iso and then use ddrescue :



sudo dd if=/dev/zero of=/dev/sdb bs=1M count=250
sudo ddrescue -f /dev/sdb /dev/sdc suivi.log



ddrescue is about to end but I'm pretty sure it will just have mirrored the disk along with it's missing partition table.


My question is : Is re-creating the partition table all I need to do ? If so how do I do that ?


To me, re-creating a partition table is the same as 'formatting' and it can only be done by deleting all the data. I hope I'm wrong.


thank you so much.

No comments:

Post a Comment