Documentation: Move image format descriptions to own section
[qemu.git] / qemu-img.texi
blobdd248eadc5cf44e132d3cc82f79487dd56739132
1 @example
2 @c man begin SYNOPSIS
3 usage: qemu-img command [command options]
4 @c man end
5 @end example
7 @c man begin OPTIONS
9 The following commands are supported:
11 @include qemu-img-cmds.texi
13 Command parameters:
14 @table @var
15 @item filename
16  is a disk image filename
17 @item base_image
18 is the read-only disk image which is used as base for a copy on
19     write image; the copy on write image only stores the modified data
20 @item output_base_image
21 forces the output image to be created as a copy on write
22 image of the specified base image; @code{output_base_image} should have the same
23 content as the input's base image, however the path, image format, etc may
24 differ
25 @item base_fmt
26 is the disk image format of @var{base_image}. for more information look at @var{fmt}
27 @item fmt
28 is the disk image format. It is guessed automatically in most cases. See below
29 for a description of the supported disk formats.
31 @item size
32 is the disk image size in bytes. Optional suffixes @code{k} or @code{K}
33 (kilobyte, 1024) @code{M} (megabyte, 1024k) and @code{G} (gigabyte, 1024M)
34 and T (terabyte, 1024G) are supported.  @code{b} is ignored.
36 @item output_filename
37 is the destination disk image filename
39 @item output_fmt
40  is the destination format
41 @item options
42 is a comma separated list of format specific options in a
43 name=value format. Use @code{-o ?} for an overview of the options supported
44 by the used format
47 @item -c
48 indicates that target image must be compressed (qcow format only)
49 @item -h
50 with or without a command shows help and lists the supported formats
51 @end table
53 Parameters to snapshot subcommand:
55 @table @option
57 @item snapshot
58 is the name of the snapshot to create, apply or delete
59 @item -a
60 applies a snapshot (revert disk to saved state)
61 @item -c
62 creates a snapshot
63 @item -d
64 deletes a snapshot
65 @item -l
66 lists all snapshots in the given image
67 @end table
69 Command description:
71 @table @option
72 @item create [-F @var{base_fmt}] [-b @var{base_image}] [-f @var{fmt}] [-o @var{options}] @var{filename} [@var{size}]
74 Create the new disk image @var{filename} of size @var{size} and format
75 @var{fmt}.
77 If @var{base_image} is specified, then the image will record only the
78 differences from @var{base_image}. No size needs to be specified in
79 this case. @var{base_image} will never be modified unless you use the
80 @code{commit} monitor command.
82 The size can also be specified using the @var{size} option with @code{-o},
83 it doesn't need to be specified separately in this case.
85 @item commit [-f @var{fmt}] @var{filename}
87 Commit the changes recorded in @var{filename} in its base image.
89 @item convert [-c] [-f @var{fmt}] [-O @var{output_fmt}] [-o @var{options}] [-B @var{output_base_image}] @var{filename} [@var{filename2} [...]] @var{output_filename}
91 Convert the disk image @var{filename} to disk image @var{output_filename}
92 using format @var{output_fmt}. It can be optionally compressed (@code{-c}
93 option) or use any format specific options like encryption (@code{-o} option).
95 Only the formats @code{qcow} and @code{qcow2} support encryption or compression. The
96 compression is read-only. It means that if a compressed sector is
97 rewritten, then it is rewritten as uncompressed data.
99 Encryption uses the AES format which is very secure (128 bit keys). Use
100 a long password (16 characters) to get maximum protection.
102 Image conversion is also useful to get smaller image when using a
103 growable format such as @code{qcow} or @code{cow}: the empty sectors
104 are detected and suppressed from the destination image.
106 @item info [-f @var{fmt}] @var{filename}
108 Give information about the disk image @var{filename}. Use it in
109 particular to know the size reserved on disk which can be different
110 from the displayed size. If VM snapshots are stored in the disk image,
111 they are displayed too.
113 @item snapshot [-l | -a @var{snapshot} | -c @var{snapshot} | -d @var{snapshot} ] @var{filename}
115 List, apply, create or delete snapshots in image @var{filename}.
116 @end table
118 Supported image file formats:
120 @table @option
121 @item raw
123 Raw disk image format (default). This format has the advantage of
124 being simple and easily exportable to all other emulators. If your
125 file system supports @emph{holes} (for example in ext2 or ext3 on
126 Linux or NTFS on Windows), then only the written sectors will reserve
127 space. Use @code{qemu-img info} to know the real size used by the
128 image or @code{ls -ls} on Unix/Linux.
130 @item host_device
132 Host device format. This format should be used instead of raw when
133 converting to block devices or other devices where "holes" are not
134 supported.
136 @item qcow2
137 QEMU image format, the most versatile format. Use it to have smaller
138 images (useful if your filesystem does not supports holes, for example
139 on Windows), optional AES encryption, zlib based compression and
140 support of multiple VM snapshots.
141 @item qcow
142 Old QEMU image format. Left for compatibility.
143 @item cow
144 User Mode Linux Copy On Write image format. Used to be the only growable
145 image format in QEMU. It is supported only for compatibility with
146 previous versions. It does not work on win32.
147 @item vdi
148 VirtualBox 1.1 compatible image format.
149 @item vmdk
150 VMware 3 and 4 compatible image format.
151 @item cloop
152 Linux Compressed Loop image, useful only to reuse directly compressed
153 CD-ROM images present for example in the Knoppix CD-ROMs.
154 @end table
157 @c man end
159 @ignore
161 @setfilename qemu-img
162 @settitle QEMU disk image utility
164 @c man begin SEEALSO
165 The HTML documentation of QEMU for more precise information and Linux
166 user mode emulator invocation.
167 @c man end
169 @c man begin AUTHOR
170 Fabrice Bellard
171 @c man end
173 @end ignore