Discussion:
[Qemu-discuss] Error 'invalid argument' during convert
Prakash P
2012-05-18 05:48:59 UTC
Permalink
Hi,

I'm trying to convert a .vmdk to raw file. But it's throwing an error.

qemu-img convert -O raw CentOS.vmdk CentOS.raw
qemu-img: error while reading sector 131072: Invalid argument`

But it created the output file in .raw format, why this error is been
reported? How to get rid of this?

-rw-r--r--. 1 root root 10737418240 May 17 19:09 CentOS.raw
-rw-r--r--. 1 root root 2585558528 May 17 13:43 CentOS.vmdk

Thanks,
Prakash
Anil Nair
2012-05-18 06:02:24 UTC
Permalink
Hi All,
    qemu-img convert -O raw CentOS.vmdk CentOS.raw
    qemu-img: error while reading sector 131072: Invalid argument`
I am guessing that the Image you are using maybe corrupt. Did you try
any other type conversions such as .qcow?
I guess the command goes like this "qemu-img convert CentOS.vmdk -O
raw CentOS-copy.img" .Try this.
Thanks,
Prakash
--
Regards,
Anil Nair
Anil Nair
2012-05-18 06:06:23 UTC
Permalink
-
Hi Prakash,

Try converting it to .qcow iamge and try checking the qcow image for
consistency. using qemu-img check command.



Regards,
Anil Nair

end
Prakash P
2012-05-19 13:10:16 UTC
Permalink
Hi Anil,

I tried to convert the vmdk to qcow & even during that it's throwing the
same error. I even used different vmdk & tried converting it to qcow/raw
and still hit the same error.

Thanks,
Prakash
Post by Anil Nair
-
Hi Prakash,
Try converting it to .qcow iamge and try checking the qcow image for
consistency. using qemu-img check command.
Regards,
Anil Nair
end
Mike Lovell
2012-05-18 16:26:25 UTC
Permalink
Post by Prakash P
I'm trying to convert a .vmdk to raw file. But it's throwing an error.
qemu-img convert -O raw CentOS.vmdk CentOS.raw
qemu-img: error while reading sector 131072: Invalid argument`
But it created the output file in .raw format, why this error is been
reported? How to get rid of this?
-rw-r--r--. 1 root root 10737418240 May 17 19:09 CentOS.raw
-rw-r--r--. 1 root root 2585558528 May 17 13:43 CentOS.vmdk
where did the vmdk come from? a co-worker of mine recently had to
convert a vmdk that came from an esxi 5 server and attempted to use
qemu-img to convert. no matter what he tried qemu-img kept throwing
errors. i don't recall what the exact error he was getting though. in
his case, it seemed to be that the vmdk he was converting had extra
features enabled that qemu-img couldn't handle. he ended up converting
it to a "more normal" vmdk using vmware-vdisk-manager and then using
qemu-img on the output from that. i don't know this is whats happening
in your case but reading your email made me think of the problems my
co-worker had.

mike
Prakash P
2012-05-19 16:11:39 UTC
Permalink
Hi Mike,

Yes I have also created the vmdk from an ESX 5. Thanks for this pointer.

Can you please let me know what you mean by "more normal" vmdk?? Is there
any specific option in vmware-vdiskmanager needs to be used? Or just
renaming the vmdk file using -n option will do the necessary conversion?

Thanks,
Prakash


Date: Fri, 18 May 2012 10:26:25 -0600
From: Mike Lovell <***@dev-zero.net>
To: qemu-***@nongnu.org
Subject: Re: [Qemu-discuss] Error 'invalid argument' during convert
Message-ID: <***@dev-zero.net
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
Post by Prakash P
I'm trying to convert a .vmdk to raw file. But it's throwing an error.
qemu-img convert -O raw CentOS.vmdk CentOS.raw
qemu-img: error while reading sector 131072: Invalid argument`
But it created the output file in .raw format, why this error is been
reported? How to get rid of this?
-rw-r--r--. 1 root root 10737418240 May 17 19:09 CentOS.raw
-rw-r--r--. 1 root root 2585558528 May 17 13:43 CentOS.vmdk
where did the vmdk come from? a co-worker of mine recently had to
convert a vmdk that came from an esxi 5 server and attempted to use
qemu-img to convert. no matter what he tried qemu-img kept throwing
errors. i don't recall what the exact error he was getting though. in
his case, it seemed to be that the vmdk he was converting had extra
features enabled that qemu-img couldn't handle. he ended up converting
it to a "more normal" vmdk using vmware-vdisk-manager and then using
qemu-img on the output from that. i don't know this is whats happening
in your case but reading your email made me think of the problems my
co-worker had.

mike
Post by Prakash P
Hi,
I'm trying to convert a .vmdk to raw file. But it's throwing an error.
qemu-img convert -O raw CentOS.vmdk CentOS.raw
qemu-img: error while reading sector 131072: Invalid argument`
But it created the output file in .raw format, why this error is been
reported? How to get rid of this?
-rw-r--r--. 1 root root 10737418240 May 17 19:09 CentOS.raw
-rw-r--r--. 1 root root 2585558528 May 17 13:43 CentOS.vmdk
Thanks,
Prakash
mike
2012-05-19 19:19:25 UTC
Permalink
Post by Prakash P
Hi Mike,
Yes I have also created the vmdk from an ESX 5. Thanks for this pointer.
Can you please let me know what you mean by "more normal" vmdk?? Is
there any specific option in vmware-vdiskmanager needs to be used? Or
just renaming the vmdk file using -n option will do the necessary
conversion?
unfortunately, my co-worker didn't remember the exact details of how
the vmdk needed to be changed using the vmware-vdiskmanager. i was just
looking at some vmware documentation about the utility and i'm guessing
you would want to specify the -r option to do a convert and either '-t
0' or '-t 2' for the image type. 0 will make the output be a sparse vmdk
and 2 will make it a pre-allocated vmdk. i don't know if a particular
one of those will be needed though. this is all just conjecture on my
part though.

mike
Prakash P
2012-05-20 05:30:31 UTC
Permalink
Thanks Mike. I tried -t 2 option & it worked like Charm. Thanks again for
your
Post by Prakash P
Hi Mike,
Yes I have also created the vmdk from an ESX 5. Thanks for this pointer.
Can you please let me know what you mean by "more normal" vmdk?? Is
there any specific option in vmware-vdiskmanager needs to be used? Or
just renaming the vmdk file using -n option will do the necessary
conversion?
unfortunately, my co-worker didn't remember the exact details of how the
vmdk needed to be changed using the vmware-vdiskmanager. i was just looking
at some vmware documentation about the utility and i'm guessing you would
want to specify the -r option to do a convert and either '-t 0' or '-t 2'
for the image type. 0 will make the output be a sparse vmdk and 2 will make
it a pre-allocated vmdk. i don't know if a particular one of those will be
needed though. this is all just conjecture on my part though.
mike
Continue reading on narkive:
Loading...