Prerequisite: Ubuntu NON-EFI, ext4 partition
Convert vmdk to qico2
# qemu-img convert -f vmdk -O qcowq file.vmdk file.qcow2
Download ISO System Rescue CD from http://www.system-rescue-cd.org/ then treat as CD-ROM in the crashed VM, and then in the VM Console interface, boot from CD-ROM.
Run Test-disk
- Select the disk
- Select partition format: INTEL
- Analyze
- Deep search
- Select the righ partition
- Write
- Quit & reboot
Reload Using Ubuntu live CD
- fdisk recover extender partition (change type) from f to 5
- write, reboot
Rescue:
Install boot on /dev/sda, then reboot.
All done.
NOTES:
Mount to see files:
# qemu-nbd -c /dev/nbd0 file.qcow2
# partprobe /dev/nbd0
# mount /dev/nbd0 /mnt/nbd0