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.qcow2But 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.
How to convert Windows 7 partitions to qcow2?
virtualization;window;qemu
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/LVUse 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.