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.