bellard | acd935e | 2004-11-15 22:57:26 +0000 | [diff] [blame] | 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 |
| 11 | @item create [-e] [-b @var{base_image}] [-f @var{fmt}] @var{filename} [@var{size}] |
| 12 | @item commit [-f @var{fmt}] @var{filename} |
| 13 | @item convert [-c] [-e] [-f @var{fmt}] @var{filename} [-O @var{output_fmt}] @var{output_filename} |
| 14 | @item info [-f @var{fmt}] @var{filename} |
| 15 | @end table |
| 16 | |
| 17 | Command parameters: |
| 18 | @table @var |
| 19 | @item filename |
| 20 | is a disk image filename |
ths | 5fafdf2 | 2007-09-16 21:08:06 +0000 | [diff] [blame^] | 21 | @item base_image |
bellard | acd935e | 2004-11-15 22:57:26 +0000 | [diff] [blame] | 22 | is 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 |
| 24 | |
ths | 5fafdf2 | 2007-09-16 21:08:06 +0000 | [diff] [blame^] | 25 | @item fmt |
bellard | acd935e | 2004-11-15 22:57:26 +0000 | [diff] [blame] | 26 | is the disk image format. It is guessed automatically in most cases. The following formats are supported: |
| 27 | |
| 28 | @table @code |
| 29 | @item raw |
| 30 | |
| 31 | Raw disk image format (default). This format has the advantage of |
bellard | 19d3679 | 2006-08-07 21:34:34 +0000 | [diff] [blame] | 32 | being simple and easily exportable to all other emulators. If your |
| 33 | file system supports @emph{holes} (for example in ext2 or ext3 on |
| 34 | Linux or NTFS on Windows), then only the written sectors will reserve |
| 35 | space. Use @code{qemu-img info} to know the real size used by the |
| 36 | image or @code{ls -ls} on Unix/Linux. |
bellard | acd935e | 2004-11-15 22:57:26 +0000 | [diff] [blame] | 37 | |
bellard | 19d3679 | 2006-08-07 21:34:34 +0000 | [diff] [blame] | 38 | @item qcow2 |
bellard | acd935e | 2004-11-15 22:57:26 +0000 | [diff] [blame] | 39 | QEMU image format, the most versatile format. Use it to have smaller |
| 40 | images (useful if your filesystem does not supports holes, for example |
bellard | 19d3679 | 2006-08-07 21:34:34 +0000 | [diff] [blame] | 41 | on Windows), optional AES encryption, zlib based compression and |
| 42 | support of multiple VM snapshots. |
| 43 | @item qcow |
| 44 | Old QEMU image format. Left for compatibility. |
bellard | acd935e | 2004-11-15 22:57:26 +0000 | [diff] [blame] | 45 | @item cow |
| 46 | User Mode Linux Copy On Write image format. Used to be the only growable |
| 47 | image format in QEMU. It is supported only for compatibility with |
| 48 | previous versions. It does not work on win32. |
| 49 | @item vmdk |
bellard | e5d80f9 | 2005-07-23 17:43:14 +0000 | [diff] [blame] | 50 | VMware 3 and 4 compatible image format. |
bellard | acd935e | 2004-11-15 22:57:26 +0000 | [diff] [blame] | 51 | @item cloop |
| 52 | Linux Compressed Loop image, useful only to reuse directly compressed |
| 53 | CD-ROM images present for example in the Knoppix CD-ROMs. |
| 54 | @end table |
| 55 | |
ths | 5fafdf2 | 2007-09-16 21:08:06 +0000 | [diff] [blame^] | 56 | @item size |
bellard | acd935e | 2004-11-15 22:57:26 +0000 | [diff] [blame] | 57 | is the disk image size in kilobytes. Optional suffixes @code{M} |
ths | 5fafdf2 | 2007-09-16 21:08:06 +0000 | [diff] [blame^] | 58 | (megabyte) and @code{G} (gigabyte) are supported |
bellard | acd935e | 2004-11-15 22:57:26 +0000 | [diff] [blame] | 59 | |
| 60 | @item output_filename |
ths | 5fafdf2 | 2007-09-16 21:08:06 +0000 | [diff] [blame^] | 61 | is the destination disk image filename |
bellard | acd935e | 2004-11-15 22:57:26 +0000 | [diff] [blame] | 62 | |
| 63 | @item output_fmt |
| 64 | is the destination format |
| 65 | |
| 66 | @item -c |
| 67 | indicates that target image must be compressed (qcow format only) |
ths | 5fafdf2 | 2007-09-16 21:08:06 +0000 | [diff] [blame^] | 68 | @item -e |
bellard | acd935e | 2004-11-15 22:57:26 +0000 | [diff] [blame] | 69 | indicates that the target image must be encrypted (qcow format only) |
| 70 | @end table |
| 71 | |
| 72 | Command description: |
| 73 | |
| 74 | @table @option |
| 75 | @item create [-e] [-b @var{base_image}] [-f @var{fmt}] @var{filename} [@var{size}] |
| 76 | |
| 77 | Create the new disk image @var{filename} of size @var{size} and format |
ths | 5fafdf2 | 2007-09-16 21:08:06 +0000 | [diff] [blame^] | 78 | @var{fmt}. |
bellard | acd935e | 2004-11-15 22:57:26 +0000 | [diff] [blame] | 79 | |
| 80 | If @var{base_image} is specified, then the image will record only the |
| 81 | differences from @var{base_image}. No size needs to be specified in |
| 82 | this case. @var{base_image} will never be modified unless you use the |
| 83 | @code{commit} monitor command. |
| 84 | |
| 85 | @item commit [-f @var{fmt}] @var{filename} |
| 86 | |
| 87 | Commit the changes recorded in @var{filename} in its base image. |
| 88 | |
| 89 | @item convert [-c] [-e] [-f @var{fmt}] @var{filename} [-O @var{output_fmt}] @var{output_filename} |
| 90 | |
| 91 | Convert the disk image @var{filename} to disk image @var{output_filename} |
ths | 4be456f | 2007-06-03 13:41:28 +0000 | [diff] [blame] | 92 | using format @var{output_fmt}. It can be optionally encrypted |
bellard | acd935e | 2004-11-15 22:57:26 +0000 | [diff] [blame] | 93 | (@code{-e} option) or compressed (@code{-c} option). |
| 94 | |
| 95 | Only the format @code{qcow} supports encryption or compression. The |
| 96 | compression is read-only. It means that if a compressed sector is |
| 97 | rewritten, then it is rewritten as uncompressed data. |
| 98 | |
| 99 | Encryption uses the AES format which is very secure (128 bit keys). Use |
| 100 | a long password (16 characters) to get maximum protection. |
| 101 | |
| 102 | Image conversion is also useful to get smaller image when using a |
| 103 | growable format such as @code{qcow} or @code{cow}: the empty sectors |
| 104 | are detected and suppressed from the destination image. |
| 105 | |
| 106 | @item info [-f @var{fmt}] @var{filename} |
| 107 | |
| 108 | Give information about the disk image @var{filename}. Use it in |
| 109 | particular to know the size reserved on disk which can be different |
bellard | 19d3679 | 2006-08-07 21:34:34 +0000 | [diff] [blame] | 110 | from the displayed size. If VM snapshots are stored in the disk image, |
| 111 | they are displayed too. |
bellard | acd935e | 2004-11-15 22:57:26 +0000 | [diff] [blame] | 112 | @end table |
| 113 | |
| 114 | @c man end |
| 115 | |
| 116 | @ignore |
| 117 | |
| 118 | @setfilename qemu-img |
| 119 | @settitle QEMU disk image utility |
| 120 | |
| 121 | @c man begin SEEALSO |
| 122 | The HTML documentation of QEMU for more precise information and Linux |
| 123 | user mode emulator invocation. |
| 124 | @c man end |
| 125 | |
| 126 | @c man begin AUTHOR |
| 127 | Fabrice Bellard |
| 128 | @c man end |
| 129 | |
| 130 | @end ignore |