backing up Xen file-based VM

Hi.

I have a Windows 7 Xen VM on openSUSE 12.1. Disk of the VM is NTFS and file-based: /var/lib/xen/images/Domain-1/disk0.
Its fdisk:

/var/lib/xen/images/Domain-1/disk0p1   *        2048      206847      102400    7  HPFS/NTFS/exFAT
/var/lib/xen/images/Domain-1/disk0p2          206848   104855551    52324352    7  HPFS/NTFS/exFAT

Is there an easy way to make a hot backup of the VM?

I’ve found a very nice script “xenBackup” (https://github.com/doofdoofsf/xenBackup), but unfortunately it supports only LVM-based Xen disks.

I’ve also tried a modified version of the script (https://blog.valqk.com/archives/Backup-xen-lvmimage-disks.-xenBackup-script.-31.html) which is supposed to work with file-based VMs, but I did not manage to get it working (loop-mounting the file does not succeed - the image apparently has 2 partitions, but there’s only “disk0” file which itself isn’t a filesystem, so thus the “The device ‘/dev/loop1’ doesn’t seem to have a valid NTFS” error, right?).

You could create a couple of logical volumes, and then just dd your files there (with VM shut down) — and the snapshot functionality of LVM will be at your disposal. Of course, if your whole disk is already partitioned, you will first have to shrink a partition to free some space for your new LV group.

Maybe, but I’d like to perform hot backup and not shut down the VM. If I’d shut it down, I could as well just rsync the image somewhere.

Or did you mean it like migrating from file-based disks to LVM?

Yes, I did; assuming that a single shutdown is an acceptable price for trouble-free snapshots in the future.

Anyway, having separate disks (either logical volumes or basic partitions) as backend for DomU disks is better than using files:
]no performance penalty for additional level of abstraction at filesystem level;]no need for [automatically created] loopback devices to export disks for DomU;]no need for loopback devices to access disk contents from Dom0;]ability to make live snapshots from Dom0 (with LV-based disks);*]Dom0 filesystem corruption doesn’t affect DomU disks, nor Dom0 OS reinstall does.
And, I think, dedicated volumes provide a better way to control your disk space. Not to mention that LVM allows to expand volumes beyond single physical disk.