Statistics
| Branch: | Revision:

root / qemu-img.texi @ 153859be

History | View | Annotate | Download (5.2 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 base_image
18 acd935ef bellard
is the read-only disk image which is used as base for a copy on
19 acd935ef bellard
    write image; the copy on write image only stores the modified data
20 f58c7b35 ths
@item output_base_image
21 f58c7b35 ths
forces the output image to be created as a copy on write
22 f58c7b35 ths
image of the specified base image; @code{output_base_image} should have the same
23 f58c7b35 ths
content as the input's base image, however the path, image format, etc may
24 f58c7b35 ths
differ
25 9230eaf6 aliguori
@item base_fmt
26 9230eaf6 aliguori
is the disk image format of @var{base_image}. for more information look at @var{fmt}
27 5fafdf24 ths
@item fmt
28 acd935ef bellard
is the disk image format. It is guessed automatically in most cases. The following formats are supported:
29 acd935ef bellard
30 acd935ef bellard
@table @code
31 acd935ef bellard
@item raw
32 acd935ef bellard
33 acd935ef bellard
Raw disk image format (default). This format has the advantage of
34 19d36792 bellard
being simple and easily exportable to all other emulators. If your
35 19d36792 bellard
file system supports @emph{holes} (for example in ext2 or ext3 on
36 19d36792 bellard
Linux or NTFS on Windows), then only the written sectors will reserve
37 19d36792 bellard
space. Use @code{qemu-img info} to know the real size used by the
38 19d36792 bellard
image or @code{ls -ls} on Unix/Linux.
39 acd935ef bellard
40 19d36792 bellard
@item qcow2
41 acd935ef bellard
QEMU image format, the most versatile format. Use it to have smaller
42 acd935ef bellard
images (useful if your filesystem does not supports holes, for example
43 19d36792 bellard
on Windows), optional AES encryption, zlib based compression and
44 19d36792 bellard
support of multiple VM snapshots.
45 19d36792 bellard
@item qcow
46 19d36792 bellard
Old QEMU image format. Left for compatibility.
47 acd935ef bellard
@item cow
48 acd935ef bellard
User Mode Linux Copy On Write image format. Used to be the only growable
49 acd935ef bellard
image format in QEMU. It is supported only for compatibility with
50 acd935ef bellard
previous versions. It does not work on win32.
51 acd935ef bellard
@item vmdk
52 e5d80f94 bellard
VMware 3 and 4 compatible image format.
53 acd935ef bellard
@item cloop
54 acd935ef bellard
Linux Compressed Loop image, useful only to reuse directly compressed
55 acd935ef bellard
CD-ROM images present for example in the Knoppix CD-ROMs.
56 acd935ef bellard
@end table
57 acd935ef bellard
58 5fafdf24 ths
@item size
59 eff44266 Kevin Wolf
is the disk image size in bytes. Optional suffixes @code{k} or @code{K}
60 eff44266 Kevin Wolf
(kilobyte, 1024) @code{M} (megabyte, 1024k) and @code{G} (gigabyte, 1024M)
61 eff44266 Kevin Wolf
and T (terabyte, 1024G) are supported.  @code{b} is ignored.
62 acd935ef bellard
63 acd935ef bellard
@item output_filename
64 5fafdf24 ths
is the destination disk image filename
65 acd935ef bellard
66 acd935ef bellard
@item output_fmt
67 acd935ef bellard
 is the destination format
68 eff44266 Kevin Wolf
@item options
69 eff44266 Kevin Wolf
is a comma separated list of format specific options in a
70 eff44266 Kevin Wolf
name=value format. Use @code{-o ?} for an overview of the options supported
71 eff44266 Kevin Wolf
by the used format
72 eff44266 Kevin Wolf
73 acd935ef bellard
74 acd935ef bellard
@item -c
75 acd935ef bellard
indicates that target image must be compressed (qcow format only)
76 d2c639d6 blueswir1
@item -h
77 d2c639d6 blueswir1
with or without a command shows help and lists the supported formats
78 d2c639d6 blueswir1
@end table
79 d2c639d6 blueswir1
80 d2c639d6 blueswir1
Parameters to snapshot subcommand:
81 d2c639d6 blueswir1
82 d2c639d6 blueswir1
@table @option
83 d2c639d6 blueswir1
84 d2c639d6 blueswir1
@item snapshot
85 d2c639d6 blueswir1
is the name of the snapshot to create, apply or delete
86 d2c639d6 blueswir1
@item -a
87 d2c639d6 blueswir1
applies a snapshot (revert disk to saved state)
88 d2c639d6 blueswir1
@item -c
89 d2c639d6 blueswir1
creates a snapshot
90 d2c639d6 blueswir1
@item -d
91 d2c639d6 blueswir1
deletes a snapshot
92 d2c639d6 blueswir1
@item -l
93 d2c639d6 blueswir1
lists all snapshots in the given image
94 acd935ef bellard
@end table
95 acd935ef bellard
96 acd935ef bellard
Command description:
97 acd935ef bellard
98 acd935ef bellard
@table @option
99 eff44266 Kevin Wolf
@item create [-F @var{base_fmt}] [-b @var{base_image}] [-f @var{fmt}] [-o @var{options}] @var{filename} [@var{size}]
100 acd935ef bellard
101 acd935ef bellard
Create the new disk image @var{filename} of size @var{size} and format
102 5fafdf24 ths
@var{fmt}.
103 acd935ef bellard
104 acd935ef bellard
If @var{base_image} is specified, then the image will record only the
105 acd935ef bellard
differences from @var{base_image}. No size needs to be specified in
106 acd935ef bellard
this case. @var{base_image} will never be modified unless you use the
107 acd935ef bellard
@code{commit} monitor command.
108 acd935ef bellard
109 eff44266 Kevin Wolf
The size can also be specified using the @var{size} option with @code{-o},
110 eff44266 Kevin Wolf
it doesn't need to be specified separately in this case.
111 eff44266 Kevin Wolf
112 acd935ef bellard
@item commit [-f @var{fmt}] @var{filename}
113 acd935ef bellard
114 acd935ef bellard
Commit the changes recorded in @var{filename} in its base image.
115 acd935ef bellard
116 eff44266 Kevin Wolf
@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}
117 acd935ef bellard
118 acd935ef bellard
Convert the disk image @var{filename} to disk image @var{output_filename}
119 eff44266 Kevin Wolf
using format @var{output_fmt}. It can be optionally compressed (@code{-c}
120 eff44266 Kevin Wolf
option) or use any format specific options like encryption (@code{-o} option).
121 acd935ef bellard
122 eff44266 Kevin Wolf
Only the formats @code{qcow} and @code{qcow2} support encryption or compression. The
123 acd935ef bellard
compression is read-only. It means that if a compressed sector is
124 acd935ef bellard
rewritten, then it is rewritten as uncompressed data.
125 acd935ef bellard
126 acd935ef bellard
Encryption uses the AES format which is very secure (128 bit keys). Use
127 acd935ef bellard
a long password (16 characters) to get maximum protection.
128 acd935ef bellard
129 acd935ef bellard
Image conversion is also useful to get smaller image when using a
130 acd935ef bellard
growable format such as @code{qcow} or @code{cow}: the empty sectors
131 acd935ef bellard
are detected and suppressed from the destination image.
132 acd935ef bellard
133 acd935ef bellard
@item info [-f @var{fmt}] @var{filename}
134 acd935ef bellard
135 acd935ef bellard
Give information about the disk image @var{filename}. Use it in
136 acd935ef bellard
particular to know the size reserved on disk which can be different
137 19d36792 bellard
from the displayed size. If VM snapshots are stored in the disk image,
138 19d36792 bellard
they are displayed too.
139 d2c639d6 blueswir1
140 d2c639d6 blueswir1
@item snapshot [-l | -a @var{snapshot} | -c @var{snapshot} | -d @var{snapshot} ] @var{filename}
141 d2c639d6 blueswir1
142 d2c639d6 blueswir1
List, apply, create or delete snapshots in image @var{filename}.
143 acd935ef bellard
@end table
144 acd935ef bellard
145 acd935ef bellard
@c man end
146 acd935ef bellard
147 acd935ef bellard
@ignore
148 acd935ef bellard
149 acd935ef bellard
@setfilename qemu-img
150 acd935ef bellard
@settitle QEMU disk image utility
151 acd935ef bellard
152 acd935ef bellard
@c man begin SEEALSO
153 acd935ef bellard
The HTML documentation of QEMU for more precise information and Linux
154 acd935ef bellard
user mode emulator invocation.
155 acd935ef bellard
@c man end
156 acd935ef bellard
157 acd935ef bellard
@c man begin AUTHOR
158 acd935ef bellard
Fabrice Bellard
159 acd935ef bellard
@c man end
160 acd935ef bellard
161 acd935ef bellard
@end ignore