I have a directory filled with data at /var/backups/disk1 that I want to convert into a virtual disk image which I'll then be able to boot using QEMU or KVM (the directory contains the file system for a virtual machine, copied out via rsync).
While there are plenty of instructions out there for converting a complete physical disk to a virtual disk, packaging up only the contents of a single directory into a virtual disk image is turning out to be much more difficult than I expected. Any ideas?
By the way, I know I can use qemu-img to convert a block device into a virtual disk (e.g., "qemu-img convert -f /dev/sdc -O qcow2 disk.qcow2"), so if only I could get the directory /var/backups/disk1 to appear to be a block device, then theoretically I should be able to accomplish my goal using qemu-img. I've thought about creative ways to expose the directory as a block device using NBD or a loopback device, however, and have not had success.