Skip to contentSkip to conversation

qemu-img: error while reading

Qemu-devel Torstenl 1 participant 1 message Sep 16, 2009

lore
Share & tools
lore

Torstenl

author
#0 lore raw

Hallo ,

I try to convert image vmdk 2 raw.
Is there a possibility to convert this image with qemu-img? (without vmware-vdiskmanager)

details:

- convert vmdk-image 2 qemu.raw

## var
mount -o loop OSR507V_vmware_1.0.0Di.iso /mnt/tmp vmdk=/mnt/tmp/osr507v_VA/osr507v_vmware_1.0.0Di.vmdk raw=osr5.raw

- test 1

 $ qemu-img convert -f vmdk $vmdk -O raw $raw
 qemu-img: error while reading

I found some refer to qemu-img in CHANGELOG [1],
thus i test a new version:

- test 5 qemu-0.11

 $ time /tmp/qemu-0.11.0-rc2/qemu-img convert  $vmdk -O raw $raw
 qemu-img: error while reading
 real    0m0.991s
 user    0m0.050s
 sys     0m0.000s

- file was created, but included "0" only and alloc 0bytes:

  $ ls -l $raw
  -rw-r--r-- 1 molle molle 8589934592 Sep 16 20:14 osr5.raw
  $ du -sk $raw
  0       osr5.raw

- strace say:
open("/mnt/tmp/osr507v_VA/osr507v_vmware_1.0.0Di.vmdk",
O_RDONLY|O_LARGEFILE)
= 5
_llseek(5, 0, [725941248], SEEK_END) = 0
_llseek(5, 0, [0], SEEK_SET) = 0
...
read(5, "# Disk DescriptorFile\nversion=1\n"..., 10240) = 10240
_llseek(5, 0, [0], SEEK_SET) = 0
read(5, "KDMV\3\0\0\0\1\0\3\0\0\0\0\1\0\0\0\0\200\0\0\0\0\0\0\0"...,
1024) = 1024
...
open("osr5.raw", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644) = 6

  ftruncate64(6, 8589934592)              = 0
  close(6)                                = 0
  open("osr5.raw", O_RDWR|O_LARGEFILE)    = 6
  _llseek(6, 0, [8589934592], SEEK_END)   = 0

_llseek(5, 741327017472, 0xbfde5d70, SEEK_SET) = -1 EINVAL (Invalid
argument)
_llseek(5, 741327017472, 0xbfde5d70, SEEK_SET) = -1 EINVAL (Invalid
argument)
...100x...
_llseek(5, 1536, [1536], SEEK_SET) = 0
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,
2048) = 2048
_llseek(5, 100663808, [100663808], SEEK_SET) = 0
read(5, "\23\210\361R]?\\{s4\377\234\r\1\267:\356Q\265!\234\337"..., 2048)
= 2048
_llseek(5, 712479090176, 0xbfde5dd0, SEEK_SET) = -1 EINVAL
(Invalidargument)
write(2, "qemu-img: ", 10qemu-img: ) = 10
write(2, "error while reading", 19error while reading) = 19

- Image-Info

 $ hexdump -C $vmdk -n 16 | more
 00000000  4b 44 4d 56 03 00 00 00  01 00 03 00 00 00 00 01 
|KDMV............|
 00000010
 $ grep -i version osr507v_vmware_1.0.0Di.ovf
 <?xml version="1.0" encoding="UTF-8"?>
 <ovf:Envelope  xmlns:ovf="http://www.vmware.com/schema/ovf/1/envelope"
xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"
xmlns:vmwovf="http://www.vmware.com/schema/ovf"
xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ovf:version="0.9">
       <Version>1.0.0Di</Version>

[1] http://www.qemu.org/

Any hints?

regards Torsten,