]>
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: | |
153859be SB |
10 | |
11 | @include qemu-img-cmds.texi | |
acd935ef FB |
12 | |
13 | Command parameters: | |
14 | @table @var | |
15 | @item filename | |
16 | is a disk image filename | |
5fafdf24 | 17 | @item base_image |
acd935ef FB |
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 | |
f58c7b35 TS |
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 | |
9230eaf6 AL |
25 | @item base_fmt |
26 | is the disk image format of @var{base_image}. for more information look at @var{fmt} | |
5fafdf24 | 27 | @item fmt |
acd935ef FB |
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 | |
19d36792 FB |
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. | |
acd935ef | 39 | |
19d36792 | 40 | @item qcow2 |
acd935ef FB |
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 | |
19d36792 FB |
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. | |
acd935ef FB |
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. | |
9aebd98a SW |
51 | @item vdi |
52 | VirtualBox 1.1 compatible image format. | |
acd935ef | 53 | @item vmdk |
e5d80f94 | 54 | VMware 3 and 4 compatible image format. |
acd935ef FB |
55 | @item cloop |
56 | Linux Compressed Loop image, useful only to reuse directly compressed | |
57 | CD-ROM images present for example in the Knoppix CD-ROMs. | |
58 | @end table | |
59 | ||
5fafdf24 | 60 | @item size |
eff44266 KW |
61 | is the disk image size in bytes. Optional suffixes @code{k} or @code{K} |
62 | (kilobyte, 1024) @code{M} (megabyte, 1024k) and @code{G} (gigabyte, 1024M) | |
63 | and T (terabyte, 1024G) are supported. @code{b} is ignored. | |
acd935ef FB |
64 | |
65 | @item output_filename | |
5fafdf24 | 66 | is the destination disk image filename |
acd935ef FB |
67 | |
68 | @item output_fmt | |
69 | is the destination format | |
eff44266 KW |
70 | @item options |
71 | is a comma separated list of format specific options in a | |
72 | name=value format. Use @code{-o ?} for an overview of the options supported | |
73 | by the used format | |
74 | ||
acd935ef FB |
75 | |
76 | @item -c | |
77 | indicates that target image must be compressed (qcow format only) | |
d2c639d6 BS |
78 | @item -h |
79 | with or without a command shows help and lists the supported formats | |
80 | @end table | |
81 | ||
82 | Parameters to snapshot subcommand: | |
83 | ||
84 | @table @option | |
85 | ||
86 | @item snapshot | |
87 | is the name of the snapshot to create, apply or delete | |
88 | @item -a | |
89 | applies a snapshot (revert disk to saved state) | |
90 | @item -c | |
91 | creates a snapshot | |
92 | @item -d | |
93 | deletes a snapshot | |
94 | @item -l | |
95 | lists all snapshots in the given image | |
acd935ef FB |
96 | @end table |
97 | ||
98 | Command description: | |
99 | ||
100 | @table @option | |
eff44266 | 101 | @item create [-F @var{base_fmt}] [-b @var{base_image}] [-f @var{fmt}] [-o @var{options}] @var{filename} [@var{size}] |
acd935ef FB |
102 | |
103 | Create the new disk image @var{filename} of size @var{size} and format | |
5fafdf24 | 104 | @var{fmt}. |
acd935ef FB |
105 | |
106 | If @var{base_image} is specified, then the image will record only the | |
107 | differences from @var{base_image}. No size needs to be specified in | |
108 | this case. @var{base_image} will never be modified unless you use the | |
109 | @code{commit} monitor command. | |
110 | ||
eff44266 KW |
111 | The size can also be specified using the @var{size} option with @code{-o}, |
112 | it doesn't need to be specified separately in this case. | |
113 | ||
acd935ef FB |
114 | @item commit [-f @var{fmt}] @var{filename} |
115 | ||
116 | Commit the changes recorded in @var{filename} in its base image. | |
117 | ||
eff44266 | 118 | @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} |
acd935ef FB |
119 | |
120 | Convert the disk image @var{filename} to disk image @var{output_filename} | |
eff44266 KW |
121 | using format @var{output_fmt}. It can be optionally compressed (@code{-c} |
122 | option) or use any format specific options like encryption (@code{-o} option). | |
acd935ef | 123 | |
eff44266 | 124 | Only the formats @code{qcow} and @code{qcow2} support encryption or compression. The |
acd935ef FB |
125 | compression is read-only. It means that if a compressed sector is |
126 | rewritten, then it is rewritten as uncompressed data. | |
127 | ||
128 | Encryption uses the AES format which is very secure (128 bit keys). Use | |
129 | a long password (16 characters) to get maximum protection. | |
130 | ||
131 | Image conversion is also useful to get smaller image when using a | |
132 | growable format such as @code{qcow} or @code{cow}: the empty sectors | |
133 | are detected and suppressed from the destination image. | |
134 | ||
135 | @item info [-f @var{fmt}] @var{filename} | |
136 | ||
137 | Give information about the disk image @var{filename}. Use it in | |
138 | particular to know the size reserved on disk which can be different | |
19d36792 FB |
139 | from the displayed size. If VM snapshots are stored in the disk image, |
140 | they are displayed too. | |
d2c639d6 BS |
141 | |
142 | @item snapshot [-l | -a @var{snapshot} | -c @var{snapshot} | -d @var{snapshot} ] @var{filename} | |
143 | ||
144 | List, apply, create or delete snapshots in image @var{filename}. | |
acd935ef FB |
145 | @end table |
146 | ||
147 | @c man end | |
148 | ||
149 | @ignore | |
150 | ||
151 | @setfilename qemu-img | |
152 | @settitle QEMU disk image utility | |
153 | ||
154 | @c man begin SEEALSO | |
155 | The HTML documentation of QEMU for more precise information and Linux | |
156 | user mode emulator invocation. | |
157 | @c man end | |
158 | ||
159 | @c man begin AUTHOR | |
160 | Fabrice Bellard | |
161 | @c man end | |
162 | ||
163 | @end ignore |