[Libguestfs] Question about mounting QCOW2 files....

Raghuram Devarakonda draghuram at gmail.com
Tue Oct 16 14:00:20 UTC 2018


On Tue, Oct 16, 2018 at 9:28 AM Richard W.M. Jones <rjones at redhat.com> wrote:
> > We would like to create and write to a large sparse file but would
> > like to keep the file on disk itself in compact format. So we are not
> > talking about a file system but a single file. I guess this means
> > creating qcow2 disk and attach as a local device?
>
> I'm still a little unclear, but most likely:
>
>   qemu-nbd -c /dev/nbd0 file.qcow2
>   qemu-nbd -d /dev/nbd0
>
> The first command will attach file.qcow2 to /dev/nbd0, making it
> appear as a normal host device.  The second will detach it.

Thanks. I will try it.




More information about the Libguestfs mailing list