Δ All posts
Obligatory 'lost hard drive' recovery post
9 May 2007
As I type this the file from an old, formatted partition are copying over to my good drive. It took several days but I have finally recovered my old data intact using TestDisk. Originally I used PhotoRec, however, unlike this guy I wasn't content to have PhotoRec go in and recover the files and spit them out to random directories, random names. I wanted my files in their original directory structure.
But the data on the drive was too important to simply use TestDisk on it directly, so what I did was I used the command 'dd if=/dev/hda1 of=80GB.iso'. See for a better DD option. I wanted an ISO of the whole disk and not simply the partition because the lost partitions I wanted to recover might not be in the original disk. I also preferred this because I could create an ISO and then change the partition table on that--much less risky than working with the actual disk.This was much more difficult to do, however.
Once I had an image I used TestDisk on it only to discover it wouldn't find the same lost partitions! I was confounded, and I couldn't find a helpful TestDisk forum so I took it right to the Dev list where the author himself replied that the Geometry needed to be changed. Then it hit me: TestDisk complained about the geometry on the physical disk but not on the image. Changing the Geometry to 16 worked fine. (This may not be necessary, depending on your problem).
Now to mount the image. It wasn't as simple as 'mount -o loop 80GB.iso /dev/mnt'. I kept getting errors complaining about the 'wrong fs type.' Several suggestions said to add '-t 9660' but some very insightful minds got me on the right track. Then This page proved instrumental and was, in the end, the savior of the day. I found this early in my search and, like a bonehead, ignored it. It had the answer all along.
Was my trouble worth it? Yes. For fun I used PhotoRec on the physical drive only to find all of my music, videos, and pictures terribly corrupted. Granted, there are lots of corrupted files using the TestDisk method, but not nearly as many (some input/output errors on weird config files I never heard of and don't care about). I was pessimistic about how much could be restored but I don't notice anything missing!
