blob: 1c0504bcfa8a442e5776f4baaa8a9afc6956e587 [file] [log] [blame]
bellardacd935e2004-11-15 22:57:26 +00001@example
2@c man begin SYNOPSIS
3usage: qemu-img command [command options]
4@c man end
5@end example
6
7@c man begin OPTIONS
8
9The following commands are supported:
10@table @option
thsec36ba12007-09-16 21:59:02 +000011@item create [-e] [-6] [-b @var{base_image}] [-f @var{fmt}] @var{filename} [@var{size}]
bellardacd935e2004-11-15 22:57:26 +000012@item commit [-f @var{fmt}] @var{filename}
thsf58c7b32008-06-05 21:53:49 +000013@item convert [-c] [-e] [-6] [-f @var{fmt}] [-O @var{output_fmt}] [-B @var{output_base_image}] @var{filename} [@var{filename2} [...]] @var{output_filename}
bellardacd935e2004-11-15 22:57:26 +000014@item info [-f @var{fmt}] @var{filename}
15@end table
16
17Command parameters:
18@table @var
19@item filename
20 is a disk image filename
ths5fafdf22007-09-16 21:08:06 +000021@item base_image
bellardacd935e2004-11-15 22:57:26 +000022is the read-only disk image which is used as base for a copy on
23 write image; the copy on write image only stores the modified data
thsf58c7b32008-06-05 21:53:49 +000024@item output_base_image
25forces the output image to be created as a copy on write
26image of the specified base image; @code{output_base_image} should have the same
27content as the input's base image, however the path, image format, etc may
28differ
ths5fafdf22007-09-16 21:08:06 +000029@item fmt
bellardacd935e2004-11-15 22:57:26 +000030is the disk image format. It is guessed automatically in most cases. The following formats are supported:
31
32@table @code
33@item raw
34
35Raw disk image format (default). This format has the advantage of
bellard19d36792006-08-07 21:34:34 +000036being simple and easily exportable to all other emulators. If your
37file system supports @emph{holes} (for example in ext2 or ext3 on
38Linux or NTFS on Windows), then only the written sectors will reserve
39space. Use @code{qemu-img info} to know the real size used by the
40image or @code{ls -ls} on Unix/Linux.
bellardacd935e2004-11-15 22:57:26 +000041
bellard19d36792006-08-07 21:34:34 +000042@item qcow2
bellardacd935e2004-11-15 22:57:26 +000043QEMU image format, the most versatile format. Use it to have smaller
44images (useful if your filesystem does not supports holes, for example
bellard19d36792006-08-07 21:34:34 +000045on Windows), optional AES encryption, zlib based compression and
46support of multiple VM snapshots.
47@item qcow
48Old QEMU image format. Left for compatibility.
bellardacd935e2004-11-15 22:57:26 +000049@item cow
50User Mode Linux Copy On Write image format. Used to be the only growable
51image format in QEMU. It is supported only for compatibility with
52previous versions. It does not work on win32.
53@item vmdk
bellarde5d80f92005-07-23 17:43:14 +000054VMware 3 and 4 compatible image format.
bellardacd935e2004-11-15 22:57:26 +000055@item cloop
56Linux Compressed Loop image, useful only to reuse directly compressed
57CD-ROM images present for example in the Knoppix CD-ROMs.
58@end table
59
ths5fafdf22007-09-16 21:08:06 +000060@item size
bellardacd935e2004-11-15 22:57:26 +000061is the disk image size in kilobytes. Optional suffixes @code{M}
ths5fafdf22007-09-16 21:08:06 +000062(megabyte) and @code{G} (gigabyte) are supported
bellardacd935e2004-11-15 22:57:26 +000063
64@item output_filename
ths5fafdf22007-09-16 21:08:06 +000065is the destination disk image filename
bellardacd935e2004-11-15 22:57:26 +000066
67@item output_fmt
68 is the destination format
69
70@item -c
71indicates that target image must be compressed (qcow format only)
ths5fafdf22007-09-16 21:08:06 +000072@item -e
bellardacd935e2004-11-15 22:57:26 +000073indicates that the target image must be encrypted (qcow format only)
thsec36ba12007-09-16 21:59:02 +000074@item -6
75indicates that the target image must use compatibility level 6 (vmdk format only)
bellardacd935e2004-11-15 22:57:26 +000076@end table
77
78Command description:
79
80@table @option
thsec36ba12007-09-16 21:59:02 +000081@item create [-6] [-e] [-b @var{base_image}] [-f @var{fmt}] @var{filename} [@var{size}]
bellardacd935e2004-11-15 22:57:26 +000082
83Create the new disk image @var{filename} of size @var{size} and format
ths5fafdf22007-09-16 21:08:06 +000084@var{fmt}.
bellardacd935e2004-11-15 22:57:26 +000085
86If @var{base_image} is specified, then the image will record only the
87differences from @var{base_image}. No size needs to be specified in
88this case. @var{base_image} will never be modified unless you use the
89@code{commit} monitor command.
90
91@item commit [-f @var{fmt}] @var{filename}
92
93Commit the changes recorded in @var{filename} in its base image.
94
95@item convert [-c] [-e] [-f @var{fmt}] @var{filename} [-O @var{output_fmt}] @var{output_filename}
96
97Convert the disk image @var{filename} to disk image @var{output_filename}
ths4be456f2007-06-03 13:41:28 +000098using format @var{output_fmt}. It can be optionally encrypted
bellardacd935e2004-11-15 22:57:26 +000099(@code{-e} option) or compressed (@code{-c} option).
100
101Only the format @code{qcow} supports encryption or compression. The
102compression is read-only. It means that if a compressed sector is
103rewritten, then it is rewritten as uncompressed data.
104
105Encryption uses the AES format which is very secure (128 bit keys). Use
106a long password (16 characters) to get maximum protection.
107
108Image conversion is also useful to get smaller image when using a
109growable format such as @code{qcow} or @code{cow}: the empty sectors
110are detected and suppressed from the destination image.
111
112@item info [-f @var{fmt}] @var{filename}
113
114Give information about the disk image @var{filename}. Use it in
115particular to know the size reserved on disk which can be different
bellard19d36792006-08-07 21:34:34 +0000116from the displayed size. If VM snapshots are stored in the disk image,
117they are displayed too.
bellardacd935e2004-11-15 22:57:26 +0000118@end table
119
120@c man end
121
122@ignore
123
124@setfilename qemu-img
125@settitle QEMU disk image utility
126
127@c man begin SEEALSO
128The HTML documentation of QEMU for more precise information and Linux
129user mode emulator invocation.
130@c man end
131
132@c man begin AUTHOR
133Fabrice Bellard
134@c man end
135
136@end ignore