1

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.

1 Answer 1

1

The ddrescue tool is most often used to recover data from a failing medium, such as an optical disc that can't be read. It won't be of much use in your current situation.

What may help is PhotoRec. This tool can recover individual files when the filesystem is so badly damaged that it can't be read in its entirety. Of course, it won't be able to recover anything from the start of the disk; any files stored there are gone. Also, PhotoRec does a poor job recovering filenames (at least, it did the last time I checked); you'll end up with a mound of randomly-named files that you'll have to examine and sort by hand. If the disk was NTFS, I've heard that there are some similar Windows-centric tools that do a better job of recovering filenames from NTFS disks, but I don't know their names.

2
  • Yes, I don't worry much about this, since there was approx. 600Go of data on the disk and only 200Go I really have to get back. In the OP, I talked about the partition table, but it is in fact the whole MBR that has been overwritten. Is it possible to regenerate it ?
    – kinezana
    Commented Jun 26, 2017 at 13:24
  • If the entire filesystem (or at least its start point) is intact, TestDisk may be able to recover it. There are other tools that do similar things, but TestDisk is the only on with which I'm even remotely familiar. (Well, GParted is supposed to be able to do something similar, but AFAIK TestDisk is much better for this task.)
    – Rod Smith
    Commented Jun 26, 2017 at 13:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .