[Adding libguestfs mailing list] On Sun, Oct 14, 2018 at 11:53:17AM -0400, Raghuram Devarakonda wrote:
Hi,
My name is Raghuram Devarakonda and I am a big fan of "nbdkit". I have successfully used it to prototype (using Python plugin) a complex project in our company and since then, I have also been trying to understand and learn "guestfs-tools" as well. I have a question in this regard and I hope you don't mind my sending mail gratuitously.
In our project, we deal with quite large sparse files whose total size runs into several hundred terabytes or even more, though actual allocated size on disk is much smaller. The problem is that such large files present issues for copying around, compression, or even for computing checksums. I am wondering of I can use guestfs-tools to mount a QCOW2 image and then use the image as sparse file. The idea is that actual file on the disk would be compact though to our code, sparse file interface is preserved.
It's not very clear to me exactly what you want, but in general yes qcow2 is a good way to handle very large, sparse disk images. If you can be clearer about exactly what you mean by "mount" then I could answer the question better. For example, do you mean "mount a filesystem in the qcow2 image"? In which case use guestmount. If you mean "attach the qcow2 disk as a local device" then qemu-nbd can do this. Rich.
Can you please let me know if this is possible? Can I mount a sparse file using guestfs-tools even though it is not really a disk?
Thanks in advance, Raghu
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html