I tried to create a bootable Ubuntu iso disk on a partition (sdc-2) of a usb stick, which had originally three partitions (sdc-1/2/3, of type ext3/fat32/ntfs). Following this thread, I ran:
sudo umount /dev/sdc2
sudo dd if=input.iso of=/dev/sdc
Now, I am not able to access the 3 partitions anymore. So first question, did I make a mistake? My feeling is that I should have used of=/dev/sdc2 instead, right?
Second question, how do I fix the problems:
The partitions are not shown. Running testdisk, I see one "iso" partition, but then, the "quick search" option shows the three underlying partition. How can I get the three partitions system back?
Previous partition sdc1 seems damaged. Testdisk detects it, but cannot list files. Did the dd operation irremediably damage it? Any change I could recover without using tools like photorecovery?
Thanks so much!!
If you cannot access your files, choose "deeper search" which may take some time, but might be able to locate the proper sectors to recover the partition. Ensure the letter to the right of the partition type is not "D", as this means it's set for deletion. It can be changed to other partition types L,E or P (Logical, Extended, or Primary). Only duplicates that don't work should be marked for deletion after you've found all your working partitions.
Once you've located the partitions, and are able to access the files, choose the [Write] option to save the partition tables.
For complete instructions and detailed recovery options, please see this step by step guide : http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step
You overwrote the beginning of drive
/dev/sdc
with a ISO file. From the last part of your question, it seems it is not what you wanted to do. Hence yes, it was a mistake. A pretty bad one.You should have used
/dev/sdc2
.As you have determined, you can easily restore the 2nd and the 3rd ones by using TestDisk.
TestDisk can create a partition table from the file systems it finds on your drive. The basic idea, however, is that you shoulde use TestDisk to copy the files on a different drive, then recreate your partitions from scratch.
You won't be able to do the same on the first one because it is damaged. You need to analyze
/dev/sdc1
with an advanced recovery tool like R-Linux.