.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "QEMU-IMG.1 1" .TH QEMU-IMG.1 1 "2020-07-24" " " " " .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" qemu\-img \- QEMU disk image utility .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBqemu-img\fR [\fIstandard\fR \fIoptions\fR] \fIcommand\fR [\fIcommand\fR \fIoptions\fR] .SH "DESCRIPTION" .IX Header "DESCRIPTION" qemu-img allows you to create, convert and modify images offline. It can handle all image formats supported by \s-1QEMU.\s0 .PP \&\fBWarning:\fR 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. .SH "OPTIONS" .IX Header "OPTIONS" Standard options: .IP "\fB\-h, \-\-help\fR" 4 .IX Item "-h, --help" Display this help and exit .IP "\fB\-V, \-\-version\fR" 4 .IX Item "-V, --version" Display version information and exit .IP "\fB\-T, \-\-trace [[enable=]\fR\fIpattern\fR\fB][,events=\fR\fIfile\fR\fB][,file=\fR\fIfile\fR\fB]\fR" 4 .IX Item "-T, --trace [[enable=]pattern][,events=file][,file=file]" Specify tracing options. .RS 4 .IP "\fB[enable=]\fR\fIpattern\fR" 4 .IX Item "[enable=]pattern" Immediately enable events matching \fIpattern\fR (either event name or a globbing pattern). This option is only available if \s-1QEMU\s0 has been compiled with the \fIsimple\fR, \fIlog\fR or \fIftrace\fR tracing backend. To specify multiple events or patterns, specify the \fB\-trace\fR option multiple times. .Sp Use \f(CW\*(C`\-trace help\*(C'\fR to print a list of names of trace points. .IP "\fBevents=\fR\fIfile\fR" 4 .IX Item "events=file" Immediately enable events listed in \fIfile\fR. The file must contain one event name (as listed in the \fItrace-events-all\fR file) per line; globbing patterns are accepted too. This option is only available if \s-1QEMU\s0 has been compiled with the \fIsimple\fR, \fIlog\fR or \&\fIftrace\fR tracing backend. .IP "\fBfile=\fR\fIfile\fR" 4 .IX Item "file=file" Log output traces to \fIfile\fR. This option is only available if \s-1QEMU\s0 has been compiled with the \fIsimple\fR tracing backend. .RE .RS 4 .RE .PP The following commands are supported: .IP "\fBamend [\-\-object\fR \fIobjectdef\fR\fB] [\-\-image\-opts] [\-p] [\-q] [\-f\fR \fIfmt\fR\fB] [\-t\fR \fIcache\fR\fB] \-o\fR \fIoptions\fR\fB \fR\fIfilename\fR" 4 .IX Item "amend [--object objectdef] [--image-opts] [-p] [-q] [-f fmt] [-t cache] -o options filename" .PD 0 .IP "\fBbench [\-c\fR \fIcount\fR\fB] [\-d\fR \fIdepth\fR\fB] [\-f\fR \fIfmt\fR\fB] [\-\-flush\-interval=\fR\fIflush_interval\fR\fB] [\-n] [\-\-no\-drain] [\-o\fR \fIoffset\fR\fB] [\-\-pattern=\fR\fIpattern\fR\fB] [\-q] [\-s\fR \fIbuffer_size\fR\fB] [\-S\fR \fIstep_size\fR\fB] [\-t\fR \fIcache\fR\fB] [\-w] [\-U]\fR \fIfilename\fR" 4 .IX Item "bench [-c count] [-d depth] [-f fmt] [--flush-interval=flush_interval] [-n] [--no-drain] [-o offset] [--pattern=pattern] [-q] [-s buffer_size] [-S step_size] [-t cache] [-w] [-U] filename" .IP "\fBcheck [\-\-object\fR \fIobjectdef\fR\fB] [\-\-image\-opts] [\-q] [\-f\fR \fIfmt\fR\fB] [\-\-output=\fR\fIofmt\fR\fB] [\-r [leaks | all]] [\-T\fR \fIsrc_cache\fR\fB] [\-U]\fR \fIfilename\fR" 4 .IX Item "check [--object objectdef] [--image-opts] [-q] [-f fmt] [--output=ofmt] [-r [leaks | all]] [-T src_cache] [-U] filename" .IP "\fBcommit [\-\-object\fR \fIobjectdef\fR\fB] [\-\-image\-opts] [\-q] [\-f\fR \fIfmt\fR\fB] [\-t\fR \fIcache\fR\fB] [\-b\fR \fIbase\fR\fB] [\-d] [\-p]\fR \fIfilename\fR" 4 .IX Item "commit [--object objectdef] [--image-opts] [-q] [-f fmt] [-t cache] [-b base] [-d] [-p] filename" .IP "\fBcompare [\-\-object\fR \fIobjectdef\fR\fB] [\-\-image\-opts] [\-f\fR \fIfmt\fR\fB] [\-F\fR \fIfmt\fR\fB] [\-T\fR \fIsrc_cache\fR\fB] [\-p] [\-q] [\-s] [\-U]\fR \fIfilename1\fR\fB \fR\fIfilename2\fR" 4 .IX Item "compare [--object objectdef] [--image-opts] [-f fmt] [-F fmt] [-T src_cache] [-p] [-q] [-s] [-U] filename1 filename2" .IP "\fBconvert [\-\-object\fR \fIobjectdef\fR\fB] [\-\-image\-opts] [\-\-target\-image\-opts] [\-U] [\-c] [\-p] [\-q] [\-n] [\-f\fR \fIfmt\fR\fB] [\-t\fR \fIcache\fR\fB] [\-T\fR \fIsrc_cache\fR\fB] [\-O\fR \fIoutput_fmt\fR\fB] [\-B\fR \fIbacking_file\fR\fB] [\-o\fR \fIoptions\fR\fB] [\-l\fR \fIsnapshot_param\fR\fB] [\-S\fR \fIsparse_size\fR\fB] [\-m\fR \fInum_coroutines\fR\fB] [\-W]\fR \fIfilename\fR \fB[\fR\fIfilename2\fR \fB[...]]\fR \fIoutput_filename\fR" 4 .IX Item "convert [--object objectdef] [--image-opts] [--target-image-opts] [-U] [-c] [-p] [-q] [-n] [-f fmt] [-t cache] [-T src_cache] [-O output_fmt] [-B backing_file] [-o options] [-l snapshot_param] [-S sparse_size] [-m num_coroutines] [-W] filename [filename2 [...]] output_filename" .IP "\fBcreate [\-\-object\fR \fIobjectdef\fR\fB] [\-q] [\-f\fR \fIfmt\fR\fB] [\-b\fR \fIbacking_file\fR\fB] [\-F\fR \fIbacking_fmt\fR\fB] [\-u] [\-o\fR \fIoptions\fR\fB]\fR \fIfilename\fR \fB[\fR\fIsize\fR\fB]\fR" 4 .IX Item "create [--object objectdef] [-q] [-f fmt] [-b backing_file] [-F backing_fmt] [-u] [-o options] filename [size]" .IP "\fBdd [\-\-image\-opts] [\-U] [\-f\fR \fIfmt\fR\fB] [\-O\fR \fIoutput_fmt\fR\fB] [bs=\fR\fIblock_size\fR\fB] [count=\fR\fIblocks\fR\fB] [skip=\fR\fIblocks\fR\fB] if=\fR\fIinput\fR \fBof=\fR\fIoutput\fR" 4 .IX Item "dd [--image-opts] [-U] [-f fmt] [-O output_fmt] [bs=block_size] [count=blocks] [skip=blocks] if=input of=output" .IP "\fBinfo [\-\-object\fR \fIobjectdef\fR\fB] [\-\-image\-opts] [\-f\fR \fIfmt\fR\fB] [\-\-output=\fR\fIofmt\fR\fB] [\-\-backing\-chain] [\-U]\fR \fIfilename\fR" 4 .IX Item "info [--object objectdef] [--image-opts] [-f fmt] [--output=ofmt] [--backing-chain] [-U] filename" .IP "\fBmap [\-\-object\fR \fIobjectdef\fR\fB] [\-\-image\-opts] [\-f\fR \fIfmt\fR\fB] [\-\-output=\fR\fIofmt\fR\fB] [\-U]\fR \fIfilename\fR" 4 .IX Item "map [--object objectdef] [--image-opts] [-f fmt] [--output=ofmt] [-U] filename" .IP "\fBmeasure [\-\-output=\fR\fIofmt\fR\fB] [\-O\fR \fIoutput_fmt\fR\fB] [\-o\fR \fIoptions\fR\fB] [\-\-size\fR \fIN\fR \fB| [\-\-object\fR \fIobjectdef\fR\fB] [\-\-image\-opts] [\-f\fR \fIfmt\fR\fB] [\-l\fR \fIsnapshot_param\fR\fB]\fR \fIfilename\fR\fB]\fR" 4 .IX Item "measure [--output=ofmt] [-O output_fmt] [-o options] [--size N | [--object objectdef] [--image-opts] [-f fmt] [-l snapshot_param] filename]" .IP "\fBsnapshot [\-\-object\fR \fIobjectdef\fR\fB] [\-\-image\-opts] [\-U] [\-q] [\-l | \-a\fR \fIsnapshot\fR \fB| \-c\fR \fIsnapshot\fR \fB| \-d\fR \fIsnapshot\fR\fB]\fR \fIfilename\fR" 4 .IX Item "snapshot [--object objectdef] [--image-opts] [-U] [-q] [-l | -a snapshot | -c snapshot | -d snapshot] filename" .IP "\fBrebase [\-\-object\fR \fIobjectdef\fR\fB] [\-\-image\-opts] [\-U] [\-q] [\-f\fR \fIfmt\fR\fB] [\-t\fR \fIcache\fR\fB] [\-T\fR \fIsrc_cache\fR\fB] [\-p] [\-u] \-b\fR \fIbacking_file\fR \fB[\-F\fR \fIbacking_fmt\fR\fB]\fR \fIfilename\fR" 4 .IX Item "rebase [--object objectdef] [--image-opts] [-U] [-q] [-f fmt] [-t cache] [-T src_cache] [-p] [-u] -b backing_file [-F backing_fmt] filename" .IP "\fBresize [\-\-object\fR \fIobjectdef\fR\fB] [\-\-image\-opts] [\-f\fR \fIfmt\fR\fB] [\-\-preallocation=\fR\fIprealloc\fR\fB] [\-q] [\-\-shrink]\fR \fIfilename\fR \fB[+ | \-]\fR\fIsize\fR" 4 .IX Item "resize [--object objectdef] [--image-opts] [-f fmt] [--preallocation=prealloc] [-q] [--shrink] filename [+ | -]size" .PD .PP Command parameters: .IP "\fIfilename\fR" 4 .IX Item "filename" is a disk image filename .IP "\fIfmt\fR" 4 .IX Item "fmt" is the disk image format. It is guessed automatically in most cases. See below for a description of the supported disk formats. .IP "\fIsize\fR" 4 .IX Item "size" is the disk image size in bytes. Optional suffixes \f(CW\*(C`k\*(C'\fR or \f(CW\*(C`K\*(C'\fR (kilobyte, 1024) \f(CW\*(C`M\*(C'\fR (megabyte, 1024k) and \f(CW\*(C`G\*(C'\fR (gigabyte, 1024M) and T (terabyte, 1024G) are supported. \f(CW\*(C`b\*(C'\fR is ignored. .IP "\fIoutput_filename\fR" 4 .IX Item "output_filename" is the destination disk image filename .IP "\fIoutput_fmt\fR" 4 .IX Item "output_fmt" is the destination format .IP "\fIoptions\fR" 4 .IX Item "options" is a comma separated list of format specific options in a name=value format. Use \f(CW\*(C`\-o ?\*(C'\fR for an overview of the options supported by the used format or see the format descriptions below for details. .IP "\fIsnapshot_param\fR" 4 .IX Item "snapshot_param" is param used for internal snapshot, format is \&'snapshot.id=[\s-1ID\s0],snapshot.name=[\s-1NAME\s0]' or '[\s-1ID_OR_NAME\s0]' .IP "\fB\-\-object\fR \fIobjectdef\fR" 4 .IX Item "--object objectdef" is a \s-1QEMU\s0 user creatable object definition. See the \f(CWqemu(1)\fR manual page for a description of the object properties. The most common object type is a \f(CW\*(C`secret\*(C'\fR, which is used to supply passwords and/or encryption keys. .IP "\fB\-\-image\-opts\fR" 4 .IX Item "--image-opts" Indicates that the source \fIfilename\fR parameter is to be interpreted as a full option string, not a plain filename. This parameter is mutually exclusive with the \fI\-f\fR parameter. .IP "\fB\-\-target\-image\-opts\fR" 4 .IX Item "--target-image-opts" Indicates that the \fIoutput_filename\fR parameter(s) are to be interpreted as a full option string, not a plain filename. This parameter is mutually exclusive with the \fI\-O\fR parameters. It is currently required to also use the \fI\-n\fR parameter to skip image creation. This restriction may be relaxed in a future release. .IP "\fB\-\-force\-share (\-U)\fR" 4 .IX Item "--force-share (-U)" If specified, \f(CW\*(C`qemu\-img\*(C'\fR will open the image in shared mode, allowing other \s-1QEMU\s0 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. .IP "\fB\-\-backing\-chain\fR" 4 .IX Item "--backing-chain" will enumerate information about backing files in a disk image chain. Refer below for further description. .IP "\fB\-c\fR" 4 .IX Item "-c" indicates that target image must be compressed (qcow format only) .IP "\fB\-h\fR" 4 .IX Item "-h" with or without a command shows help and lists the supported formats .IP "\fB\-p\fR" 4 .IX Item "-p" display progress bar (compare, convert and rebase commands only). If the \fI\-p\fR option is not used for a command that supports it, the progress is reported when the process receives a \f(CW\*(C`SIGUSR1\*(C'\fR or \&\f(CW\*(C`SIGINFO\*(C'\fR signal. .IP "\fB\-q\fR" 4 .IX Item "-q" Quiet mode \- do not print any output (except errors). There's no progress bar in case both \fI\-q\fR and \fI\-p\fR options are used. .IP "\fB\-S\fR \fIsize\fR" 4 .IX Item "-S size" indicates the consecutive number of bytes that must contain only zeros for qemu-img 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 \&\f(CW\*(C`k\*(C'\fR for kilobytes. .IP "\fB\-t\fR \fIcache\fR" 4 .IX Item "-t cache" specifies the cache mode that should be used with the (destination) file. See the documentation of the emulator's \f(CW\*(C`\-drive cache=...\*(C'\fR option for allowed values. .IP "\fB\-T\fR \fIsrc_cache\fR" 4 .IX Item "-T src_cache" specifies the cache mode that should be used with the source file(s). See the documentation of the emulator's \f(CW\*(C`\-drive cache=...\*(C'\fR option for allowed values. .PP Parameters to snapshot subcommand: .IP "\fBsnapshot\fR" 4 .IX Item "snapshot" is the name of the snapshot to create, apply or delete .IP "\fB\-a\fR" 4 .IX Item "-a" applies a snapshot (revert disk to saved state) .IP "\fB\-c\fR" 4 .IX Item "-c" creates a snapshot .IP "\fB\-d\fR" 4 .IX Item "-d" deletes a snapshot .IP "\fB\-l\fR" 4 .IX Item "-l" lists all snapshots in the given image .PP Parameters to compare subcommand: .IP "\fB\-f\fR" 4 .IX Item "-f" First image format .IP "\fB\-F\fR" 4 .IX Item "-F" Second image format .IP "\fB\-s\fR" 4 .IX Item "-s" Strict mode \- fail on different image size or sector allocation .PP Parameters to convert subcommand: .IP "\fB\-n\fR" 4 .IX Item "-n" Skip the creation of the target volume .IP "\fB\-m\fR" 4 .IX Item "-m" Number of parallel coroutines for the convert process .IP "\fB\-W\fR" 4 .IX Item "-W" 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. .IP "\fB\-C\fR" 4 .IX Item "-C" 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 \s-1NFS\s0 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. .PP Parameters to dd subcommand: .IP "\fBbs=\fR\fIblock_size\fR" 4 .IX Item "bs=block_size" defines the block size .IP "\fBcount=\fR\fIblocks\fR" 4 .IX Item "count=blocks" sets the number of input blocks to copy .IP "\fBif=\fR\fIinput\fR" 4 .IX Item "if=input" sets the input file .IP "\fBof=\fR\fIoutput\fR" 4 .IX Item "of=output" sets the output file .IP "\fBskip=\fR\fIblocks\fR" 4 .IX Item "skip=blocks" sets the number of input blocks to skip .PP Command description: .IP "\fBamend [\-\-object\fR \fIobjectdef\fR\fB] [\-\-image\-opts] [\-p] [\-p] [\-f\fR \fIfmt\fR\fB] [\-t\fR \fIcache\fR\fB] \-o\fR \fIoptions\fR\fB \fR\fIfilename\fR" 4 .IX Item "amend [--object objectdef] [--image-opts] [-p] [-p] [-f fmt] [-t cache] -o options filename" Amends the image format specific \fIoptions\fR for the image file \&\fIfilename\fR. Not all file formats support this operation. .IP "\fBbench [\-c\fR \fIcount\fR\fB] [\-d\fR \fIdepth\fR\fB] [\-f\fR \fIfmt\fR\fB] [\-\-flush\-interval=\fR\fIflush_interval\fR\fB] [\-n] [\-\-no\-drain] [\-o\fR \fIoffset\fR\fB] [\-\-pattern=\fR\fIpattern\fR\fB] [\-q] [\-s\fR \fIbuffer_size\fR\fB] [\-S\fR \fIstep_size\fR\fB] [\-t\fR \fIcache\fR\fB] [\-w] [\-U]\fR \fIfilename\fR" 4 .IX Item "bench [-c count] [-d depth] [-f fmt] [--flush-interval=flush_interval] [-n] [--no-drain] [-o offset] [--pattern=pattern] [-q] [-s buffer_size] [-S step_size] [-t cache] [-w] [-U] filename" Run a simple sequential I/O benchmark on the specified image. If \f(CW\*(C`\-w\*(C'\fR is specified, a write test is performed, otherwise a read test is performed. .Sp A total number of \fIcount\fR I/O requests is performed, each \fIbuffer_size\fR bytes in size, and with \fIdepth\fR requests in parallel. The first request starts at the position given by \fIoffset\fR, each following request increases the current position by \fIstep_size\fR. If \fIstep_size\fR is not given, \&\fIbuffer_size\fR is used for its value. .Sp If \fIflush_interval\fR 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 \fIflush_interval\fR. If additionally \&\f(CW\*(C`\-\-no\-drain\*(C'\fR is specified, a flush is issued without draining the request queue first. .Sp If \f(CW\*(C`\-n\*(C'\fR is specified, the native \s-1AIO\s0 backend is used if possible. On Linux, this option only works if \f(CW\*(C`\-t none\*(C'\fR or \f(CW\*(C`\-t directsync\*(C'\fR is specified as well. .Sp For write tests, by default a buffer filled with zeros is written. This can be overridden with a pattern byte specified by \fIpattern\fR. .IP "\fBcheck [\-\-object\fR \fIobjectdef\fR\fB] [\-\-image\-opts] [\-q] [\-f\fR \fIfmt\fR\fB] [\-\-output=\fR\fIofmt\fR\fB] [\-r [leaks | all]] [\-T\fR \fIsrc_cache\fR\fB] [\-U]\fR \fIfilename\fR" 4 .IX Item "check [--object objectdef] [--image-opts] [-q] [-f fmt] [--output=ofmt] [-r [leaks | all]] [-T src_cache] [-U] filename" Perform a consistency check on the disk image \fIfilename\fR. The command can output in the format \fIofmt\fR which is either \f(CW\*(C`human\*(C'\fR or \f(CW\*(C`json\*(C'\fR. .Sp If \f(CW\*(C`\-r\*(C'\fR is specified, qemu-img tries to repair any inconsistencies found during the check. \f(CW\*(C`\-r leaks\*(C'\fR repairs only cluster leaks, whereas \&\f(CW\*(C`\-r all\*(C'\fR fixes all kinds of errors, with a higher risk of choosing the wrong fix or hiding corruption that has already occurred. .Sp Only the formats \f(CW\*(C`qcow2\*(C'\fR, \f(CW\*(C`qed\*(C'\fR and \f(CW\*(C`vdi\*(C'\fR support consistency checks. .Sp In case the image does not have any inconsistencies, check exits with \f(CW0\fR. 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: .RS 4 .IP "\fB0\fR" 4 .IX Item "0" Check completed, the image is (now) consistent .IP "\fB1\fR" 4 .IX Item "1" Check not completed because of internal errors .IP "\fB2\fR" 4 .IX Item "2" Check completed, image is corrupted .IP "\fB3\fR" 4 .IX Item "3" Check completed, image has leaked clusters, but is not corrupted .IP "\fB63\fR" 4 .IX Item "63" Checks are not supported by the image format .RE .RS 4 .Sp If \f(CW\*(C`\-r\*(C'\fR is specified, exit codes representing the image state refer to the state after (the attempt at) repairing it. That is, a successful \f(CW\*(C`\-r all\*(C'\fR will yield the exit code 0, independently of the image state before. .RE .IP "\fBcommit [\-\-object\fR \fIobjectdef\fR\fB] [\-\-image\-opts] [\-q] [\-f\fR \fIfmt\fR\fB] [\-t\fR \fIcache\fR\fB] [\-b\fR \fIbase\fR\fB] [\-d] [\-p]\fR \fIfilename\fR" 4 .IX Item "commit [--object objectdef] [--image-opts] [-q] [-f fmt] [-t cache] [-b base] [-d] [-p] filename" Commit the changes recorded in \fIfilename\fR 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. .Sp The image \fIfilename\fR is emptied after the operation has succeeded. If you do not need \fIfilename\fR afterwards and intend to drop it, you may skip emptying \&\fIfilename\fR by specifying the \f(CW\*(C`\-d\*(C'\fR flag. .Sp If the backing chain of the given image file \fIfilename\fR has more than one layer, the backing file into which the changes will be committed may be specified as \fIbase\fR (which has to be part of \fIfilename\fR's backing chain). If \fIbase\fR is not specified, the immediate backing file of the top image (which is \fIfilename\fR) will be used. Note that after a commit operation all images between \fIbase\fR and the top image will be invalid and may return garbage data when read. For this reason, \f(CW\*(C`\-b\*(C'\fR implies \f(CW\*(C`\-d\*(C'\fR (so that the top image stays valid). .IP "\fBcompare [\-\-object\fR \fIobjectdef\fR\fB] [\-\-image\-opts] [\-f\fR \fIfmt\fR\fB] [\-F\fR \fIfmt\fR\fB] [\-T\fR \fIsrc_cache\fR\fB] [\-p] [\-q] [\-s] [\-U]\fR \fIfilename1\fR\fB \fR\fIfilename2\fR" 4 .IX Item "compare [--object objectdef] [--image-opts] [-f fmt] [-F fmt] [-T src_cache] [-p] [-q] [-s] [-U] filename1 filename2" Check if two images have the same content. You can compare images with different format or settings. .Sp The format is probed unless you specify it by \fI\-f\fR (used for \&\fIfilename1\fR) and/or \fI\-F\fR (used for \fIfilename2\fR) option. .Sp 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 \fI\-s\fR 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. .Sp 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. .Sp Compare exits with \f(CW0\fR in case the images are equal and with \f(CW1\fR 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: .RS 4 .IP "\fB0\fR" 4 .IX Item "0" Images are identical .IP "\fB1\fR" 4 .IX Item "1" Images differ .IP "\fB2\fR" 4 .IX Item "2" Error on opening an image .IP "\fB3\fR" 4 .IX Item "3" Error on checking a sector allocation .IP "\fB4\fR" 4 .IX Item "4" Error on reading data .RE .RS 4 .RE .IP "\fBconvert [\-\-object\fR \fIobjectdef\fR\fB] [\-\-image\-opts] [\-\-target\-image\-opts] [\-U] [\-C] [\-c] [\-p] [\-q] [\-n] [\-f\fR \fIfmt\fR\fB] [\-t\fR \fIcache\fR\fB] [\-T\fR \fIsrc_cache\fR\fB] [\-O\fR \fIoutput_fmt\fR\fB] [\-B\fR \fIbacking_file\fR\fB] [\-o\fR \fIoptions\fR\fB] [\-l\fR \fIsnapshot_param\fR\fB] [\-S\fR \fIsparse_size\fR\fB] [\-m\fR \fInum_coroutines\fR\fB] [\-W]\fR \fIfilename\fR \fB[\fR\fIfilename2\fR \fB[...]]\fR \fIoutput_filename\fR" 4 .IX Item "convert [--object objectdef] [--image-opts] [--target-image-opts] [-U] [-C] [-c] [-p] [-q] [-n] [-f fmt] [-t cache] [-T src_cache] [-O output_fmt] [-B backing_file] [-o options] [-l snapshot_param] [-S sparse_size] [-m num_coroutines] [-W] filename [filename2 [...]] output_filename" Convert the disk image \fIfilename\fR or a snapshot \fIsnapshot_param\fR to disk image \fIoutput_filename\fR using format \fIoutput_fmt\fR. It can be optionally compressed (\f(CW\*(C`\-c\*(C'\fR option) or use any format specific options like encryption (\f(CW\*(C`\-o\*(C'\fR option). .Sp Only the formats \f(CW\*(C`qcow\*(C'\fR and \f(CW\*(C`qcow2\*(C'\fR support compression. The compression is read-only. It means that if a compressed sector is rewritten, then it is rewritten as uncompressed data. .Sp Image conversion is also useful to get smaller image when using a growable format such as \f(CW\*(C`qcow\*(C'\fR: the empty sectors are detected and suppressed from the destination image. .Sp \&\fIsparse_size\fR indicates the consecutive number of bytes (defaults to 4k) that must contain only zeros for qemu-img to create a sparse image during conversion. If \fIsparse_size\fR is 0, the source will not be scanned for unallocated or zero sectors, and the destination image will always be fully allocated. .Sp You can use the \fIbacking_file\fR option to force the output image to be created as a copy on write image of the specified base image; the \&\fIbacking_file\fR should have the same content as the input's base image, however the path, image format, etc may differ. .Sp If a relative path name is given, the backing file is looked up relative to the directory containing \fIoutput_filename\fR. .Sp If the \f(CW\*(C`\-n\*(C'\fR option is specified, the target volume creation will be skipped. This is useful for formats such as \f(CW\*(C`rbd\*(C'\fR if the target volume has already been created with site specific options that cannot be supplied through qemu-img. .Sp Out of order writes can be enabled with \f(CW\*(C`\-W\*(C'\fR 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. .Sp \&\fInum_coroutines\fR specifies how many coroutines work in parallel during the convert process (defaults to 8). .IP "\fBcreate [\-\-object\fR \fIobjectdef\fR\fB] [\-q] [\-f\fR \fIfmt\fR\fB] [\-b\fR \fIbacking_file\fR\fB] [\-F\fR \fIbacking_fmt\fR\fB] [\-u] [\-o\fR \fIoptions\fR\fB]\fR \fIfilename\fR \fB[\fR\fIsize\fR\fB]\fR" 4 .IX Item "create [--object objectdef] [-q] [-f fmt] [-b backing_file] [-F backing_fmt] [-u] [-o options] filename [size]" Create the new disk image \fIfilename\fR of size \fIsize\fR and format \&\fIfmt\fR. Depending on the file format, you can add one or more \fIoptions\fR that enable additional features of this format. .Sp If the option \fIbacking_file\fR is specified, then the image will record only the differences from \fIbacking_file\fR. No size needs to be specified in this case. \fIbacking_file\fR will never be modified unless you use the \&\f(CW\*(C`commit\*(C'\fR monitor command (or qemu-img commit). .Sp If a relative path name is given, the backing file is looked up relative to the directory containing \fIfilename\fR. .Sp Note that a given backing file will be opened to check that it is valid. Use the \f(CW\*(C`\-u\*(C'\fR 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. .Sp The size can also be specified using the \fIsize\fR option with \f(CW\*(C`\-o\*(C'\fR, it doesn't need to be specified separately in this case. .IP "\fBdd [\-\-image\-opts] [\-U] [\-f\fR \fIfmt\fR\fB] [\-O\fR \fIoutput_fmt\fR\fB] [bs=\fR\fIblock_size\fR\fB] [count=\fR\fIblocks\fR\fB] [skip=\fR\fIblocks\fR\fB] if=\fR\fIinput\fR \fBof=\fR\fIoutput\fR" 4 .IX Item "dd [--image-opts] [-U] [-f fmt] [-O output_fmt] [bs=block_size] [count=blocks] [skip=blocks] if=input of=output" Dd copies from \fIinput\fR file to \fIoutput\fR file converting it from \&\fIfmt\fR format to \fIoutput_fmt\fR format. .Sp The data is by default read and written using blocks of 512 bytes but can be modified by specifying \fIblock_size\fR. If count=\fIblocks\fR is specified dd will stop reading input after reading \fIblocks\fR input blocks. .Sp The size syntax is similar to \fBdd\fR\|(1)'s size syntax. .IP "\fBinfo [\-\-object\fR \fIobjectdef\fR\fB] [\-\-image\-opts] [\-f\fR \fIfmt\fR\fB] [\-\-output=\fR\fIofmt\fR\fB] [\-\-backing\-chain] [\-U]\fR \fIfilename\fR" 4 .IX Item "info [--object objectdef] [--image-opts] [-f fmt] [--output=ofmt] [--backing-chain] [-U] filename" Give information about the disk image \fIfilename\fR. Use it in particular to know the size reserved on disk which can be different from the displayed size. If \s-1VM\s0 snapshots are stored in the disk image, they are displayed too. The command can output in the format \fIofmt\fR which is either \f(CW\*(C`human\*(C'\fR or \f(CW\*(C`json\*(C'\fR. .Sp 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 \f(CW\*(C`\-\-backing\-chain\*(C'\fR. .Sp For instance, if you have an image chain like: .Sp .Vb 1 \& base.qcow2 <\- snap1.qcow2 <\- snap2.qcow2 .Ve .Sp To enumerate information about each disk image in the above chain, starting from top to base, do: .Sp .Vb 1 \& qemu\-img info \-\-backing\-chain snap2.qcow2 .Ve .IP "\fBmap [\-f\fR \fIfmt\fR\fB] [\-\-output=\fR\fIofmt\fR\fB]\fR \fIfilename\fR" 4 .IX Item "map [-f fmt] [--output=ofmt] filename" Dump the metadata of image \fIfilename\fR and its backing file chain. In particular, this commands dumps the allocation state of every sector of \fIfilename\fR, together with the topmost file that allocates it in the backing file chain. .Sp Two option formats are possible. The default format (\f(CW\*(C`human\*(C'\fR) 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. \fBqemu-img\fR 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: .Sp .Vb 3 \& Offset Length Mapped to File \& 0 0x20000 0x50000 /tmp/overlay.qcow2 \& 0x100000 0x10000 0x95380000 /tmp/backing.qcow2 .Ve .Sp means that 0x20000 (131072) bytes starting at offset 0 in the image are available in /tmp/overlay.qcow2 (opened in \f(CW\*(C`raw\*(C'\fR format) starting at offset 0x50000 (327680). Data that is compressed, encrypted, or otherwise not available in raw format will cause an error if \f(CW\*(C`human\*(C'\fR format is in use. Note that file names can include newlines, thus it is not safe to parse this output format in scripts. .Sp The alternative format \f(CW\*(C`json\*(C'\fR will return an array of dictionaries in \s-1JSON\s0 format. It will include similar information in the \f(CW\*(C`start\*(C'\fR, \f(CW\*(C`length\*(C'\fR, \f(CW\*(C`offset\*(C'\fR fields; it will also include other more specific information: .RS 4 .IP "\-" 4 whether the sectors contain actual data or not (boolean field \f(CW\*(C`data\*(C'\fR; if false, the sectors are either unallocated or stored as optimized all-zero clusters); .IP "\-" 4 whether the data is known to read as zero (boolean field \f(CW\*(C`zero\*(C'\fR); .IP "\-" 4 in order to make the output shorter, the target file is expressed as a \f(CW\*(C`depth\*(C'\fR; for example, a depth of 2 refers to the backing file of the backing file of \fIfilename\fR. .RE .RS 4 .Sp In \s-1JSON\s0 format, the \f(CW\*(C`offset\*(C'\fR field is optional; it is absent in cases where \f(CW\*(C`human\*(C'\fR format would omit the entry or exit with an error. If \f(CW\*(C`data\*(C'\fR is false and the \f(CW\*(C`offset\*(C'\fR field is present, the corresponding sectors in the file are not yet in use, but they are preallocated. .Sp For more information, consult \fIinclude/block/block.h\fR in \s-1QEMU\s0's source code. .RE .IP "\fBmeasure [\-\-output=\fR\fIofmt\fR\fB] [\-O\fR \fIoutput_fmt\fR\fB] [\-o\fR \fIoptions\fR\fB] [\-\-size\fR \fIN\fR \fB| [\-\-object\fR \fIobjectdef\fR\fB] [\-\-image\-opts] [\-f\fR \fIfmt\fR\fB] [\-l\fR \fIsnapshot_param\fR\fB]\fR \fIfilename\fR\fB]\fR" 4 .IX Item "measure [--output=ofmt] [-O output_fmt] [-o options] [--size N | [--object objectdef] [--image-opts] [-f fmt] [-l snapshot_param] filename]" Calculate the file size required for a new image. This information can be used to size logical volumes or \s-1SAN\s0 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 \fIofmt\fR which is either \&\f(CW\*(C`human\*(C'\fR or \f(CW\*(C`json\*(C'\fR. .Sp If the size \fIN\fR is given then act as if creating a new empty image file using \fBqemu-img create\fR. If \fIfilename\fR is given then act as if converting an existing image file using \fBqemu-img convert\fR. The format of the new file is given by \fIoutput_fmt\fR while the format of an existing file is given by \fIfmt\fR. .Sp A snapshot in an existing image can be specified using \fIsnapshot_param\fR. .Sp The following fields are reported: .Sp .Vb 2 \& required size: 524288 \& fully allocated size: 1074069504 .Ve .Sp The \f(CW\*(C`required size\*(C'\fR is the file size of the new image. It may be smaller than the virtual disk size if the image format supports compact representation. .Sp The \f(CW\*(C`fully allocated size\*(C'\fR 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. .IP "\fBsnapshot [\-\-object\fR \fIobjectdef\fR\fB] [\-\-image\-opts] [\-U] [\-q] [\-l | \-a\fR \fIsnapshot\fR \fB| \-c\fR \fIsnapshot\fR \fB| \-d\fR \fIsnapshot\fR\fB]\fR \fIfilename\fR" 4 .IX Item "snapshot [--object objectdef] [--image-opts] [-U] [-q] [-l | -a snapshot | -c snapshot | -d snapshot] filename" List, apply, create or delete snapshots in image \fIfilename\fR. .IP "\fBrebase [\-\-object\fR \fIobjectdef\fR\fB] [\-\-image\-opts] [\-U] [\-q] [\-f\fR \fIfmt\fR\fB] [\-t\fR \fIcache\fR\fB] [\-T\fR \fIsrc_cache\fR\fB] [\-p] [\-u] \-b\fR \fIbacking_file\fR \fB[\-F\fR \fIbacking_fmt\fR\fB]\fR \fIfilename\fR" 4 .IX Item "rebase [--object objectdef] [--image-opts] [-U] [-q] [-f fmt] [-t cache] [-T src_cache] [-p] [-u] -b backing_file [-F backing_fmt] filename" Changes the backing file of an image. Only the formats \f(CW\*(C`qcow2\*(C'\fR and \&\f(CW\*(C`qed\*(C'\fR support changing the backing file. .Sp The backing file is changed to \fIbacking_file\fR and (if the image format of \&\fIfilename\fR supports this) the backing file format is changed to \&\fIbacking_fmt\fR. If \fIbacking_file\fR 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). .Sp If a relative path name is given, the backing file is looked up relative to the directory containing \fIfilename\fR. .Sp \&\fIcache\fR specifies the cache mode to be used for \fIfilename\fR, whereas \&\fIsrc_cache\fR specifies the cache mode for reading backing files. .Sp There are two different modes in which \f(CW\*(C`rebase\*(C'\fR can operate: .RS 4 .IP "\fBSafe mode\fR" 4 .IX Item "Safe mode" This is the default mode and performs a real rebase operation. The new backing file may differ from the old one and qemu-img rebase will take care of keeping the guest-visible content of \fIfilename\fR unchanged. .Sp In order to achieve this, any clusters that differ between \fIbacking_file\fR and the old backing file of \fIfilename\fR are merged into \fIfilename\fR before actually changing the backing file. .Sp Note that the safe mode is an expensive operation, comparable to converting an image. It only works if the old backing file still exists. .IP "\fBUnsafe mode\fR" 4 .IX Item "Unsafe mode" qemu-img uses the unsafe mode if \f(CW\*(C`\-u\*(C'\fR is specified. In this mode, only the backing file name and format of \fIfilename\fR 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. .Sp 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. .RE .RS 4 .Sp You can use \f(CW\*(C`rebase\*(C'\fR to perform a \*(L"diff\*(R" 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. .Sp Say that \f(CW\*(C`base.img\*(C'\fR has been cloned as \f(CW\*(C`modified.img\*(C'\fR by copying it, and that the \f(CW\*(C`modified.img\*(C'\fR guest has run so there are now some changes compared to \f(CW\*(C`base.img\*(C'\fR. To construct a thin image called \f(CW\*(C`diff.qcow2\*(C'\fR that contains just the differences, do: .Sp .Vb 2 \& qemu\-img create \-f qcow2 \-b modified.img diff.qcow2 \& qemu\-img rebase \-b base.img diff.qcow2 .Ve .Sp At this point, \f(CW\*(C`modified.img\*(C'\fR can be discarded, since \&\f(CW\*(C`base.img + diff.qcow2\*(C'\fR contains the same information. .RE .IP "\fBresize [\-\-object\fR \fIobjectdef\fR\fB] [\-\-image\-opts] [\-f\fR \fIfmt\fR\fB] [\-\-preallocation=\fR\fIprealloc\fR\fB] [\-q] [\-\-shrink]\fR \fIfilename\fR \fB[+ | \-]\fR\fIsize\fR" 4 .IX Item "resize [--object objectdef] [--image-opts] [-f fmt] [--preallocation=prealloc] [-q] [--shrink] filename [+ | -]size" Change the disk image as if it had been created with \fIsize\fR. .Sp Before using this command to shrink a disk image, you \s-1MUST\s0 use file system and partitioning tools inside the \s-1VM\s0 to reduce allocated file systems and partition sizes accordingly. Failure to do so will result in data loss! .Sp When shrinking images, the \f(CW\*(C`\-\-shrink\*(C'\fR option must be given. This informs qemu-img that the user acknowledges all loss of data beyond the truncated image's end. .Sp After using this command to grow a disk image, you must use file system and partitioning tools inside the \s-1VM\s0 to actually begin using the new space on the device. .Sp When growing an image, the \f(CW\*(C`\-\-preallocation\*(C'\fR option may be used to specify how the additional image area should be allocated on the host. See the format description in the \f(CW\*(C`NOTES\*(C'\fR section which values are allowed. Using this option may result in slightly more data being allocated than necessary. .SH "NOTES" .IX Header "NOTES" Supported image file formats: .IP "\fBraw\fR" 4 .IX Item "raw" 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 \fIholes\fR (for example in ext2 or ext3 on Linux or \s-1NTFS\s0 on Windows), then only the written sectors will reserve space. Use \f(CW\*(C`qemu\-img info\*(C'\fR to know the real size used by the image or \f(CW\*(C`ls \-ls\*(C'\fR on Unix/Linux. .Sp Supported options: .RS 4 .ie n .IP """preallocation""" 4 .el .IP "\f(CWpreallocation\fR" 4 .IX Item "preallocation" Preallocation mode (allowed values: \f(CW\*(C`off\*(C'\fR, \f(CW\*(C`falloc\*(C'\fR, \f(CW\*(C`full\*(C'\fR). \&\f(CW\*(C`falloc\*(C'\fR mode preallocates space for image by calling \fBposix_fallocate()\fR. \&\f(CW\*(C`full\*(C'\fR mode preallocates space for image by writing zeros to underlying storage. .RE .RS 4 .RE .IP "\fBqcow2\fR" 4 .IX Item "qcow2" \&\s-1QEMU\s0 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 \s-1AES\s0 encryption, zlib based compression and support of multiple \s-1VM\s0 snapshots. .Sp Supported options: .RS 4 .ie n .IP """compat""" 4 .el .IP "\f(CWcompat\fR" 4 .IX Item "compat" Determines the qcow2 version to use. \f(CW\*(C`compat=0.10\*(C'\fR uses the traditional image format that can be read by any \s-1QEMU\s0 since 0.10. \&\f(CW\*(C`compat=1.1\*(C'\fR enables image format extensions that only \s-1QEMU 1.1\s0 and newer understand (this is the default). Amongst others, this includes zero clusters, which allow efficient copy-on-read for sparse images. .ie n .IP """backing_file""" 4 .el .IP "\f(CWbacking_file\fR" 4 .IX Item "backing_file" File name of a base image (see \fBcreate\fR subcommand) .ie n .IP """backing_fmt""" 4 .el .IP "\f(CWbacking_fmt\fR" 4 .IX Item "backing_fmt" Image format of the base image .ie n .IP """encryption""" 4 .el .IP "\f(CWencryption\fR" 4 .IX Item "encryption" If this option is set to \f(CW\*(C`on\*(C'\fR, the image is encrypted with 128\-bit AES-CBC. .Sp 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: .RS 4 .IP "\-" 4 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. .IP "\-" 4 The user passphrase is directly used as the encryption key. A poorly chosen or short passphrase will compromise the security of the encryption. .IP "\-" 4 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. .IP "\-" 4 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 \s-1CBC\s0 mode, this opens the possibility of watermarking attacks if the attack can collect multiple sectors encrypted with the same \s-1IV\s0 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. .RE .RS 4 .Sp Use of qcow / qcow2 encryption is thus strongly discouraged. Users are recommended to use an alternative encryption technology such as the Linux dm-crypt / \s-1LUKS\s0 system. .RE .ie n .IP """cluster_size""" 4 .el .IP "\f(CWcluster_size\fR" 4 .IX Item "cluster_size" 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. .ie n .IP """preallocation""" 4 .el .IP "\f(CWpreallocation\fR" 4 .IX Item "preallocation" Preallocation mode (allowed values: \f(CW\*(C`off\*(C'\fR, \f(CW\*(C`metadata\*(C'\fR, \f(CW\*(C`falloc\*(C'\fR, \&\f(CW\*(C`full\*(C'\fR). An image with preallocated metadata is initially larger but can improve performance when the image needs to grow. \f(CW\*(C`falloc\*(C'\fR and \f(CW\*(C`full\*(C'\fR preallocations are like the same options of \f(CW\*(C`raw\*(C'\fR format, but sets up metadata also. .ie n .IP """lazy_refcounts""" 4 .el .IP "\f(CWlazy_refcounts\fR" 4 .IX Item "lazy_refcounts" If this option is set to \f(CW\*(C`on\*(C'\fR, reference count updates are postponed with the goal of avoiding metadata I/O and improving performance. This is particularly interesting with \fBcache=writethrough\fR 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) \f(CW\*(C`qemu\-img check \-r all\*(C'\fR is required, which may take some time. .Sp This option can only be enabled if \f(CW\*(C`compat=1.1\*(C'\fR is specified. .ie n .IP """nocow""" 4 .el .IP "\f(CWnocow\fR" 4 .IX Item "nocow" If this option is set to \f(CW\*(C`on\*(C'\fR, it will turn off \s-1COW\s0 of the file. It's only valid on btrfs, no effect on other file systems. .Sp Btrfs has low performance when hosting a \s-1VM\s0 image file, even more when the guest on the \s-1VM\s0 also using btrfs as file system. Turning off \s-1COW\s0 is a way to mitigate this bad performance. Generally there are two ways to turn off \s-1COW\s0 on btrfs: a) Disable it by mounting with nodatacow, then all newly created files will be \&\s-1NOCOW.\s0 b) For an empty file, add the \s-1NOCOW\s0 file attribute. That's what this option does. .Sp Note: this option is only valid to new or empty files. If there is an existing file which is \s-1COW\s0 and has data blocks already, it couldn't be changed to \s-1NOCOW\s0 by setting \f(CW\*(C`nocow=on\*(C'\fR. One can issue \f(CW\*(C`lsattr filename\*(C'\fR to check if the \s-1NOCOW\s0 flag is set or not (Capital 'C' is \s-1NOCOW\s0 flag). .RE .RS 4 .RE .IP "\fBOther\fR" 4 .IX Item "Other" \&\s-1QEMU\s0 also supports various other image file formats for compatibility with older \s-1QEMU\s0 versions or other hypervisors, including \s-1VMDK, VDI, VHD\s0 (vpc), \s-1VHDX,\s0 qcow1 and \s-1QED.\s0 For a full list of supported formats see \f(CW\*(C`qemu\-img \-\-help\*(C'\fR. For a more detailed description of these formats, see the \s-1QEMU\s0 Emulation User Documentation. .Sp 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. .SH "SEE ALSO" .IX Header "SEE ALSO" The \s-1HTML\s0 documentation of \s-1QEMU\s0 for more precise information and Linux user mode emulator invocation. .SH "AUTHOR" .IX Header "AUTHOR" Fabrice Bellard