One Hat Cyber Team
Your IP :
216.73.216.115
Server IP :
194.44.31.54
Server :
Linux zen.imath.kiev.ua 4.18.0-553.77.1.el8_10.x86_64 #1 SMP Fri Oct 3 14:30:23 UTC 2025 x86_64
Server Software :
Apache/2.4.37 (Rocky Linux) OpenSSL/1.1.1k
PHP Version :
5.6.40
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
doc
/
qemu-kvm
/
tools
/
View File Name :
qemu-img.html
<!DOCTYPE html> <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>QEMU disk image utility — QEMU qemu-kvm-6.2.0-53.module+el8.10.0+2055+8eb7870b.4 documentation</title> <link rel="shortcut icon" href="../_static/qemu_32x32.png"/> <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="QEMU Storage Daemon" href="qemu-storage-daemon.html" /> <link rel="prev" title="Tools" href="index.html" /> <script src="../_static/js/modernizr.min.js"></script> </head> <body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search"> <a href="../index.html" class="icon icon-home"> QEMU <img src="../_static/qemu_128x128.png" class="logo" alt="Logo"/> </a> <div class="version"> 6.2.0 </div> <div role="search"> <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> </div> <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> <p class="caption"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="../about/index.html">About QEMU</a></li> <li class="toctree-l1"><a class="reference internal" href="../system/index.html">System Emulation</a></li> <li class="toctree-l1"><a class="reference internal" href="../user/index.html">User Mode Emulation</a></li> <li class="toctree-l1 current"><a class="reference internal" href="index.html">Tools</a><ul class="current"> <li class="toctree-l2 current"><a class="current reference internal" href="#">QEMU disk image utility</a><ul> <li class="toctree-l3"><a class="reference internal" href="#synopsis">Synopsis</a></li> <li class="toctree-l3"><a class="reference internal" href="#description">Description</a></li> <li class="toctree-l3"><a class="reference internal" href="#options">Options</a></li> <li class="toctree-l3"><a class="reference internal" href="#notes">Notes</a></li> </ul> </li> <li class="toctree-l2"><a class="reference internal" href="qemu-storage-daemon.html">QEMU Storage Daemon</a></li> <li class="toctree-l2"><a class="reference internal" href="qemu-nbd.html">QEMU Disk Network Block Device Server</a></li> <li class="toctree-l2"><a class="reference internal" href="qemu-pr-helper.html">QEMU persistent reservation helper</a></li> <li class="toctree-l2"><a class="reference internal" href="qemu-trace-stap.html">QEMU SystemTap trace tool</a></li> <li class="toctree-l2"><a class="reference internal" href="virtfs-proxy-helper.html">QEMU 9p virtfs proxy filesystem helper</a></li> <li class="toctree-l2"><a class="reference internal" href="virtiofsd.html">QEMU virtio-fs shared file system daemon</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="../interop/index.html">System Emulation Management and Interoperability</a></li> <li class="toctree-l1"><a class="reference internal" href="../specs/index.html">System Emulation Guest Hardware Specifications</a></li> <li class="toctree-l1"><a class="reference internal" href="../devel/index.html">Developer Information</a></li> </ul> </div> </div> </nav> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <nav class="wy-nav-top" aria-label="top navigation"> <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../index.html">QEMU</a> </nav> <div class="wy-nav-content"> <div class="rst-content"> <div role="navigation" aria-label="breadcrumbs navigation"> <ul class="wy-breadcrumbs"> <li><a href="../index.html">Docs</a> »</li> <li><a href="index.html">Tools</a> »</li> <li>QEMU disk image utility</li> <li class="wy-breadcrumbs-aside"> <a href="https://gitlab.com/qemu-project/qemu/blob/master/docs/tools/qemu-img.rst" class="fa fa-gitlab"> Edit on GitLab</a> </li> </ul> <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> <div class="section" id="qemu-disk-image-utility"> <h1>QEMU disk image utility<a class="headerlink" href="#qemu-disk-image-utility" title="Permalink to this headline">¶</a></h1> <div class="section" id="synopsis"> <h2>Synopsis<a class="headerlink" href="#synopsis" title="Permalink to this headline">¶</a></h2> <p><strong>qemu-img</strong> [<em>standard options</em>] <em>command</em> [<em>command options</em>]</p> </div> <div class="section" id="description"> <h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2> <p>qemu-img allows you to create, convert and modify images offline. It can handle all image formats supported by QEMU.</p> <p><strong>Warning:</strong> Never use qemu-img to modify images in use by a running virtual machine or any other process; this may destroy the image. Also, be aware that querying an image that is being modified by another process may encounter inconsistent state.</p> </div> <div class="section" id="options"> <h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2> <p>Standard options:</p> <dl class="option"> <dt id="cmdoption-qemu-img-h"> <code class="descname">-h</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--help</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-qemu-img-h" title="Permalink to this definition">¶</a></dt> <dd><p>Display this help and exit</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-v"> <code class="descname">-V</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--version</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-qemu-img-v" title="Permalink to this definition">¶</a></dt> <dd><p>Display version information and exit</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-t"> <code class="descname">-T</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">--trace</code><code class="descclassname"> [[enable=]PATTERN][,events=FILE][,file=FILE]</code><a class="headerlink" href="#cmdoption-qemu-img-t" title="Permalink to this definition">¶</a></dt> <dd><p>Specify tracing options.</p> <p><code class="docutils literal notranslate"><span class="pre">[enable=]PATTERN</span></code></p> <blockquote> <div><p>Immediately enable events matching <em>PATTERN</em> (either event name or a globbing pattern). This option is only available if QEMU has been compiled with the <code class="docutils literal notranslate"><span class="pre">simple</span></code>, <code class="docutils literal notranslate"><span class="pre">log</span></code> or <code class="docutils literal notranslate"><span class="pre">ftrace</span></code> tracing backend. To specify multiple events or patterns, specify the <code class="xref std std-option docutils literal notranslate"><span class="pre">-trace</span></code> option multiple times.</p> <p>Use <code class="xref std std-option docutils literal notranslate"><span class="pre">-trace</span> <span class="pre">help</span></code> to print a list of names of trace points.</p> </div></blockquote> <p><code class="docutils literal notranslate"><span class="pre">events=FILE</span></code></p> <blockquote> <div>Immediately enable events listed in <em>FILE</em>. The file must contain one event name (as listed in the <code class="docutils literal notranslate"><span class="pre">trace-events-all</span></code> file) per line; globbing patterns are accepted too. This option is only available if QEMU has been compiled with the <code class="docutils literal notranslate"><span class="pre">simple</span></code>, <code class="docutils literal notranslate"><span class="pre">log</span></code> or <code class="docutils literal notranslate"><span class="pre">ftrace</span></code> tracing backend.</div></blockquote> <p><code class="docutils literal notranslate"><span class="pre">file=FILE</span></code></p> <blockquote> <div>Log output traces to <em>FILE</em>. This option is only available if QEMU has been compiled with the <code class="docutils literal notranslate"><span class="pre">simple</span></code> tracing backend.</div></blockquote> </dd></dl> <p>The following commands are supported:</p> <dl class="option"> <dt id="cmdoption-qemu-img-arg-amend"> <code class="descname">amend</code><code class="descclassname"> [--object OBJECTDEF] [--image-opts] [-p] [-q] [-f FMT] [-t CACHE] [--force] -o OPTIONS FILENAME</code><a class="headerlink" href="#cmdoption-qemu-img-arg-amend" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-arg-bench"> <code class="descname">bench</code><code class="descclassname"> [-c COUNT] [-d DEPTH] [-f FMT] [--flush-interval=FLUSH_INTERVAL] [-i AIO] [-n] [--no-drain] [-o OFFSET] [--pattern=PATTERN] [-q] [-s BUFFER_SIZE] [-S STEP_SIZE] [-t CACHE] [-w] [-U] FILENAME</code><a class="headerlink" href="#cmdoption-qemu-img-arg-bench" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-arg-bitmap"> <code class="descname">bitmap</code><code class="descclassname"> (--merge SOURCE | --add | --remove | --clear | --enable | --disable)... [-b SOURCE_FILE [-F SOURCE_FMT]] [-g GRANULARITY] [--object OBJECTDEF] [--image-opts | -f FMT] FILENAME BITMAP</code><a class="headerlink" href="#cmdoption-qemu-img-arg-bitmap" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-arg-check"> <code class="descname">check</code><code class="descclassname"> [--object OBJECTDEF] [--image-opts] [-q] [-f FMT] [--output=OFMT] [-r [leaks | all]] [-T SRC_CACHE] [-U] FILENAME</code><a class="headerlink" href="#cmdoption-qemu-img-arg-check" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-arg-commit"> <code class="descname">commit</code><code class="descclassname"> [--object OBJECTDEF] [--image-opts] [-q] [-f FMT] [-t CACHE] [-b BASE] [-r RATE_LIMIT] [-d] [-p] FILENAME</code><a class="headerlink" href="#cmdoption-qemu-img-arg-commit" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-arg-compare"> <code class="descname">compare</code><code class="descclassname"> [--object OBJECTDEF] [--image-opts] [-f FMT] [-F FMT] [-T SRC_CACHE] [-p] [-q] [-s] [-U] FILENAME1 FILENAME2</code><a class="headerlink" href="#cmdoption-qemu-img-arg-compare" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-arg-convert"> <code class="descname">convert</code><code class="descclassname"> [--object OBJECTDEF] [--image-opts] [--target-image-opts] [--target-is-zero] [--bitmaps] [-U] [-C] [-c] [-p] [-q] [-n] [-f FMT] [-t CACHE] [-T SRC_CACHE] [-O OUTPUT_FMT] [-B BACKING_FILE [-F BACKING_FMT]] [-o OPTIONS] [-l SNAPSHOT_PARAM] [-S SPARSE_SIZE] [-r RATE_LIMIT] [-m NUM_COROUTINES] [-W] [--salvage] FILENAME [FILENAME2 [...]] OUTPUT_FILENAME</code><a class="headerlink" href="#cmdoption-qemu-img-arg-convert" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-arg-create"> <code class="descname">create</code><code class="descclassname"> [--object OBJECTDEF] [-q] [-f FMT] [-b BACKING_FILE] [-F BACKING_FMT] [-u] [-o OPTIONS] FILENAME [SIZE]</code><a class="headerlink" href="#cmdoption-qemu-img-arg-create" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-arg-dd"> <code class="descname">dd</code><code class="descclassname"> [--image-opts] [-U] [-f FMT] [-O OUTPUT_FMT] [bs=BLOCK_SIZE] [count=BLOCKS] [skip=BLOCKS] if=INPUT of=OUTPUT</code><a class="headerlink" href="#cmdoption-qemu-img-arg-dd" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-arg-info"> <code class="descname">info</code><code class="descclassname"> [--object OBJECTDEF] [--image-opts] [-f FMT] [--output=OFMT] [--backing-chain] [-U] FILENAME</code><a class="headerlink" href="#cmdoption-qemu-img-arg-info" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-arg-map"> <code class="descname">map</code><code class="descclassname"> [--object OBJECTDEF] [--image-opts] [-f FMT] [--start-offset=OFFSET] [--max-length=LEN] [--output=OFMT] [-U] FILENAME</code><a class="headerlink" href="#cmdoption-qemu-img-arg-map" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-arg-measure"> <code class="descname">measure</code><code class="descclassname"> [--output=OFMT] [-O OUTPUT_FMT] [-o OPTIONS] [--size N | [--object OBJECTDEF] [--image-opts] [-f FMT] [-l SNAPSHOT_PARAM] FILENAME]</code><a class="headerlink" href="#cmdoption-qemu-img-arg-measure" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-arg-snapshot"> <code class="descname">snapshot</code><code class="descclassname"> [--object OBJECTDEF] [--image-opts] [-U] [-q] [-l | -a SNAPSHOT | -c SNAPSHOT | -d SNAPSHOT] FILENAME</code><a class="headerlink" href="#cmdoption-qemu-img-arg-snapshot" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-arg-rebase"> <code class="descname">rebase</code><code class="descclassname"> [--object OBJECTDEF] [--image-opts] [-U] [-q] [-f FMT] [-t CACHE] [-T SRC_CACHE] [-p] [-u] -b BACKING_FILE [-F BACKING_FMT] FILENAME</code><a class="headerlink" href="#cmdoption-qemu-img-arg-rebase" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-arg-resize"> <code class="descname">resize</code><code class="descclassname"> [--object OBJECTDEF] [--image-opts] [-f FMT] [--preallocation=PREALLOC] [-q] [--shrink] FILENAME [+ | -]SIZE</code><a class="headerlink" href="#cmdoption-qemu-img-arg-resize" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <p>Command parameters:</p> <p><em>FILENAME</em> is a disk image filename.</p> <p><em>FMT</em> is the disk image format. It is guessed automatically in most cases. See below for a description of the supported disk formats.</p> <p><em>SIZE</em> is the disk image size in bytes. Optional suffixes <code class="docutils literal notranslate"><span class="pre">k</span></code> or <code class="docutils literal notranslate"><span class="pre">K</span></code> (kilobyte, 1024) <code class="docutils literal notranslate"><span class="pre">M</span></code> (megabyte, 1024k) and <code class="docutils literal notranslate"><span class="pre">G</span></code> (gigabyte, 1024M) and T (terabyte, 1024G) are supported. <code class="docutils literal notranslate"><span class="pre">b</span></code> is ignored.</p> <p><em>OUTPUT_FILENAME</em> is the destination disk image filename.</p> <p><em>OUTPUT_FMT</em> is the destination format.</p> <p><em>OPTIONS</em> is a comma separated list of format specific options in a name=value format. Use <code class="docutils literal notranslate"><span class="pre">-o</span> <span class="pre">?</span></code> for an overview of the options supported by the used format or see the format descriptions below for details.</p> <p><em>SNAPSHOT_PARAM</em> is param used for internal snapshot, format is ‘snapshot.id=[ID],snapshot.name=[NAME]’ or ‘[ID_OR_NAME]’.</p> <dl class="option"> <dt id="cmdoption-qemu-img-common-opts-object"> <code class="descname">--object</code><code class="descclassname"> OBJECTDEF</code><a class="headerlink" href="#cmdoption-qemu-img-common-opts-object" title="Permalink to this definition">¶</a></dt> <dd><p>is a QEMU user creatable object definition. See the <em class="manpage">qemu(1)</em> manual page for a description of the object properties. The most common object type is a <code class="docutils literal notranslate"><span class="pre">secret</span></code>, which is used to supply passwords and/or encryption keys.</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-common-opts-image-opts"> <code class="descname">--image-opts</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-qemu-img-common-opts-image-opts" title="Permalink to this definition">¶</a></dt> <dd><p>Indicates that the source <em>FILENAME</em> parameter is to be interpreted as a full option string, not a plain filename. This parameter is mutually exclusive with the <em>-f</em> parameter.</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-common-opts-target-image-opts"> <code class="descname">--target-image-opts</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-qemu-img-common-opts-target-image-opts" title="Permalink to this definition">¶</a></dt> <dd><p>Indicates that the OUTPUT_FILENAME parameter(s) are to be interpreted as a full option string, not a plain filename. This parameter is mutually exclusive with the <em>-O</em> parameters. It is currently required to also use the <em>-n</em> parameter to skip image creation. This restriction may be relaxed in a future release.</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-common-opts-force-share"> <code class="descname">--force-share</code><code class="descclassname"> (-U)</code><a class="headerlink" href="#cmdoption-qemu-img-common-opts-force-share" title="Permalink to this definition">¶</a></dt> <dd><p>If specified, <code class="docutils literal notranslate"><span class="pre">qemu-img</span></code> will open the image in shared mode, allowing other QEMU processes to open it in write mode. For example, this can be used to get the image information (with ‘info’ subcommand) when the image is used by a running guest. Note that this could produce inconsistent results because of concurrent metadata changes, etc. This option is only allowed when opening images in read-only mode.</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-common-opts-backing-chain"> <code class="descname">--backing-chain</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-qemu-img-common-opts-backing-chain" title="Permalink to this definition">¶</a></dt> <dd><p>Will enumerate information about backing files in a disk image chain. Refer below for further description.</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-common-opts-c"> <code class="descname">-c</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-qemu-img-common-opts-c" title="Permalink to this definition">¶</a></dt> <dd><p>Indicates that target image must be compressed (qcow format only).</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-common-opts-h"> <code class="descname">-h</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-qemu-img-common-opts-h" title="Permalink to this definition">¶</a></dt> <dd><p>With or without a command, shows help and lists the supported formats.</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-common-opts-p"> <code class="descname">-p</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-qemu-img-common-opts-p" title="Permalink to this definition">¶</a></dt> <dd><p>Display progress bar (compare, convert and rebase commands only). If the <em>-p</em> option is not used for a command that supports it, the progress is reported when the process receives a <code class="docutils literal notranslate"><span class="pre">SIGUSR1</span></code> or <code class="docutils literal notranslate"><span class="pre">SIGINFO</span></code> signal.</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-common-opts-q"> <code class="descname">-q</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-qemu-img-common-opts-q" title="Permalink to this definition">¶</a></dt> <dd><p>Quiet mode - do not print any output (except errors). There’s no progress bar in case both <em>-q</em> and <em>-p</em> options are used.</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-common-opts-s"> <code class="descname">-S</code><code class="descclassname"> SIZE</code><a class="headerlink" href="#cmdoption-qemu-img-common-opts-s" title="Permalink to this definition">¶</a></dt> <dd><p>Indicates the consecutive number of bytes that must contain only zeros for <code class="docutils literal notranslate"><span class="pre">qemu-img</span></code> to create a sparse image during conversion. This value is rounded down to the nearest 512 bytes. You may use the common size suffixes like <code class="docutils literal notranslate"><span class="pre">k</span></code> for kilobytes.</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-common-opts-t"> <code class="descname">-t</code><code class="descclassname"> CACHE</code><a class="headerlink" href="#cmdoption-qemu-img-common-opts-t" title="Permalink to this definition">¶</a></dt> <dd><p>Specifies the cache mode that should be used with the (destination) file. See the documentation of the emulator’s <code class="docutils literal notranslate"><span class="pre">-drive</span> <span class="pre">cache=...</span></code> option for allowed values.</p> </dd></dl> <dl class="option"> <dt id="id1"> <code class="descname">-T</code><code class="descclassname"> SRC_CACHE</code><a class="headerlink" href="#id1" title="Permalink to this definition">¶</a></dt> <dd><p>Specifies the cache mode that should be used with the source file(s). See the documentation of the emulator’s <code class="docutils literal notranslate"><span class="pre">-drive</span> <span class="pre">cache=...</span></code> option for allowed values.</p> </dd></dl> <p>Parameters to compare subcommand:</p> <dl class="option"> <dt id="cmdoption-qemu-img-compare-f"> <code class="descname">-f</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-qemu-img-compare-f" title="Permalink to this definition">¶</a></dt> <dd><p>First image format</p> </dd></dl> <dl class="option"> <dt id="id2"> <code class="descname">-F</code><code class="descclassname"></code><a class="headerlink" href="#id2" title="Permalink to this definition">¶</a></dt> <dd><p>Second image format</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-compare-s"> <code class="descname">-s</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-qemu-img-compare-s" title="Permalink to this definition">¶</a></dt> <dd><p>Strict mode - fail on different image size or sector allocation</p> </dd></dl> <p>Parameters to convert subcommand:</p> <dl class="option"> <dt id="cmdoption-qemu-img-convert-bitmaps"> <code class="descname">--bitmaps</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-qemu-img-convert-bitmaps" title="Permalink to this definition">¶</a></dt> <dd><p>Additionally copy all persistent bitmaps from the top layer of the source</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-convert-n"> <code class="descname">-n</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-qemu-img-convert-n" title="Permalink to this definition">¶</a></dt> <dd><p>Skip the creation of the target volume</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-convert-m"> <code class="descname">-m</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-qemu-img-convert-m" title="Permalink to this definition">¶</a></dt> <dd><p>Number of parallel coroutines for the convert process</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-convert-w"> <code class="descname">-W</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-qemu-img-convert-w" title="Permalink to this definition">¶</a></dt> <dd><p>Allow out-of-order writes to the destination. This option improves performance, but is only recommended for preallocated devices like host devices or other raw block devices.</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-convert-c"> <code class="descname">-C</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-qemu-img-convert-c" title="Permalink to this definition">¶</a></dt> <dd><p>Try to use copy offloading to move data from source image to target. This may improve performance if the data is remote, such as with NFS or iSCSI backends, but will not automatically sparsify zero sectors, and may result in a fully allocated target image depending on the host support for getting allocation information.</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-convert-r"> <code class="descname">-r</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-qemu-img-convert-r" title="Permalink to this definition">¶</a></dt> <dd><p>Rate limit for the convert process</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-convert-salvage"> <code class="descname">--salvage</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-qemu-img-convert-salvage" title="Permalink to this definition">¶</a></dt> <dd><p>Try to ignore I/O errors when reading. Unless in quiet mode (<code class="docutils literal notranslate"><span class="pre">-q</span></code>), errors will still be printed. Areas that cannot be read from the source will be treated as containing only zeroes.</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-convert-target-is-zero"> <code class="descname">--target-is-zero</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-qemu-img-convert-target-is-zero" title="Permalink to this definition">¶</a></dt> <dd><p>Assume that reading the destination image will always return zeros. This parameter is mutually exclusive with a destination image that has a backing file. It is required to also use the <code class="docutils literal notranslate"><span class="pre">-n</span></code> parameter to skip image creation.</p> </dd></dl> <p>Parameters to dd subcommand:</p> <dl class="option"> <dt id="cmdoption-qemu-img-dd-arg-bs"> <code class="descname">bs</code><code class="descclassname">=BLOCK_SIZE</code><a class="headerlink" href="#cmdoption-qemu-img-dd-arg-bs" title="Permalink to this definition">¶</a></dt> <dd><p>Defines the block size</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-dd-arg-count"> <code class="descname">count</code><code class="descclassname">=BLOCKS</code><a class="headerlink" href="#cmdoption-qemu-img-dd-arg-count" title="Permalink to this definition">¶</a></dt> <dd><p>Sets the number of input blocks to copy</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-dd-arg-if"> <code class="descname">if</code><code class="descclassname">=INPUT</code><a class="headerlink" href="#cmdoption-qemu-img-dd-arg-if" title="Permalink to this definition">¶</a></dt> <dd><p>Sets the input file</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-dd-arg-of"> <code class="descname">of</code><code class="descclassname">=OUTPUT</code><a class="headerlink" href="#cmdoption-qemu-img-dd-arg-of" title="Permalink to this definition">¶</a></dt> <dd><p>Sets the output file</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-dd-arg-skip"> <code class="descname">skip</code><code class="descclassname">=BLOCKS</code><a class="headerlink" href="#cmdoption-qemu-img-dd-arg-skip" title="Permalink to this definition">¶</a></dt> <dd><p>Sets the number of input blocks to skip</p> </dd></dl> <p>Parameters to snapshot subcommand:</p> <dl class="option"> <dt id="cmdoption-qemu-img-snapshot-arg-snapshot"> <code class="descname">snapshot</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-qemu-img-snapshot-arg-snapshot" title="Permalink to this definition">¶</a></dt> <dd><p>Is the name of the snapshot to create, apply or delete</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-snapshot-a"> <code class="descname">-a</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-qemu-img-snapshot-a" title="Permalink to this definition">¶</a></dt> <dd><p>Applies a snapshot (revert disk to saved state)</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-snapshot-c"> <code class="descname">-c</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-qemu-img-snapshot-c" title="Permalink to this definition">¶</a></dt> <dd><p>Creates a snapshot</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-snapshot-d"> <code class="descname">-d</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-qemu-img-snapshot-d" title="Permalink to this definition">¶</a></dt> <dd><p>Deletes a snapshot</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-snapshot-l"> <code class="descname">-l</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-qemu-img-snapshot-l" title="Permalink to this definition">¶</a></dt> <dd><p>Lists all snapshots in the given image</p> </dd></dl> <p>Command description:</p> <dl class="option"> <dt id="cmdoption-qemu-img-commands-arg-amend"> <code class="descname">amend</code><code class="descclassname"> [--object OBJECTDEF] [--image-opts] [-p] [-q] [-f FMT] [-t CACHE] [--force] -o OPTIONS FILENAME</code><a class="headerlink" href="#cmdoption-qemu-img-commands-arg-amend" title="Permalink to this definition">¶</a></dt> <dd><p>Amends the image format specific <em>OPTIONS</em> for the image file <em>FILENAME</em>. Not all file formats support this operation.</p> <p>The set of options that can be amended are dependent on the image format, but note that amending the backing chain relationship should instead be performed with <code class="docutils literal notranslate"><span class="pre">qemu-img</span> <span class="pre">rebase</span></code>.</p> <p>–force allows some unsafe operations. Currently for -f luks, it allows to erase the last encryption key, and to overwrite an active encryption key.</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-commands-arg-bench"> <code class="descname">bench</code><code class="descclassname"> [-c COUNT] [-d DEPTH] [-f FMT] [--flush-interval=FLUSH_INTERVAL] [-i AIO] [-n] [--no-drain] [-o OFFSET] [--pattern=PATTERN] [-q] [-s BUFFER_SIZE] [-S STEP_SIZE] [-t CACHE] [-w] [-U] FILENAME</code><a class="headerlink" href="#cmdoption-qemu-img-commands-arg-bench" title="Permalink to this definition">¶</a></dt> <dd><p>Run a simple sequential I/O benchmark on the specified image. If <code class="docutils literal notranslate"><span class="pre">-w</span></code> is specified, a write test is performed, otherwise a read test is performed.</p> <p>A total number of <em>COUNT</em> I/O requests is performed, each <em>BUFFER_SIZE</em> bytes in size, and with <em>DEPTH</em> requests in parallel. The first request starts at the position given by <em>OFFSET</em>, each following request increases the current position by <em>STEP_SIZE</em>. If <em>STEP_SIZE</em> is not given, <em>BUFFER_SIZE</em> is used for its value.</p> <p>If <em>FLUSH_INTERVAL</em> is specified for a write test, the request queue is drained and a flush is issued before new writes are made whenever the number of remaining requests is a multiple of <em>FLUSH_INTERVAL</em>. If additionally <code class="docutils literal notranslate"><span class="pre">--no-drain</span></code> is specified, a flush is issued without draining the request queue first.</p> <p>if <code class="docutils literal notranslate"><span class="pre">-i</span></code> is specified, <em>AIO</em> option can be used to specify different AIO backends: <code class="docutils literal notranslate"><span class="pre">threads</span></code>, <code class="docutils literal notranslate"><span class="pre">native</span></code> or <code class="docutils literal notranslate"><span class="pre">io_uring</span></code>.</p> <p>If <code class="docutils literal notranslate"><span class="pre">-n</span></code> is specified, the native AIO backend is used if possible. On Linux, this option only works if <code class="docutils literal notranslate"><span class="pre">-t</span> <span class="pre">none</span></code> or <code class="docutils literal notranslate"><span class="pre">-t</span> <span class="pre">directsync</span></code> is specified as well.</p> <p>For write tests, by default a buffer filled with zeros is written. This can be overridden with a pattern byte specified by <em>PATTERN</em>.</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-commands-arg-bitmap"> <code class="descname">bitmap</code><code class="descclassname"> (--merge SOURCE | --add | --remove | --clear | --enable | --disable)... [-b SOURCE_FILE [-F SOURCE_FMT]] [-g GRANULARITY] [--object OBJECTDEF] [--image-opts | -f FMT] FILENAME BITMAP</code><a class="headerlink" href="#cmdoption-qemu-img-commands-arg-bitmap" title="Permalink to this definition">¶</a></dt> <dd><p>Perform one or more modifications of the persistent bitmap <em>BITMAP</em> in the disk image <em>FILENAME</em>. The various modifications are:</p> <p><code class="docutils literal notranslate"><span class="pre">--add</span></code> to create <em>BITMAP</em>, enabled to record future edits.</p> <p><code class="docutils literal notranslate"><span class="pre">--remove</span></code> to remove <em>BITMAP</em>.</p> <p><code class="docutils literal notranslate"><span class="pre">--clear</span></code> to clear <em>BITMAP</em>.</p> <p><code class="docutils literal notranslate"><span class="pre">--enable</span></code> to change <em>BITMAP</em> to start recording future edits.</p> <p><code class="docutils literal notranslate"><span class="pre">--disable</span></code> to change <em>BITMAP</em> to stop recording future edits.</p> <p><code class="docutils literal notranslate"><span class="pre">--merge</span></code> to merge the contents of the <em>SOURCE</em> bitmap into <em>BITMAP</em>.</p> <p>Additional options include <code class="docutils literal notranslate"><span class="pre">-g</span></code> which sets a non-default <em>GRANULARITY</em> for <code class="docutils literal notranslate"><span class="pre">--add</span></code>, and <code class="docutils literal notranslate"><span class="pre">-b</span></code> and <code class="docutils literal notranslate"><span class="pre">-F</span></code> which select an alternative source file for all <em>SOURCE</em> bitmaps used by <code class="docutils literal notranslate"><span class="pre">--merge</span></code>.</p> <p>To see what bitmaps are present in an image, use <code class="docutils literal notranslate"><span class="pre">qemu-img</span> <span class="pre">info</span></code>.</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-commands-arg-check"> <code class="descname">check</code><code class="descclassname"> [--object OBJECTDEF] [--image-opts] [-q] [-f FMT] [--output=OFMT] [-r [leaks | all]] [-T SRC_CACHE] [-U] FILENAME</code><a class="headerlink" href="#cmdoption-qemu-img-commands-arg-check" title="Permalink to this definition">¶</a></dt> <dd><p>Perform a consistency check on the disk image <em>FILENAME</em>. The command can output in the format <em>OFMT</em> which is either <code class="docutils literal notranslate"><span class="pre">human</span></code> or <code class="docutils literal notranslate"><span class="pre">json</span></code>. The JSON output is an object of QAPI type <code class="docutils literal notranslate"><span class="pre">ImageCheck</span></code>.</p> <p>If <code class="docutils literal notranslate"><span class="pre">-r</span></code> is specified, qemu-img tries to repair any inconsistencies found during the check. <code class="docutils literal notranslate"><span class="pre">-r</span> <span class="pre">leaks</span></code> repairs only cluster leaks, whereas <code class="docutils literal notranslate"><span class="pre">-r</span> <span class="pre">all</span></code> fixes all kinds of errors, with a higher risk of choosing the wrong fix or hiding corruption that has already occurred.</p> <p>Only the formats <code class="docutils literal notranslate"><span class="pre">qcow2</span></code>, <code class="docutils literal notranslate"><span class="pre">qed</span></code> and <code class="docutils literal notranslate"><span class="pre">vdi</span></code> support consistency checks.</p> <p>In case the image does not have any inconsistencies, check exits with <code class="docutils literal notranslate"><span class="pre">0</span></code>. Other exit codes indicate the kind of inconsistency found or if another error occurred. The following table summarizes all exit codes of the check subcommand:</p> <dl class="docutils"> <dt>0</dt> <dd>Check completed, the image is (now) consistent</dd> <dt>1</dt> <dd>Check not completed because of internal errors</dd> <dt>2</dt> <dd>Check completed, image is corrupted</dd> <dt>3</dt> <dd>Check completed, image has leaked clusters, but is not corrupted</dd> <dt>63</dt> <dd>Checks are not supported by the image format</dd> </dl> <p>If <code class="docutils literal notranslate"><span class="pre">-r</span></code> is specified, exit codes representing the image state refer to the state after (the attempt at) repairing it. That is, a successful <code class="docutils literal notranslate"><span class="pre">-r</span> <span class="pre">all</span></code> will yield the exit code 0, independently of the image state before.</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-commands-arg-commit"> <code class="descname">commit</code><code class="descclassname"> [--object OBJECTDEF] [--image-opts] [-q] [-f FMT] [-t CACHE] [-b BASE] [-r RATE_LIMIT] [-d] [-p] FILENAME</code><a class="headerlink" href="#cmdoption-qemu-img-commands-arg-commit" title="Permalink to this definition">¶</a></dt> <dd><p>Commit the changes recorded in <em>FILENAME</em> in its base image or backing file. If the backing file is smaller than the snapshot, then the backing file will be resized to be the same size as the snapshot. If the snapshot is smaller than the backing file, the backing file will not be truncated. If you want the backing file to match the size of the smaller snapshot, you can safely truncate it yourself once the commit operation successfully completes.</p> <p>The image <em>FILENAME</em> is emptied after the operation has succeeded. If you do not need <em>FILENAME</em> afterwards and intend to drop it, you may skip emptying <em>FILENAME</em> by specifying the <code class="docutils literal notranslate"><span class="pre">-d</span></code> flag.</p> <p>If the backing chain of the given image file <em>FILENAME</em> has more than one layer, the backing file into which the changes will be committed may be specified as <em>BASE</em> (which has to be part of <em>FILENAME</em>’s backing chain). If <em>BASE</em> is not specified, the immediate backing file of the top image (which is <em>FILENAME</em>) will be used. Note that after a commit operation all images between <em>BASE</em> and the top image will be invalid and may return garbage data when read. For this reason, <code class="docutils literal notranslate"><span class="pre">-b</span></code> implies <code class="docutils literal notranslate"><span class="pre">-d</span></code> (so that the top image stays valid).</p> <p>The rate limit for the commit process is specified by <code class="docutils literal notranslate"><span class="pre">-r</span></code>.</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-commands-arg-compare"> <code class="descname">compare</code><code class="descclassname"> [--object OBJECTDEF] [--image-opts] [-f FMT] [-F FMT] [-T SRC_CACHE] [-p] [-q] [-s] [-U] FILENAME1 FILENAME2</code><a class="headerlink" href="#cmdoption-qemu-img-commands-arg-compare" title="Permalink to this definition">¶</a></dt> <dd><p>Check if two images have the same content. You can compare images with different format or settings.</p> <p>The format is probed unless you specify it by <code class="docutils literal notranslate"><span class="pre">-f</span></code> (used for <em>FILENAME1</em>) and/or <code class="docutils literal notranslate"><span class="pre">-F</span></code> (used for <em>FILENAME2</em>) option.</p> <p>By default, images with different size are considered identical if the larger image contains only unallocated and/or zeroed sectors in the area after the end of the other image. In addition, if any sector is not allocated in one image and contains only zero bytes in the second one, it is evaluated as equal. You can use Strict mode by specifying the <code class="docutils literal notranslate"><span class="pre">-s</span></code> option. When compare runs in Strict mode, it fails in case image size differs or a sector is allocated in one image and is not allocated in the second one.</p> <p>By default, compare prints out a result message. This message displays information that both images are same or the position of the first different byte. In addition, result message can report different image size in case Strict mode is used.</p> <p>Compare exits with <code class="docutils literal notranslate"><span class="pre">0</span></code> in case the images are equal and with <code class="docutils literal notranslate"><span class="pre">1</span></code> in case the images differ. Other exit codes mean an error occurred during execution and standard error output should contain an error message. The following table sumarizes all exit codes of the compare subcommand:</p> <dl class="docutils"> <dt>0</dt> <dd>Images are identical (or requested help was printed)</dd> <dt>1</dt> <dd>Images differ</dd> <dt>2</dt> <dd>Error on opening an image</dd> <dt>3</dt> <dd>Error on checking a sector allocation</dd> <dt>4</dt> <dd>Error on reading data</dd> </dl> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-commands-arg-convert"> <code class="descname">convert</code><code class="descclassname"> [--object OBJECTDEF] [--image-opts] [--target-image-opts] [--target-is-zero] [--bitmaps [--skip-broken-bitmaps]] [-U] [-C] [-c] [-p] [-q] [-n] [-f FMT] [-t CACHE] [-T SRC_CACHE] [-O OUTPUT_FMT] [-B BACKING_FILE [-F BACKING_FMT]] [-o OPTIONS] [-l SNAPSHOT_PARAM] [-S SPARSE_SIZE] [-r RATE_LIMIT] [-m NUM_COROUTINES] [-W] FILENAME [FILENAME2 [...]] OUTPUT_FILENAME</code><a class="headerlink" href="#cmdoption-qemu-img-commands-arg-convert" title="Permalink to this definition">¶</a></dt> <dd><p>Convert the disk image <em>FILENAME</em> or a snapshot <em>SNAPSHOT_PARAM</em> to disk image <em>OUTPUT_FILENAME</em> using format <em>OUTPUT_FMT</em>. It can be optionally compressed (<code class="docutils literal notranslate"><span class="pre">-c</span></code> option) or use any format specific options like encryption (<code class="docutils literal notranslate"><span class="pre">-o</span></code> option).</p> <p>Only the formats <code class="docutils literal notranslate"><span class="pre">qcow</span></code> and <code class="docutils literal notranslate"><span class="pre">qcow2</span></code> support compression. The compression is read-only. It means that if a compressed sector is rewritten, then it is rewritten as uncompressed data.</p> <p>Image conversion is also useful to get smaller image when using a growable format such as <code class="docutils literal notranslate"><span class="pre">qcow</span></code>: the empty sectors are detected and suppressed from the destination image.</p> <p><em>SPARSE_SIZE</em> indicates the consecutive number of bytes (defaults to 4k) that must contain only zeros for <code class="docutils literal notranslate"><span class="pre">qemu-img</span></code> to create a sparse image during conversion. If <em>SPARSE_SIZE</em> is 0, the source will not be scanned for unallocated or zero sectors, and the destination image will always be fully allocated.</p> <p>You can use the <em>BACKING_FILE</em> option to force the output image to be created as a copy on write image of the specified base image; the <em>BACKING_FILE</em> should have the same content as the input’s base image, however the path, image format (as given by <em>BACKING_FMT</em>), etc may differ.</p> <p>If a relative path name is given, the backing file is looked up relative to the directory containing <em>OUTPUT_FILENAME</em>.</p> <p>If the <code class="docutils literal notranslate"><span class="pre">-n</span></code> option is specified, the target volume creation will be skipped. This is useful for formats such as <code class="docutils literal notranslate"><span class="pre">rbd</span></code> if the target volume has already been created with site specific options that cannot be supplied through <code class="docutils literal notranslate"><span class="pre">qemu-img</span></code>.</p> <p>Out of order writes can be enabled with <code class="docutils literal notranslate"><span class="pre">-W</span></code> to improve performance. This is only recommended for preallocated devices like host devices or other raw block devices. Out of order write does not work in combination with creating compressed images.</p> <p><em>NUM_COROUTINES</em> specifies how many coroutines work in parallel during the convert process (defaults to 8).</p> <p>Use of <code class="docutils literal notranslate"><span class="pre">--bitmaps</span></code> requests that any persistent bitmaps present in the original are also copied to the destination. If any bitmap is inconsistent in the source, the conversion will fail unless <code class="docutils literal notranslate"><span class="pre">--skip-broken-bitmaps</span></code> is also specified to copy only the consistent bitmaps.</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-commands-arg-create"> <code class="descname">create</code><code class="descclassname"> [--object OBJECTDEF] [-q] [-f FMT] [-b BACKING_FILE] [-F BACKING_FMT] [-u] [-o OPTIONS] FILENAME [SIZE]</code><a class="headerlink" href="#cmdoption-qemu-img-commands-arg-create" title="Permalink to this definition">¶</a></dt> <dd><p>Create the new disk image <em>FILENAME</em> of size <em>SIZE</em> and format <em>FMT</em>. Depending on the file format, you can add one or more <em>OPTIONS</em> that enable additional features of this format.</p> <p>If the option <em>BACKING_FILE</em> is specified, then the image will record only the differences from <em>BACKING_FILE</em>. No size needs to be specified in this case. <em>BACKING_FILE</em> will never be modified unless you use the <code class="docutils literal notranslate"><span class="pre">commit</span></code> monitor command (or <code class="docutils literal notranslate"><span class="pre">qemu-img</span> <span class="pre">commit</span></code>).</p> <p>If a relative path name is given, the backing file is looked up relative to the directory containing <em>FILENAME</em>.</p> <p>Note that a given backing file will be opened to check that it is valid. Use the <code class="docutils literal notranslate"><span class="pre">-u</span></code> option to enable unsafe backing file mode, which means that the image will be created even if the associated backing file cannot be opened. A matching backing file must be created or additional options be used to make the backing file specification valid when you want to use an image created this way.</p> <p>The size can also be specified using the <em>SIZE</em> option with <code class="docutils literal notranslate"><span class="pre">-o</span></code>, it doesn’t need to be specified separately in this case.</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-commands-arg-dd"> <code class="descname">dd</code><code class="descclassname"> [--image-opts] [-U] [-f FMT] [-O OUTPUT_FMT] [bs=BLOCK_SIZE] [count=BLOCKS] [skip=BLOCKS] if=INPUT of=OUTPUT</code><a class="headerlink" href="#cmdoption-qemu-img-commands-arg-dd" title="Permalink to this definition">¶</a></dt> <dd><p>dd copies from <em>INPUT</em> file to <em>OUTPUT</em> file converting it from <em>FMT</em> format to <em>OUTPUT_FMT</em> format.</p> <p>The data is by default read and written using blocks of 512 bytes but can be modified by specifying <em>BLOCK_SIZE</em>. If count=<em>BLOCKS</em> is specified dd will stop reading input after reading <em>BLOCKS</em> input blocks.</p> <p>The size syntax is similar to <em class="manpage">dd(1)</em>’s size syntax.</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-commands-arg-info"> <code class="descname">info</code><code class="descclassname"> [--object OBJECTDEF] [--image-opts] [-f FMT] [--output=OFMT] [--backing-chain] [-U] FILENAME</code><a class="headerlink" href="#cmdoption-qemu-img-commands-arg-info" title="Permalink to this definition">¶</a></dt> <dd><p>Give information about the disk image <em>FILENAME</em>. Use it in particular to know the size reserved on disk which can be different from the displayed size. If VM snapshots are stored in the disk image, they are displayed too.</p> <p>If a disk image has a backing file chain, information about each disk image in the chain can be recursively enumerated by using the option <code class="docutils literal notranslate"><span class="pre">--backing-chain</span></code>.</p> <p>For instance, if you have an image chain like:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">base</span><span class="o">.</span><span class="n">qcow2</span> <span class="o"><-</span> <span class="n">snap1</span><span class="o">.</span><span class="n">qcow2</span> <span class="o"><-</span> <span class="n">snap2</span><span class="o">.</span><span class="n">qcow2</span> </pre></div> </div> <p>To enumerate information about each disk image in the above chain, starting from top to base, do:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">qemu</span><span class="o">-</span><span class="n">img</span> <span class="n">info</span> <span class="o">--</span><span class="n">backing</span><span class="o">-</span><span class="n">chain</span> <span class="n">snap2</span><span class="o">.</span><span class="n">qcow2</span> </pre></div> </div> <p>The command can output in the format <em>OFMT</em> which is either <code class="docutils literal notranslate"><span class="pre">human</span></code> or <code class="docutils literal notranslate"><span class="pre">json</span></code>. The JSON output is an object of QAPI type <code class="docutils literal notranslate"><span class="pre">ImageInfo</span></code>; with <code class="docutils literal notranslate"><span class="pre">--backing-chain</span></code>, it is an array of <code class="docutils literal notranslate"><span class="pre">ImageInfo</span></code> objects.</p> <p><code class="docutils literal notranslate"><span class="pre">--output=human</span></code> reports the following information (for every image in the chain):</p> <dl class="docutils"> <dt><em>image</em></dt> <dd>The image file name</dd> <dt><em>file format</em></dt> <dd>The image format</dd> <dt><em>virtual size</em></dt> <dd>The size of the guest disk</dd> <dt><em>disk size</em></dt> <dd>How much space the image file occupies on the host file system (may be shown as 0 if this information is unavailable, e.g. because there is no file system)</dd> <dt><em>cluster_size</em></dt> <dd>Cluster size of the image format, if applicable</dd> <dt><em>encrypted</em></dt> <dd>Whether the image is encrypted (only present if so)</dd> <dt><em>cleanly shut down</em></dt> <dd>This is shown as <code class="docutils literal notranslate"><span class="pre">no</span></code> if the image is dirty and will have to be auto-repaired the next time it is opened in qemu.</dd> <dt><em>backing file</em></dt> <dd>The backing file name, if present</dd> <dt><em>backing file format</em></dt> <dd>The format of the backing file, if the image enforces it</dd> <dt><em>Snapshot list</em></dt> <dd>A list of all internal snapshots</dd> <dt><em>Format specific information</em></dt> <dd>Further information whose structure depends on the image format. This section is a textual representation of the respective <code class="docutils literal notranslate"><span class="pre">ImageInfoSpecific*</span></code> QAPI object (e.g. <code class="docutils literal notranslate"><span class="pre">ImageInfoSpecificQCow2</span></code> for qcow2 images).</dd> </dl> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-commands-arg-map"> <code class="descname">map</code><code class="descclassname"> [--object OBJECTDEF] [--image-opts] [-f FMT] [--start-offset=OFFSET] [--max-length=LEN] [--output=OFMT] [-U] FILENAME</code><a class="headerlink" href="#cmdoption-qemu-img-commands-arg-map" title="Permalink to this definition">¶</a></dt> <dd><p>Dump the metadata of image <em>FILENAME</em> and its backing file chain. In particular, this commands dumps the allocation state of every sector of <em>FILENAME</em>, together with the topmost file that allocates it in the backing file chain.</p> <p>Two option formats are possible. The default format (<code class="docutils literal notranslate"><span class="pre">human</span></code>) only dumps known-nonzero areas of the file. Known-zero parts of the file are omitted altogether, and likewise for parts that are not allocated throughout the chain. <code class="docutils literal notranslate"><span class="pre">qemu-img</span></code> output will identify a file from where the data can be read, and the offset in the file. Each line will include four fields, the first three of which are hexadecimal numbers. For example the first line of:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Offset</span> <span class="n">Length</span> <span class="n">Mapped</span> <span class="n">to</span> <span class="n">File</span> <span class="mi">0</span> <span class="mh">0x20000</span> <span class="mh">0x50000</span> <span class="o">/</span><span class="n">tmp</span><span class="o">/</span><span class="n">overlay</span><span class="o">.</span><span class="n">qcow2</span> <span class="mh">0x100000</span> <span class="mh">0x10000</span> <span class="mh">0x95380000</span> <span class="o">/</span><span class="n">tmp</span><span class="o">/</span><span class="n">backing</span><span class="o">.</span><span class="n">qcow2</span> </pre></div> </div> <p>means that 0x20000 (131072) bytes starting at offset 0 in the image are available in /tmp/overlay.qcow2 (opened in <code class="docutils literal notranslate"><span class="pre">raw</span></code> format) starting at offset 0x50000 (327680). Data that is compressed, encrypted, or otherwise not available in raw format will cause an error if <code class="docutils literal notranslate"><span class="pre">human</span></code> format is in use. Note that file names can include newlines, thus it is not safe to parse this output format in scripts.</p> <p>The alternative format <code class="docutils literal notranslate"><span class="pre">json</span></code> will return an array of dictionaries in JSON format. It will include similar information in the <code class="docutils literal notranslate"><span class="pre">start</span></code>, <code class="docutils literal notranslate"><span class="pre">length</span></code>, <code class="docutils literal notranslate"><span class="pre">offset</span></code> fields; it will also include other more specific information:</p> <ul class="simple"> <li>boolean field <code class="docutils literal notranslate"><span class="pre">data</span></code>: true if the sectors contain actual data, false if the sectors are either unallocated or stored as optimized all-zero clusters</li> <li>boolean field <code class="docutils literal notranslate"><span class="pre">zero</span></code>: true if the data is known to read as zero</li> <li>boolean field <code class="docutils literal notranslate"><span class="pre">present</span></code>: true if the data belongs to the backing chain, false if rebasing the backing chain onto a deeper file would pick up data from the deeper file;</li> <li>integer field <code class="docutils literal notranslate"><span class="pre">depth</span></code>: the depth within the backing chain at which the data was resolved; for example, a depth of 2 refers to the backing file of the backing file of <em>FILENAME</em>.</li> </ul> <p>In JSON format, the <code class="docutils literal notranslate"><span class="pre">offset</span></code> field is optional; it is absent in cases where <code class="docutils literal notranslate"><span class="pre">human</span></code> format would omit the entry or exit with an error. If <code class="docutils literal notranslate"><span class="pre">data</span></code> is false and the <code class="docutils literal notranslate"><span class="pre">offset</span></code> field is present, the corresponding sectors in the file are not yet in use, but they are preallocated.</p> <p>For more information, consult <code class="docutils literal notranslate"><span class="pre">include/block/block.h</span></code> in QEMU’s source code.</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-commands-arg-measure"> <code class="descname">measure</code><code class="descclassname"> [--output=OFMT] [-O OUTPUT_FMT] [-o OPTIONS] [--size N | [--object OBJECTDEF] [--image-opts] [-f FMT] [-l SNAPSHOT_PARAM] FILENAME]</code><a class="headerlink" href="#cmdoption-qemu-img-commands-arg-measure" title="Permalink to this definition">¶</a></dt> <dd><p>Calculate the file size required for a new image. This information can be used to size logical volumes or SAN LUNs appropriately for the image that will be placed in them. The values reported are guaranteed to be large enough to fit the image. The command can output in the format <em>OFMT</em> which is either <code class="docutils literal notranslate"><span class="pre">human</span></code> or <code class="docutils literal notranslate"><span class="pre">json</span></code>. The JSON output is an object of QAPI type <code class="docutils literal notranslate"><span class="pre">BlockMeasureInfo</span></code>.</p> <p>If the size <em>N</em> is given then act as if creating a new empty image file using <code class="docutils literal notranslate"><span class="pre">qemu-img</span> <span class="pre">create</span></code>. If <em>FILENAME</em> is given then act as if converting an existing image file using <code class="docutils literal notranslate"><span class="pre">qemu-img</span> <span class="pre">convert</span></code>. The format of the new file is given by <em>OUTPUT_FMT</em> while the format of an existing file is given by <em>FMT</em>.</p> <p>A snapshot in an existing image can be specified using <em>SNAPSHOT_PARAM</em>.</p> <p>The following fields are reported:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">required</span> <span class="n">size</span><span class="p">:</span> <span class="mi">524288</span> <span class="n">fully</span> <span class="n">allocated</span> <span class="n">size</span><span class="p">:</span> <span class="mi">1074069504</span> <span class="n">bitmaps</span> <span class="n">size</span><span class="p">:</span> <span class="mi">0</span> </pre></div> </div> <p>The <code class="docutils literal notranslate"><span class="pre">required</span> <span class="pre">size</span></code> is the file size of the new image. It may be smaller than the virtual disk size if the image format supports compact representation.</p> <p>The <code class="docutils literal notranslate"><span class="pre">fully</span> <span class="pre">allocated</span> <span class="pre">size</span></code> is the file size of the new image once data has been written to all sectors. This is the maximum size that the image file can occupy with the exception of internal snapshots, dirty bitmaps, vmstate data, and other advanced image format features.</p> <p>The <code class="docutils literal notranslate"><span class="pre">bitmaps</span> <span class="pre">size</span></code> is the additional size required in order to copy bitmaps from a source image in addition to the guest-visible data; the line is omitted if either source or destination lacks bitmap support, or 0 if bitmaps are supported but there is nothing to copy.</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-commands-arg-snapshot"> <code class="descname">snapshot</code><code class="descclassname"> [--object OBJECTDEF] [--image-opts] [-U] [-q] [-l | -a SNAPSHOT | -c SNAPSHOT | -d SNAPSHOT] FILENAME</code><a class="headerlink" href="#cmdoption-qemu-img-commands-arg-snapshot" title="Permalink to this definition">¶</a></dt> <dd><p>List, apply, create or delete snapshots in image <em>FILENAME</em>.</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-commands-arg-rebase"> <code class="descname">rebase</code><code class="descclassname"> [--object OBJECTDEF] [--image-opts] [-U] [-q] [-f FMT] [-t CACHE] [-T SRC_CACHE] [-p] [-u] -b BACKING_FILE [-F BACKING_FMT] FILENAME</code><a class="headerlink" href="#cmdoption-qemu-img-commands-arg-rebase" title="Permalink to this definition">¶</a></dt> <dd><p>Changes the backing file of an image. Only the formats <code class="docutils literal notranslate"><span class="pre">qcow2</span></code> and <code class="docutils literal notranslate"><span class="pre">qed</span></code> support changing the backing file.</p> <p>The backing file is changed to <em>BACKING_FILE</em> and (if the image format of <em>FILENAME</em> supports this) the backing file format is changed to <em>BACKING_FMT</em>. If <em>BACKING_FILE</em> is specified as “” (the empty string), then the image is rebased onto no backing file (i.e. it will exist independently of any backing file).</p> <p>If a relative path name is given, the backing file is looked up relative to the directory containing <em>FILENAME</em>.</p> <p><em>CACHE</em> specifies the cache mode to be used for <em>FILENAME</em>, whereas <em>SRC_CACHE</em> specifies the cache mode for reading backing files.</p> <p>There are two different modes in which <code class="docutils literal notranslate"><span class="pre">rebase</span></code> can operate:</p> <dl class="docutils"> <dt>Safe mode</dt> <dd><p class="first">This is the default mode and performs a real rebase operation. The new backing file may differ from the old one and <code class="docutils literal notranslate"><span class="pre">qemu-img</span> <span class="pre">rebase</span></code> will take care of keeping the guest-visible content of <em>FILENAME</em> unchanged.</p> <p>In order to achieve this, any clusters that differ between <em>BACKING_FILE</em> and the old backing file of <em>FILENAME</em> are merged into <em>FILENAME</em> before actually changing the backing file.</p> <p class="last">Note that the safe mode is an expensive operation, comparable to converting an image. It only works if the old backing file still exists.</p> </dd> <dt>Unsafe mode</dt> <dd><p class="first"><code class="docutils literal notranslate"><span class="pre">qemu-img</span></code> uses the unsafe mode if <code class="docutils literal notranslate"><span class="pre">-u</span></code> is specified. In this mode, only the backing file name and format of <em>FILENAME</em> is changed without any checks on the file contents. The user must take care of specifying the correct new backing file, or the guest-visible content of the image will be corrupted.</p> <p class="last">This mode is useful for renaming or moving the backing file to somewhere else. It can be used without an accessible old backing file, i.e. you can use it to fix an image whose backing file has already been moved/renamed.</p> </dd> </dl> <p>You can use <code class="docutils literal notranslate"><span class="pre">rebase</span></code> to perform a “diff” operation on two disk images. This can be useful when you have copied or cloned a guest, and you want to get back to a thin image on top of a template or base image.</p> <p>Say that <code class="docutils literal notranslate"><span class="pre">base.img</span></code> has been cloned as <code class="docutils literal notranslate"><span class="pre">modified.img</span></code> by copying it, and that the <code class="docutils literal notranslate"><span class="pre">modified.img</span></code> guest has run so there are now some changes compared to <code class="docutils literal notranslate"><span class="pre">base.img</span></code>. To construct a thin image called <code class="docutils literal notranslate"><span class="pre">diff.qcow2</span></code> that contains just the differences, do:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">qemu</span><span class="o">-</span><span class="n">img</span> <span class="n">create</span> <span class="o">-</span><span class="n">f</span> <span class="n">qcow2</span> <span class="o">-</span><span class="n">b</span> <span class="n">modified</span><span class="o">.</span><span class="n">img</span> <span class="n">diff</span><span class="o">.</span><span class="n">qcow2</span> <span class="n">qemu</span><span class="o">-</span><span class="n">img</span> <span class="n">rebase</span> <span class="o">-</span><span class="n">b</span> <span class="n">base</span><span class="o">.</span><span class="n">img</span> <span class="n">diff</span><span class="o">.</span><span class="n">qcow2</span> </pre></div> </div> <p>At this point, <code class="docutils literal notranslate"><span class="pre">modified.img</span></code> can be discarded, since <code class="docutils literal notranslate"><span class="pre">base.img</span> <span class="pre">+</span> <span class="pre">diff.qcow2</span></code> contains the same information.</p> </dd></dl> <dl class="option"> <dt id="cmdoption-qemu-img-commands-arg-resize"> <code class="descname">resize</code><code class="descclassname"> [--object OBJECTDEF] [--image-opts] [-f FMT] [--preallocation=PREALLOC] [-q] [--shrink] FILENAME [+ | -]SIZE</code><a class="headerlink" href="#cmdoption-qemu-img-commands-arg-resize" title="Permalink to this definition">¶</a></dt> <dd><p>Change the disk image as if it had been created with <em>SIZE</em>.</p> <p>Before using this command to shrink a disk image, you MUST use file system and partitioning tools inside the VM to reduce allocated file systems and partition sizes accordingly. Failure to do so will result in data loss!</p> <p>When shrinking images, the <code class="docutils literal notranslate"><span class="pre">--shrink</span></code> option must be given. This informs <code class="docutils literal notranslate"><span class="pre">qemu-img</span></code> that the user acknowledges all loss of data beyond the truncated image’s end.</p> <p>After using this command to grow a disk image, you must use file system and partitioning tools inside the VM to actually begin using the new space on the device.</p> <p>When growing an image, the <code class="docutils literal notranslate"><span class="pre">--preallocation</span></code> option may be used to specify how the additional image area should be allocated on the host. See the format description in the <a class="reference internal" href="#notes"><span class="std std-ref">Notes</span></a> section which values are allowed. Using this option may result in slightly more data being allocated than necessary.</p> </dd></dl> </div> <div class="section" id="notes"> <span id="id3"></span><h2>Notes<a class="headerlink" href="#notes" title="Permalink to this headline">¶</a></h2> <p>Supported image file formats:</p> <p><code class="docutils literal notranslate"><span class="pre">raw</span></code></p> <blockquote> <div><p>Raw disk image format (default). This format has the advantage of being simple and easily exportable to all other emulators. If your file system supports <em>holes</em> (for example in ext2 or ext3 on Linux or NTFS on Windows), then only the written sectors will reserve space. Use <code class="docutils literal notranslate"><span class="pre">qemu-img</span> <span class="pre">info</span></code> to know the real size used by the image or <code class="docutils literal notranslate"><span class="pre">ls</span> <span class="pre">-ls</span></code> on Unix/Linux.</p> <p>Supported options:</p> <dl class="docutils"> <dt><code class="docutils literal notranslate"><span class="pre">preallocation</span></code></dt> <dd>Preallocation mode (allowed values: <code class="docutils literal notranslate"><span class="pre">off</span></code>, <code class="docutils literal notranslate"><span class="pre">falloc</span></code>, <code class="docutils literal notranslate"><span class="pre">full</span></code>). <code class="docutils literal notranslate"><span class="pre">falloc</span></code> mode preallocates space for image by calling <code class="docutils literal notranslate"><span class="pre">posix_fallocate()</span></code>. <code class="docutils literal notranslate"><span class="pre">full</span></code> mode preallocates space for image by writing data to underlying storage. This data may or may not be zero, depending on the storage location.</dd> </dl> </div></blockquote> <p><code class="docutils literal notranslate"><span class="pre">qcow2</span></code></p> <blockquote> <div><p>QEMU image format, the most versatile format. Use it to have smaller images (useful if your filesystem does not supports holes, for example on Windows), optional AES encryption, zlib based compression and support of multiple VM snapshots.</p> <p>Supported options:</p> <dl class="docutils"> <dt><code class="docutils literal notranslate"><span class="pre">compat</span></code></dt> <dd>Determines the qcow2 version to use. <code class="docutils literal notranslate"><span class="pre">compat=0.10</span></code> uses the traditional image format that can be read by any QEMU since 0.10. <code class="docutils literal notranslate"><span class="pre">compat=1.1</span></code> enables image format extensions that only QEMU 1.1 and newer understand (this is the default). Amongst others, this includes zero clusters, which allow efficient copy-on-read for sparse images.</dd> <dt><code class="docutils literal notranslate"><span class="pre">backing_file</span></code></dt> <dd>File name of a base image (see <code class="docutils literal notranslate"><span class="pre">create</span></code> subcommand)</dd> <dt><code class="docutils literal notranslate"><span class="pre">backing_fmt</span></code></dt> <dd>Image format of the base image</dd> <dt><code class="docutils literal notranslate"><span class="pre">encryption</span></code></dt> <dd><p class="first">If this option is set to <code class="docutils literal notranslate"><span class="pre">on</span></code>, the image is encrypted with 128-bit AES-CBC.</p> <p>The use of encryption in qcow and qcow2 images is considered to be flawed by modern cryptography standards, suffering from a number of design problems:</p> <ul class="simple"> <li>The AES-CBC cipher is used with predictable initialization vectors based on the sector number. This makes it vulnerable to chosen plaintext attacks which can reveal the existence of encrypted data.</li> <li>The user passphrase is directly used as the encryption key. A poorly chosen or short passphrase will compromise the security of the encryption.</li> <li>In the event of the passphrase being compromised there is no way to change the passphrase to protect data in any qcow images. The files must be cloned, using a different encryption passphrase in the new file. The original file must then be securely erased using a program like shred, though even this is ineffective with many modern storage technologies.</li> <li>Initialization vectors used to encrypt sectors are based on the guest virtual sector number, instead of the host physical sector. When a disk image has multiple internal snapshots this means that data in multiple physical sectors is encrypted with the same initialization vector. With the CBC mode, this opens the possibility of watermarking attacks if the attack can collect multiple sectors encrypted with the same IV and some predictable data. Having multiple qcow2 images with the same passphrase also exposes this weakness since the passphrase is directly used as the key.</li> </ul> <p class="last">Use of qcow / qcow2 encryption is thus strongly discouraged. Users are recommended to use an alternative encryption technology such as the Linux dm-crypt / LUKS system.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">cluster_size</span></code></dt> <dd>Changes the qcow2 cluster size (must be between 512 and 2M). Smaller cluster sizes can improve the image file size whereas larger cluster sizes generally provide better performance.</dd> <dt><code class="docutils literal notranslate"><span class="pre">preallocation</span></code></dt> <dd>Preallocation mode (allowed values: <code class="docutils literal notranslate"><span class="pre">off</span></code>, <code class="docutils literal notranslate"><span class="pre">metadata</span></code>, <code class="docutils literal notranslate"><span class="pre">falloc</span></code>, <code class="docutils literal notranslate"><span class="pre">full</span></code>). An image with preallocated metadata is initially larger but can improve performance when the image needs to grow. <code class="docutils literal notranslate"><span class="pre">falloc</span></code> and <code class="docutils literal notranslate"><span class="pre">full</span></code> preallocations are like the same options of <code class="docutils literal notranslate"><span class="pre">raw</span></code> format, but sets up metadata also.</dd> <dt><code class="docutils literal notranslate"><span class="pre">lazy_refcounts</span></code></dt> <dd><p class="first">If this option is set to <code class="docutils literal notranslate"><span class="pre">on</span></code>, reference count updates are postponed with the goal of avoiding metadata I/O and improving performance. This is particularly interesting with <code class="docutils literal notranslate"><span class="pre">cache=writethrough</span></code> which doesn’t batch metadata updates. The tradeoff is that after a host crash, the reference count tables must be rebuilt, i.e. on the next open an (automatic) <code class="docutils literal notranslate"><span class="pre">qemu-img</span> <span class="pre">check</span> <span class="pre">-r</span> <span class="pre">all</span></code> is required, which may take some time.</p> <p class="last">This option can only be enabled if <code class="docutils literal notranslate"><span class="pre">compat=1.1</span></code> is specified.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">nocow</span></code></dt> <dd><p class="first">If this option is set to <code class="docutils literal notranslate"><span class="pre">on</span></code>, it will turn off COW of the file. It’s only valid on btrfs, no effect on other file systems.</p> <p>Btrfs has low performance when hosting a VM image file, even more when the guest on the VM also using btrfs as file system. Turning off COW is a way to mitigate this bad performance. Generally there are two ways to turn off COW on btrfs:</p> <ul class="simple"> <li>Disable it by mounting with nodatacow, then all newly created files will be NOCOW</li> <li>For an empty file, add the NOCOW file attribute. That’s what this option does.</li> </ul> <p class="last">Note: this option is only valid to new or empty files. If there is an existing file which is COW and has data blocks already, it couldn’t be changed to NOCOW by setting <code class="docutils literal notranslate"><span class="pre">nocow=on</span></code>. One can issue <code class="docutils literal notranslate"><span class="pre">lsattr</span> <span class="pre">filename</span></code> to check if the NOCOW flag is set or not (Capital ‘C’ is NOCOW flag).</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">data_file</span></code></dt> <dd><p class="first">Filename where all guest data will be stored. If this option is used, the qcow2 file will only contain the image’s metadata.</p> <p class="last">Note: Data loss will occur if the given filename already exists when using this option with <code class="docutils literal notranslate"><span class="pre">qemu-img</span> <span class="pre">create</span></code> since <code class="docutils literal notranslate"><span class="pre">qemu-img</span></code> will create the data file anew, overwriting the file’s original contents. To simply update the reference to point to the given pre-existing file, use <code class="docutils literal notranslate"><span class="pre">qemu-img</span> <span class="pre">amend</span></code>.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">data_file_raw</span></code></dt> <dd><p class="first">If this option is set to <code class="docutils literal notranslate"><span class="pre">on</span></code>, QEMU will always keep the external data file consistent as a standalone read-only raw image.</p> <p>It does this by forwarding all write accesses to the qcow2 file through to the raw data file, including their offsets. Therefore, data that is visible on the qcow2 node (i.e., to the guest) at some offset is visible at the same offset in the raw data file. This results in a read-only raw image. Writes that bypass the qcow2 metadata may corrupt the qcow2 metadata because the out-of-band writes may result in the metadata falling out of sync with the raw image.</p> <p>If this option is <code class="docutils literal notranslate"><span class="pre">off</span></code>, QEMU will use the data file to store data in an arbitrary manner. The file’s content will not make sense without the accompanying qcow2 metadata. Where data is written will have no relation to its offset as seen by the guest, and some writes (specifically zero writes) may not be forwarded to the data file at all, but will only be handled by modifying qcow2 metadata.</p> <p class="last">This option can only be enabled if <code class="docutils literal notranslate"><span class="pre">data_file</span></code> is set.</p> </dd> </dl> </div></blockquote> <p><code class="docutils literal notranslate"><span class="pre">Other</span></code></p> <blockquote> <div><p>QEMU also supports various other image file formats for compatibility with older QEMU versions or other hypervisors, including VMDK, VDI, VHD (vpc), VHDX, qcow1 and QED. For a full list of supported formats see <code class="docutils literal notranslate"><span class="pre">qemu-img</span> <span class="pre">--help</span></code>. For a more detailed description of these formats, see the QEMU block drivers reference documentation.</p> <p>The main purpose of the block drivers for these formats is image conversion. For running VMs, it is recommended to convert the disk images to either raw or qcow2 in order to achieve good performance.</p> </div></blockquote> </div> </div> </div> </div> <footer> <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> <a href="qemu-storage-daemon.html" class="btn btn-neutral float-right" title="QEMU Storage Daemon" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> <a href="index.html" class="btn btn-neutral" title="Tools" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> </div> <hr/> <div role="contentinfo"> <p> © Copyright 2021, The QEMU Project Developers. </p> </div> Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. <!-- Empty para to force a blank line after "Built with Sphinx ..." --> <p></p> <p>This documentation is for QEMU version 6.2.0.</p> <p><a href="../about/license.html">QEMU and this manual are released under the GNU General Public License, version 2.</a></p> </footer> </div> </div> </section> </div> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT:'../', VERSION:'qemu-kvm-6.2.0-53.module+el8.10.0+2055+8eb7870b.4', LANGUAGE:'None', COLLAPSE_INDEX:false, FILE_SUFFIX:'.html', HAS_SOURCE: false, SOURCELINK_SUFFIX: '.txt' }; </script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <script type="text/javascript" src="../_static/js/theme.js"></script> <script type="text/javascript"> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); </script> </body> </html>