From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tokarev Subject: Re: Using qemu-img to directly convert physical disk to KVM image Date: Tue, 09 Nov 2010 02:27:00 +0300 Message-ID: <4CD88744.7030502@msgid.tls.msk.ru> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kvm To: Emmanuel Noobadmin Return-path: Received: from isrv.corpit.ru ([86.62.121.231]:46981 "EHLO isrv.corpit.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754060Ab0KHX1D (ORCPT ); Mon, 8 Nov 2010 18:27:03 -0500 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: 09.11.2010 01:48, Emmanuel Noobadmin wrote: > I'm trying to convert a physical Windows XP machine into a KVM guest. > All the guides so far mentions using dd to create a flat image file, > then using qemu-img to convert that to qcow2. Since I've been making > mistake here and there, retrying the process several times (initially > converting each logical partition into an image), the question struck > me: is there any reason why I cannot do something like this > qemu-img convert -f /dev/sdc -O qcow2 /images/winxp.qcow instead of > having to do it in two passes which literally take hours each. This is exactly the way to do it - converting the physical disk directly to a qcow (or whatever format) file using qemu-img. I've no idea why all the guide writers are so confused. The only problem with your exact version is that you've extra -f argument - it expects a parameter, the input image type, which is raw, so either use -f raw, or remove -f. /mjt