14.4. Mapping an Image
qemu-img mapcommand, your can dump the metadata of the specified image file (imgname) and its backing file chain. The dump shows the allocation state of every sector in the (imgname) with the topmost file that allocates it in the backing file chain. Optionally, specify the file's format type (fmt).
qemu-img map [-f fmt] [--output=fmt] imgname
humanformat and the
human) only dumps non-zero, allocated parts of the file. The output identifies a file from where data can be read and the offset in the file. Each line includes four fields. The following shows an example of an output:
Offset Length Mapped to File 0 0x20000 0x50000 /tmp/overlay.qcow2 0x100000 0x10000 0x95380000 /tmp/backing.qcow2
0x20000(131072) bytes starting at offset 0 in the image are available in
tmp/overlay.qcow2(opened in raw format) starting at offset
0x50000(327680). Data that is compressed, encrypted, or otherwise not available in raw format causes an error if
humanformat is specified.
humanformat in scripts.
jsonoption is specified, the output returns an array of dictionaries in JSON format. In addition to the information provided in the
humanoption, the output includes the following information:
data- A Boolean field that shows whether or not the sectors contain data
zero- A Boolean field that shows whether or not the data is known to read as zero
depth- The depth of the backing file of
jsonoption is specified, the
offsetfield is optional.
qemu-img mapcommand and additional options, see the relevant man page.