I have Windows 7 installed on one of my disks. I want to boot this Windows system in my Xen HVM, but I do not want the changes to be permanent. So I want to create a snapshot of my Windows 7 partition. I checked with LVM, but it seems LVM can only create snapshot for LV it created. I am looking for a more general snapshot method.
How to create a snapshot of a physical disk?
linux;backup;hard disk;cloning
You can use the lower level dmsetup command to direct the kernel device mapper to create a snapshot.  If you are otherwise using LVM aside from the Windows partition, then create a logical volume to use as the backing store of the snapshot.lvcreate -n store -L 10g vgecho 0 `blockdev --getsz /dev/sda1` snapshot-origin /dev/sda1 | dmsetup create originecho 0 `blockdev --getsz /dev/sda1` snapshot /dev/mapper/origin /dev/mapper/vg-store N 128 | dmsetup create snapNow you can point xen to /dev/mapper/snap instead of /dev/sda1 and any changes it makes will be discarded when you finish and use dmsetup remove to remove the snap and origin devices, and lvremove to remove the store volume.If you aren't using LVM then you will need another partition or loop device to use as the backing store instead.