Statistics
| Branch: | Revision:

root / qemu-img.texi @ 153859be

History | View | Annotate | Download (5.2 kB)

1
@example
2
@c man begin SYNOPSIS
3
usage: qemu-img command [command options]
4
@c man end
5
@end example
6

    
7
@c man begin OPTIONS
8

    
9
The following commands are supported:
10

    
11
@include qemu-img-cmds.texi
12

    
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. The following formats are supported:
29

    
30
@table @code
31
@item raw
32

    
33
Raw disk image format (default). This format has the advantage of
34
being simple and easily exportable to all other emulators. If your
35
file system supports @emph{holes} (for example in ext2 or ext3 on
36
Linux or NTFS on Windows), then only the written sectors will reserve
37
space. Use @code{qemu-img info} to know the real size used by the
38
image or @code{ls -ls} on Unix/Linux.
39

    
40
@item qcow2
41
QEMU image format, the most versatile format. Use it to have smaller
42
images (useful if your filesystem does not supports holes, for example
43
on Windows), optional AES encryption, zlib based compression and
44
support of multiple VM snapshots.
45
@item qcow
46
Old QEMU image format. Left for compatibility.
47
@item cow
48
User Mode Linux Copy On Write image format. Used to be the only growable
49
image format in QEMU. It is supported only for compatibility with
50
previous versions. It does not work on win32.
51
@item vmdk
52
VMware 3 and 4 compatible image format.
53
@item cloop
54
Linux Compressed Loop image, useful only to reuse directly compressed
55
CD-ROM images present for example in the Knoppix CD-ROMs.
56
@end table
57

    
58
@item size
59
is the disk image size in bytes. Optional suffixes @code{k} or @code{K}
60
(kilobyte, 1024) @code{M} (megabyte, 1024k) and @code{G} (gigabyte, 1024M)
61
and T (terabyte, 1024G) are supported.  @code{b} is ignored.
62

    
63
@item output_filename
64
is the destination disk image filename
65

    
66
@item output_fmt
67
 is the destination format
68
@item options
69
is a comma separated list of format specific options in a
70
name=value format. Use @code{-o ?} for an overview of the options supported
71
by the used format
72

    
73

    
74
@item -c
75
indicates that target image must be compressed (qcow format only)
76
@item -h
77
with or without a command shows help and lists the supported formats
78
@end table
79

    
80
Parameters to snapshot subcommand:
81

    
82
@table @option
83

    
84
@item snapshot
85
is the name of the snapshot to create, apply or delete
86
@item -a
87
applies a snapshot (revert disk to saved state)
88
@item -c
89
creates a snapshot
90
@item -d
91
deletes a snapshot
92
@item -l
93
lists all snapshots in the given image
94
@end table
95

    
96
Command description:
97

    
98
@table @option
99
@item create [-F @var{base_fmt}] [-b @var{base_image}] [-f @var{fmt}] [-o @var{options}] @var{filename} [@var{size}]
100

    
101
Create the new disk image @var{filename} of size @var{size} and format
102
@var{fmt}.
103

    
104
If @var{base_image} is specified, then the image will record only the
105
differences from @var{base_image}. No size needs to be specified in
106
this case. @var{base_image} will never be modified unless you use the
107
@code{commit} monitor command.
108

    
109
The size can also be specified using the @var{size} option with @code{-o},
110
it doesn't need to be specified separately in this case.
111

    
112
@item commit [-f @var{fmt}] @var{filename}
113

    
114
Commit the changes recorded in @var{filename} in its base image.
115

    
116
@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

    
118
Convert the disk image @var{filename} to disk image @var{output_filename}
119
using format @var{output_fmt}. It can be optionally compressed (@code{-c}
120
option) or use any format specific options like encryption (@code{-o} option).
121

    
122
Only the formats @code{qcow} and @code{qcow2} support encryption or compression. The
123
compression is read-only. It means that if a compressed sector is
124
rewritten, then it is rewritten as uncompressed data.
125

    
126
Encryption uses the AES format which is very secure (128 bit keys). Use
127
a long password (16 characters) to get maximum protection.
128

    
129
Image conversion is also useful to get smaller image when using a
130
growable format such as @code{qcow} or @code{cow}: the empty sectors
131
are detected and suppressed from the destination image.
132

    
133
@item info [-f @var{fmt}] @var{filename}
134

    
135
Give information about the disk image @var{filename}. Use it in
136
particular to know the size reserved on disk which can be different
137
from the displayed size. If VM snapshots are stored in the disk image,
138
they are displayed too.
139

    
140
@item snapshot [-l | -a @var{snapshot} | -c @var{snapshot} | -d @var{snapshot} ] @var{filename}
141

    
142
List, apply, create or delete snapshots in image @var{filename}.
143
@end table
144

    
145
@c man end
146

    
147
@ignore
148

    
149
@setfilename qemu-img
150
@settitle QEMU disk image utility
151

    
152
@c man begin SEEALSO
153
The HTML documentation of QEMU for more precise information and Linux
154
user mode emulator invocation.
155
@c man end
156

    
157
@c man begin AUTHOR
158
Fabrice Bellard
159
@c man end
160

    
161
@end ignore