Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have run sudo qemu-img convert box-vmware-disk.vmdk -O raw /dev/sda1. No error was encountered all seems to have ended ok, but when I open the hard disk I cannot see any files.

I want to be able to see the files to assure me when i reboot the machine the system will pick the OS to boot from.

Do anyone know what I am doing wrong?

Also when I run: fdisk box-vmware-disk.vmdk -l

I end up with;

Disk box-vmware-disk.vmdk: 0 MB, 0 bytes 255 heads, 63 sectors/track, 0 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000

Disk box-vmware-disk.vmdk doesn't contain a valid partition table

Could this be the reason?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

IME qemu-img sometimes heavily corrupts images or simply fails at converting them. This may be version dependent, but I haven't had much success with it.

If your box-vmware-disk.vmdk file works inside a VM, I suggest that you boot some Linux inside the VM and use dd to copy its contents to your target (raw) virtual disk.

share|improve this answer
    
Is the MBR also copied accross using dd? –  Bitmap Jun 29 '11 at 13:01
    
@Bitmap Yes, the idea is to copy the whole disk. First you create the raw image file with its size equal to the .vmdk virtual drive's. You can find that out with "qemu-img info file.vmdk". Then you add that raw file to your VM. Once you boot Linux inside the VM you'll have your .vmdk image accessible on e.g., /dev/sda, and your added raw disk at e.g., /dev/sdb. Then you run "dd if=/dev/sda of=/dev/sdb bs=100000000 conv=noerror" and wait until it finishes (it can take a while). This copies the whole disk, MBR included. Then you shut the VM down, remove the .vmdk and boot your raw image instead. –  joechip Jun 29 '11 at 21:09

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.