3

I know I can use qemu-img tool to convert a raw partition into a image file. But Windows 7 has two partitions. I tried:

qemu-img convert /dev/sda1 /dev/sda2 win7.qcow2 

But the generated file does not have the correct partition infomation, thus cannot work. I also tried converting only the System partition and let the Windows 7 installation program to fix it for me, and the program says it cannot fix it ;(

I then used the disk2vhd utility to create VHD image, then tried to convert it into qcow2, but qemu-img returned error:

File too large. 

The generated VHD image file is about 15GB. The file system I am working on is ext4. So I do not think it is a file system limit issue.

1
  • Are you trying to store your file on a FAT32 filesystem? Commented Apr 21, 2012 at 6:26

1 Answer 1

1

Perhaps you should do this in two steps:

First: Make an LV as raw disk, built a partition table there with entries that correspond to sda1 and sda2.

Make these partitions available: kpartx -av /dev/VG/LV

Use dd (propably with bs=1m) to copy sda1 to the first and sda2 to the second "partition".

Now you should have a raw-disk-image that corresponds to your physical windows partitions.

Try to use that LV as disk (sas, sata or scsi emulation).

If that works your second step is to convert the LV to a different container format.

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.