Statistics
| Branch: | Revision:

root / qemu-img.texi @ 78895427

History | View | Annotate | Download (6.9 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 51ef6727 edison
@item convert [-c] [-f @var{fmt}] [-O @var{output_fmt}] [-o @var{options}] [-s @var{snapshot_name}] @var{filename} [@var{filename2} [...]] @var{output_filename}
81 acd935ef bellard
82 51ef6727 edison
Convert the disk image @var{filename} or a snapshot @var{snapshot_name} 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 ae6b0ed6 Stefan Hajnoczi
110 ae6b0ed6 Stefan Hajnoczi
@item resize @var{filename} [+ | -]@var{size}
111 ae6b0ed6 Stefan Hajnoczi
112 ae6b0ed6 Stefan Hajnoczi
Change the disk image as if it had been created with @var{size}.
113 ae6b0ed6 Stefan Hajnoczi
114 ae6b0ed6 Stefan Hajnoczi
Before using this command to shrink a disk image, you MUST use file system and
115 ae6b0ed6 Stefan Hajnoczi
partitioning tools inside the VM to reduce allocated file systems and partition
116 ae6b0ed6 Stefan Hajnoczi
sizes accordingly.  Failure to do so will result in data loss!
117 ae6b0ed6 Stefan Hajnoczi
118 ae6b0ed6 Stefan Hajnoczi
After using this command to grow a disk image, you must use file system and
119 ae6b0ed6 Stefan Hajnoczi
partitioning tools inside the VM to actually begin using the new space on the
120 ae6b0ed6 Stefan Hajnoczi
device.
121 acd935ef bellard
@end table
122 acd935ef bellard
123 f932c040 Kevin Wolf
Supported image file formats:
124 f932c040 Kevin Wolf
125 f932c040 Kevin Wolf
@table @option
126 f932c040 Kevin Wolf
@item raw
127 f932c040 Kevin Wolf
128 f932c040 Kevin Wolf
Raw disk image format (default). This format has the advantage of
129 f932c040 Kevin Wolf
being simple and easily exportable to all other emulators. If your
130 f932c040 Kevin Wolf
file system supports @emph{holes} (for example in ext2 or ext3 on
131 f932c040 Kevin Wolf
Linux or NTFS on Windows), then only the written sectors will reserve
132 f932c040 Kevin Wolf
space. Use @code{qemu-img info} to know the real size used by the
133 f932c040 Kevin Wolf
image or @code{ls -ls} on Unix/Linux.
134 f932c040 Kevin Wolf
135 f932c040 Kevin Wolf
@item host_device
136 f932c040 Kevin Wolf
137 f932c040 Kevin Wolf
Host device format. This format should be used instead of raw when
138 f932c040 Kevin Wolf
converting to block devices or other devices where "holes" are not
139 f932c040 Kevin Wolf
supported.
140 f932c040 Kevin Wolf
141 f932c040 Kevin Wolf
@item qcow2
142 f932c040 Kevin Wolf
QEMU image format, the most versatile format. Use it to have smaller
143 f932c040 Kevin Wolf
images (useful if your filesystem does not supports holes, for example
144 f932c040 Kevin Wolf
on Windows), optional AES encryption, zlib based compression and
145 f932c040 Kevin Wolf
support of multiple VM snapshots.
146 8063d0fe Kevin Wolf
147 3e032364 Kevin Wolf
Supported options:
148 3e032364 Kevin Wolf
@table @code
149 3e032364 Kevin Wolf
@item backing_file
150 3e032364 Kevin Wolf
File name of a base image (see @option{create} subcommand)
151 3e032364 Kevin Wolf
@item backing_fmt
152 3e032364 Kevin Wolf
Image format of the base image
153 3e032364 Kevin Wolf
@item encryption
154 3e032364 Kevin Wolf
If this option is set to @code{on}, the image is encrypted.
155 3e032364 Kevin Wolf
156 8063d0fe Kevin Wolf
Encryption uses the AES format which is very secure (128 bit keys). Use
157 8063d0fe Kevin Wolf
a long password (16 characters) to get maximum protection.
158 3e032364 Kevin Wolf
159 3e032364 Kevin Wolf
@item cluster_size
160 3e032364 Kevin Wolf
Changes the qcow2 cluster size (must be between 512 and 2M). Smaller cluster
161 3e032364 Kevin Wolf
sizes can improve the image file size whereas larger cluster sizes generally
162 3e032364 Kevin Wolf
provide better performance.
163 3e032364 Kevin Wolf
164 3e032364 Kevin Wolf
@item preallocation
165 3e032364 Kevin Wolf
Preallocation mode (allowed values: off, metadata). An image with preallocated
166 3e032364 Kevin Wolf
metadata is initially larger but can improve performance when the image needs
167 3e032364 Kevin Wolf
to grow.
168 3e032364 Kevin Wolf
169 3e032364 Kevin Wolf
@end table
170 3e032364 Kevin Wolf
171 3e032364 Kevin Wolf
172 f932c040 Kevin Wolf
@item qcow
173 f932c040 Kevin Wolf
Old QEMU image format. Left for compatibility.
174 3e032364 Kevin Wolf
175 3e032364 Kevin Wolf
Supported options:
176 3e032364 Kevin Wolf
@table @code
177 3e032364 Kevin Wolf
@item backing_file
178 3e032364 Kevin Wolf
File name of a base image (see @option{create} subcommand)
179 3e032364 Kevin Wolf
@item encryption
180 3e032364 Kevin Wolf
If this option is set to @code{on}, the image is encrypted.
181 3e032364 Kevin Wolf
@end table
182 3e032364 Kevin Wolf
183 f932c040 Kevin Wolf
@item cow
184 f932c040 Kevin Wolf
User Mode Linux Copy On Write image format. Used to be the only growable
185 f932c040 Kevin Wolf
image format in QEMU. It is supported only for compatibility with
186 f932c040 Kevin Wolf
previous versions. It does not work on win32.
187 f932c040 Kevin Wolf
@item vdi
188 f932c040 Kevin Wolf
VirtualBox 1.1 compatible image format.
189 f932c040 Kevin Wolf
@item vmdk
190 f932c040 Kevin Wolf
VMware 3 and 4 compatible image format.
191 3e032364 Kevin Wolf
192 3e032364 Kevin Wolf
Supported options:
193 3e032364 Kevin Wolf
@table @code
194 3e032364 Kevin Wolf
@item backing_fmt
195 3e032364 Kevin Wolf
Image format of the base image
196 3e032364 Kevin Wolf
@item compat6
197 3e032364 Kevin Wolf
Create a VMDK version 6 image (instead of version 4)
198 3e032364 Kevin Wolf
@end table
199 3e032364 Kevin Wolf
200 3e032364 Kevin Wolf
@item vpc
201 3e032364 Kevin Wolf
VirtualPC compatible image format (VHD).
202 3e032364 Kevin Wolf
203 f932c040 Kevin Wolf
@item cloop
204 f932c040 Kevin Wolf
Linux Compressed Loop image, useful only to reuse directly compressed
205 f932c040 Kevin Wolf
CD-ROM images present for example in the Knoppix CD-ROMs.
206 f932c040 Kevin Wolf
@end table
207 f932c040 Kevin Wolf
208 f932c040 Kevin Wolf
209 acd935ef bellard
@c man end
210 acd935ef bellard
211 acd935ef bellard
@ignore
212 acd935ef bellard
213 acd935ef bellard
@setfilename qemu-img
214 acd935ef bellard
@settitle QEMU disk image utility
215 acd935ef bellard
216 acd935ef bellard
@c man begin SEEALSO
217 acd935ef bellard
The HTML documentation of QEMU for more precise information and Linux
218 acd935ef bellard
user mode emulator invocation.
219 acd935ef bellard
@c man end
220 acd935ef bellard
221 acd935ef bellard
@c man begin AUTHOR
222 acd935ef bellard
Fabrice Bellard
223 acd935ef bellard
@c man end
224 acd935ef bellard
225 acd935ef bellard
@end ignore