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