DD broke my whole partition – boot failed: not a bootable disk . Any way to recover it?

viniciusmunich – AssabetTech asked:

Im kind of freaking out here, if anyone can help me please help me…

This happened to a Windows 2012 KVM virtual machine. I had a very important database running in it, if I could only recover that DB it would be great.

The VM was struggling because it was running out of resources so I decided to transfer it to another node. I used this command to make a backup:

dd if=/var/lib/vz/images/402/vm-402-disk-1.raw | gzip | dd of=/var/lib/vz/images/402/vm-402-disk-1.gz bs=4096

I forgot to shutdown the VM before I executed the command above, so I I tried to stop the DD process, but it was refusing to stop so I killed the process (I know… :/ ). Then I decided to forget about DD and just use the Proxmox’s backup tool. Since this backup tool can “stop” the VM before making the backup, I didn’t shut the VM down, and asked the backup tool to do it for me.

The backup tool wasnt able to shutdown the VM by itself so the it did not proceeded with the backup.

Then I accessed that VM remotely using VNC and the VM was trying to boot but showing this message: boot failed: not a bootable disk after failed backup

I restarted the VM several times, but it still shows the same message.

I tried to mount the .qcow2 image but I failed. I converted the .qcow2 to .raw, downloaded ntfs-3g so debian could recognize the ntfs partitions and tried to mount the .raw image and it failed too. I tried running both Windows 2012 and Windows 7 isos and tried to repair the Windows installation but both failed too.

Is there any way I could at least access the files inside the image??? I had a firebird database running in it, I just need to recover a 3gb .FDB file so I can restore it in a new VM.

I loaded the Windows 7 ISO and it shows that my drive has 120gb of unallocated space.. does it mean that I lost everything ????????

Linux disk utility shows this: http://d.pr/i/Pu0Y

Is there anything I can do to try to recover the files??

No backup was done since I stopped the DD process, and it seems like I was left with a broken image.. I tried to run a few data recovery programs but none of them worked.. They can find a few files but no more than 8gb, which is usuless to me since it’s mostly Windows files..

Please help!


My answer:

I suspect you overwrote your VM image at some point while trying to “recover”. Where isn’t clear, but that’s the most likely way you wound up with a “blank” disk image.

At this point I would run testdisk, followed by photorec. If you get as far as photorec, you will need a second disk to save recovered files onto.

And, in future, I would keep proper backups.

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.