Statistics
| Branch: | Revision:

root / qemu-img.texi @ 49a945a3

History | View | Annotate | Download (6.4 kB)

1 acd935ef bellard
@example
2 acd935ef bellard
@c man begin SYNOPSIS
3 acd935ef bellard
usage: qemu-img command [command options]
4 acd935ef bellard
@c man end
5 acd935ef bellard
@end example
6 acd935ef bellard
7 acd935ef bellard
@c man begin OPTIONS
8 acd935ef bellard
9 acd935ef bellard
The following commands are supported:
10 153859be Stuart Brady
11 153859be Stuart Brady
@include qemu-img-cmds.texi
12 acd935ef bellard
13 acd935ef bellard
Command parameters:
14 acd935ef bellard
@table @var
15 acd935ef bellard
@item filename
16 acd935ef bellard
 is a disk image filename
17 5fafdf24 ths
@item fmt
18 f932c040 Kevin Wolf
is the disk image format. It is guessed automatically in most cases. See below
19 f932c040 Kevin Wolf
for a description of the supported disk formats.
20 acd935ef bellard
21 5fafdf24 ths
@item size
22 eff44266 Kevin Wolf
is the disk image size in bytes. Optional suffixes @code{k} or @code{K}
23 eff44266 Kevin Wolf
(kilobyte, 1024) @code{M} (megabyte, 1024k) and @code{G} (gigabyte, 1024M)
24 eff44266 Kevin Wolf
and T (terabyte, 1024G) are supported.  @code{b} is ignored.
25 acd935ef bellard
26 acd935ef bellard
@item output_filename
27 5fafdf24 ths
is the destination disk image filename
28 acd935ef bellard
29 acd935ef bellard
@item output_fmt
30 acd935ef bellard
 is the destination format
