Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I tried to create a bootable USB using the command:

dd if=ubuntu.iso of=/dev/sdb

and I made a mistake. I typed sdb instead sdd. sdb being my second hard drive and sdd my USB drive.

I canceled the operation, but my hard drive is invisible now. Back in Windows 7, the Disk Management tool displays this hard drive with 3 sections, 2GB unallocated followed by 2MB healthy followed by 400 something GB unallocated.

Is there any way to recover my drive to the previous state after this mishap?

share|improve this question
add comment

1 Answer

Boot your computer with a LiveCD (such as Ubuntu or Knoppix) and run the gparted partition editor. It will show you all your existing devices and partitions. Resize/Recreate your partition on the sdb device using gparted tool and then format it with ntfs/ext4/etc.

If you want to recover your lost data, then you may skip resizing and instead try your luck with tools available with Knoppix or similar recovery distributions, but I don't think there is much hope there - dd command writes directly to the device stream.

If you want the disk partition to be visible in your windows-7 OS, then be sure to format with ntfs and not anything else.

share|improve this answer
1  
If I understand correctly, the dd command only wrote to the 2GB part of the disk that was supposed to be the Ubuntu image. The rest of the disk was not changed apart of the partition structure. In that case it should be possible to somehow read the data or maybe declare that the rest, 400 something GB part, is a partition without formatting it. I found testdisk and photorec and will give it a try. Do you maybe have some experience with this tools? –  user2201999 Mar 23 '13 at 13:36
    
Some months back, I had some success with recovering deleted files with Recuva. You can try that: piriform.com/recuva –  Prahlad Yeri Mar 23 '13 at 14:30
    
Some more tools are listed here: softpanorama.org/Tools/DD/recovery_of_lost_files_using_dd.shtml –  Prahlad Yeri Mar 23 '13 at 14:34
    
Cool, thanks for your help. Photorec found and could recover the files, but not the folder structure. After that I found another software that managed to sense that structure also and it is copying the data to an external drive at the moment. I was correct, the dd command only did some damage and I am able to recover all the data with an exception of 2GB of files. SOLVED Have a nice day, I know I will :) –  user2201999 Mar 25 '13 at 8:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.