From mboxrd@z Thu Jan 1 00:00:00 1970 From: Erik Rull Subject: Re: Converting QEMU Harddisk to native Partition Date: Tue, 15 Feb 2011 21:54:48 +0100 Message-ID: <4D5AE818.5040702@rdsoftware.de> References: <4D5AB28E.6050904@rdsoftware.de> <4D5ADBA9.7070806@mair-family.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "kvm@vger.kernel.org" To: David Mair Return-path: Received: from moutng.kundenserver.de ([212.227.126.187]:62540 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754263Ab1BOUyy (ORCPT ); Tue, 15 Feb 2011 15:54:54 -0500 In-Reply-To: <4D5ADBA9.7070806@mair-family.org> Sender: kvm-owner@vger.kernel.org List-ID: David Mair wrote: > >> I have currently virtualized two partitions (/dev/sda2 and /dev/sda3) >> that are exposed as QEMU Harddisks to the Windows XP Guest (Drive C and >> D there). >> Are there possibilities to convert or adapt those to native partitions >> or native disks so that I could theoretically boot the Windows that is >> placed in the virtual disk natively? >> > Anything that works on real hardware is likely to work if run in a > guest. At the very least, one of several similar and equivalent methods > would be, create another virtual disk a bit bigger than the Windows > partition you want to make native and attach it to a VM with the Windows > partition you want to make native and boot a linux rescue disk. Put a > linux file system on the new disk and mount it (say at /mnt/workspace) > then, assuming the Windows partition you want to make native is hda1: > > # dd if=/dev/sda2 of=/mnt/workspace/windowsCdrive.img bs=1M > # dd if=/dev/sda3 of=/mnt/workspace/windowsDdrive.img bs=1M > # scp /mnt/workspace/windows*img user@vmhost:~/ > > I'm assuming you get how that would give you a block copy of the guest > partitions as files on the host, which you could then lay down on a real > disk via dd and a USB device for example. > Yeah, I thought about a similar approach already but it looked too complex to me :-) I assume that my hardware resources might be too limited for such an operation, but I will give it a try. For saving space I could try to do a .gz or .tgz out of it right (using "dd | tar...")? Are there other possibilities from the host side to handle that? I heard about the qemu-img tool but it doesn't seem to match my usecase. Or have I just missed some parameters? Thanks. Best regards, Erik