31 eff44266 Kevin Wolf
@item options
32 eff44266 Kevin Wolf
is a comma separated list of format specific options in a
33 eff44266 Kevin Wolf
name=value format. Use @code{-o ?} for an overview of the options supported
34 3e032364 Kevin Wolf
by the used format or see the format descriptions below for details.
35 eff44266 Kevin Wolf
36 acd935ef bellard
37 acd935ef bellard
@item -c
38 acd935ef bellard
indicates that target image must be compressed (qcow format only)
39 d2c639d6 blueswir1
@item -h
40 d2c639d6 blueswir1
with or without a command shows help and lists the supported formats
41 d2c639d6 blueswir1
@end table
42 d2c639d6 blueswir1
43 d2c639d6 blueswir1
Parameters to snapshot subcommand:
44 d2c639d6 blueswir1
45 d2c639d6 blueswir1
@table @option
46 d2c639d6 blueswir1
47 d2c639d6 blueswir1
@item snapshot
48 d2c639d6 blueswir1
is the name of the snapshot to create, apply or delete
49 d2c639d6 blueswir1
@item -a
50 d2c639d6 blueswir1
applies a snapshot (revert disk to saved state)
51 d2c639d6 blueswir1
@item -c
52 d2c639d6 blueswir1
creates a snapshot
53 d2c639d6 blueswir1
@item -d
54 d2c639d6 blueswir1
deletes a snapshot
55 d2c639d6 blueswir1
@item -l
56 d2c639d6 blueswir1
lists all snapshots in the given image
57 acd935ef bellard
@end table
58 acd935ef bellard
59 acd935ef bellard
Command description:
60 acd935ef bellard
61 acd935ef bellard
@table @option
62 8063d0fe Kevin Wolf
@item create [-f @var{fmt}] [-o @var{options}] @var{filename} [@var{size}]
63 acd935ef bellard
64 acd935ef bellard
Create the new disk image @var{filename} of size @var{size} and format
65 8063d0fe Kevin Wolf
@var{fmt}. Depending on the file format, you can add one or more @var{options}
66 8063d0fe Kevin Wolf
that enable additional features of this format.
67 acd935ef bellard
68 8063d0fe Kevin Wolf
If the option @var{backing_file} is specified, then the image will record
69 8063d0fe Kevin Wolf
only the differences from @var{backing_file}. No size needs to be specified in
70 8063d0fe Kevin Wolf
this case. @var{backing_file} will never be modified unless you use the
71 8063d0fe Kevin Wolf
@code{commit} monitor command (or qemu-img commit).
72 acd935ef bellard
73 eff44266 Kevin Wolf
The size can also be specified using the @var{size} option with @code{-o},
74 eff44266 Kevin Wolf
it doesn't need to be specified separately in this case.
75 eff44266 Kevin Wolf
76 acd935ef bellard
@item commit [-f @var{fmt}] @var{filename}
77 acd935ef bellard
78 acd935ef bellard
Commit the changes recorded in @var{filename} in its base image.
79 acd935ef bellard
80 8063d0fe Kevin Wolf
@item convert [-c] [-f @var{fmt}] [-O @var{output_fmt}] [-o @var{options}] @var{filename} [@var{filename2} [...]] @var{output_filename}
81 acd935ef bellard
82 acd935ef bellard
Convert the disk image @var{filename} to disk image @var{output_filename}
83 eff44266 Kevin Wolf
using format @var{output_fmt}. It can be optionally compressed (@code{-c}
84 eff44266 Kevin Wolf
option) or use any format specific options like encryption (@code{-o} option).
85 acd935ef bellard
86 8063d0fe Kevin Wolf
Only the formats @code{qcow} and @code{qcow2} support compression. The
87 acd935ef bellard
compression is read-only. It means that if a compressed sector is
88 acd935ef bellard
rewritten, then it is rewritten as uncompressed data.
89 acd935ef bellard
90 acd935ef bellard
Image conversion is also useful to get smaller image when using a
91 acd935ef bellard
growable format such as @code{qcow} or @code{cow}: the empty sectors
92 acd935ef bellard
are detected and suppressed from the destination image.
93 acd935ef bellard
94 8063d0fe Kevin Wolf
You can use the @var{backing_file} option to force the output image to be
95 8063d0fe Kevin Wolf
created as a copy on write image of the specified base image; the
96 8063d0fe Kevin Wolf
@var{backing_file} should have the same content as the input's base image,
97 8063d0fe Kevin Wolf
however the path, image format, etc may differ.
98 8063d0fe Kevin Wolf
99 acd935ef bellard
@item info [-f @var{fmt}] @var{filename}
100 acd935ef bellard
101 acd935ef bellard
Give information about the disk image @var{filename}. Use it in
102 acd935ef bellard
particular to know the size reserved on disk which can be different
103 19d36792 bellard
from the displayed size. If VM snapshots are stored in the disk image,
104 19d36792 bellard
they are displayed too.
105 d2c639d6 blueswir1
106 d2c639d6 blueswir1
@item snapshot [-l | -a @var{snapshot} | -c @var{snapshot} | -d @var{snapshot} ] @var{filename}
107 d2c639d6 blueswir1
108 d2c639d6 blueswir1
List, apply, create or delete snapshots in image @var{filename}.
109 acd935ef bellard
@end table
110 acd935ef bellard
111 f932c040 Kevin Wolf
Supported image file formats:
112 f932c040 Kevin Wolf
113 f932c040 Kevin Wolf
@table @option
114 f932c040 Kevin Wolf
@item raw
115 f932c040 Kevin Wolf
116 f932c040 Kevin Wolf
Raw disk image format (default). This format has the advantage of
117 f932c040 Kevin Wolf
being simple and easily exportable to all other emulators. If your
118 f932c040 Kevin Wolf
file system supports @emph{holes} (for example in ext2 or ext3 on
119 f932c040 Kevin Wolf
Linux or NTFS on Windows), then only the written sectors will reserve
120 f932c040 Kevin Wolf
space. Use @code{qemu-img info} to know the real size used by the
121 f932c040 Kevin Wolf
image or @code{ls -ls} on Unix/Linux.
122 f932c040 Kevin Wolf
123 f932c040 Kevin Wolf
@item host_device
124 f932c040 Kevin Wolf
125 f932c040 Kevin Wolf
Host device format. This format should be used instead of raw when
126 f932c040 Kevin Wolf
converting to block devices or other devices where "holes" are not
127 f932c040 Kevin Wolf
supported.
128 f932c040 Kevin Wolf
129 f932c040 Kevin Wolf
@item qcow2
130 f932c040 Kevin Wolf
QEMU image format, the most versatile format. Use it to have smaller
131 f932c040 Kevin Wolf
images (useful if your filesystem does not supports holes, for example
132 f932c040 Kevin Wolf
on Windows), optional AES encryption, zlib based compression and
133 f932c040 Kevin Wolf
support of multiple VM snapshots.
134 8063d0fe Kevin Wolf
135 3e032364 Kevin Wolf
Supported options:
136 3e032364 Kevin Wolf
@table @code
137 3e032364 Kevin Wolf
@item backing_file
138 3e032364 Kevin Wolf
File name of a base image (see @option{create} subcommand)
139 3e032364 Kevin Wolf
@item backing_fmt
140 3e032364 Kevin Wolf
Image format of the base image
141 3e032364 Kevin Wolf
@item encryption
142 3e032364 Kevin Wolf
If this option is set to @code{on}, the image is encrypted.
143 3e032364 Kevin Wolf
144 8063d0fe Kevin Wolf
Encryption uses the AES format which is very secure (128 bit keys). Use
145 8063d0fe Kevin Wolf
a long password (16 characters) to get maximum protection.
146 3e032364 Kevin Wolf
147 3e032364 Kevin Wolf
@item cluster_size
148 3e032364 Kevin Wolf
Changes the qcow2 cluster size (must be between 512 and 2M). Smaller cluster
149 3e032364 Kevin Wolf
sizes can improve the image file size whereas larger cluster sizes generally
150 3e032364 Kevin Wolf
provide better performance.
151 3e032364 Kevin Wolf
152 3e032364 Kevin Wolf
@item preallocation
153 3e032364 Kevin Wolf
Preallocation mode (allowed values: off, metadata). An image with preallocated
154 3e032364 Kevin Wolf
metadata is initially larger but can improve performance when the image needs
155 3e032364 Kevin Wolf
to grow.
156 3e032364 Kevin Wolf
157 3e032364 Kevin Wolf
@end table
158 3e032364 Kevin Wolf
159 3e032364 Kevin Wolf
160 f932c040 Kevin Wolf
@item qcow
161 f932c040 Kevin Wolf
Old QEMU image format. Left for compatibility.
162 3e032364 Kevin Wolf
163 3e032364 Kevin Wolf
Supported options:
164 3e032364 Kevin Wolf
@table @code
165 3e032364 Kevin Wolf
@item backing_file
166 3e032364 Kevin Wolf
File name of a base image (see @option{create} subcommand)
167 3e032364 Kevin Wolf
@item encryption
168 3e032364 Kevin Wolf
If this option is set to @code{on}, the image is encrypted.
169 3e032364 Kevin Wolf
@end table
170 3e032364 Kevin Wolf
171 f932c040 Kevin Wolf
@item cow
172 f932c040 Kevin Wolf
User Mode Linux Copy On Write image format. Used to be the only growable
173 f932c040 Kevin Wolf
image format in QEMU. It is supported only for compatibility with
174 f932c040 Kevin Wolf
previous versions. It does not work on win32.
175 f932c040 Kevin Wolf
@item vdi
176 f932c040 Kevin Wolf
VirtualBox 1.1 compatible image format.
177 f932c040 Kevin Wolf
@item vmdk
178 f932c040 Kevin Wolf
VMware 3 and 4 compatible image format.
179 3e032364 Kevin Wolf
180 3e032364 Kevin Wolf
Supported options:
181 3e032364 Kevin Wolf
@table @code
182 3e032364 Kevin Wolf
@item backing_fmt
183 3e032364 Kevin Wolf
Image format of the base image
184 3e032364 Kevin Wolf
@item compat6
185 3e032364 Kevin Wolf
Create a VMDK version 6 image (instead of version 4)
186 3e032364 Kevin Wolf
@end table
187 3e032364 Kevin Wolf
188 3e032364 Kevin Wolf
@item vpc
189 3e032364 Kevin Wolf
VirtualPC compatible image format (VHD).
190 3e032364 Kevin Wolf
191 f932c040 Kevin Wolf
@item cloop
192 f932c040 Kevin Wolf
Linux Compressed Loop image, useful only to reuse directly compressed
193 f932c040 Kevin Wolf
CD-ROM images present for example in the Knoppix CD-ROMs.
194 f932c040 Kevin Wolf
@end table
195 f932c040 Kevin Wolf
196 f932c040 Kevin Wolf
197 acd935ef bellard
@c man end
198 acd935ef bellard
199 acd935ef bellard
@ignore
200 acd935ef bellard
201 acd935ef bellard
@setfilename qemu-img
202 acd935ef bellard
@settitle QEMU disk image utility
203 acd935ef bellard
204 acd935ef bellard
@c man begin SEEALSO
205 acd935ef bellard
The HTML documentation of QEMU for more precise information and Linux
206 acd935ef bellard
user mode emulator invocation.
207 acd935ef bellard
@c man end
208 acd935ef bellard
209 acd935ef bellard
@c man begin AUTHOR
210 acd935ef bellard
Fabrice Bellard
211 acd935ef bellard
@c man end
212 acd935ef bellard
213 acd935ef bellard
@end ignore