aboutsummaryrefslogtreecommitdiff
path: root/qemu-img.texi
diff options
context:
space:
mode:
authorPavel Butsykin <pbutsykin@virtuozzo.com>2017-09-18 15:42:27 +0300
committerMax Reitz <mreitz@redhat.com>2017-09-26 15:00:32 +0200
commit4ffca8904a350460cdaa6304ea8c9b9c693d2d91 (patch)
tree3d7c0d764d18334222c11e84dc8a081361ada1b6 /qemu-img.texi
parent69ff158b677df0862b2f2639740c8fda5eb91599 (diff)
downloadqemu-4ffca8904a350460cdaa6304ea8c9b9c693d2d91.zip
qemu-4ffca8904a350460cdaa6304ea8c9b9c693d2d91.tar.gz
qemu-4ffca8904a350460cdaa6304ea8c9b9c693d2d91.tar.bz2
qemu-img: add --shrink flag for resize
The flag is additional precaution against data loss. Perhaps in the future the operation shrink without this flag will be blocked for all formats, but for now we need to maintain compatibility with raw. Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20170918124230.8152-2-pbutsykin@virtuozzo.com [mreitz: Added a missing space to a warning] Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'qemu-img.texi')
-rw-r--r--qemu-img.texi6
1 files changed, 5 insertions, 1 deletions
diff --git a/qemu-img.texi b/qemu-img.texi
index 90c7eab..ee5c594 100644
--- a/qemu-img.texi
+++ b/qemu-img.texi
@@ -545,7 +545,7 @@ qemu-img rebase -b base.img diff.qcow2
At this point, @code{modified.img} can be discarded, since
@code{base.img + diff.qcow2} contains the same information.
-@item resize [--preallocation=@var{prealloc}] @var{filename} [+ | -]@var{size}
+@item resize [--shrink] [--preallocation=@var{prealloc}] @var{filename} [+ | -]@var{size}
Change the disk image as if it had been created with @var{size}.
@@ -553,6 +553,10 @@ Before using this command to shrink a disk image, you MUST use file system and
partitioning tools inside the VM to reduce allocated file systems and partition
sizes accordingly. Failure to do so will result in data loss!
+When shrinking images, the @code{--shrink} option must be given. This informs
+qemu-img that the user acknowledges all loss of data beyond the truncated
+image's end.
+
After using this command to grow a disk image, you must use file system and
partitioning tools inside the VM to actually begin using the new space on the
device.