From 51c6cc6081e2ca760e0fb4cf7cc11872f27fae3a Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Tue, 25 May 2010 11:45:23 +0100 Subject: [PATCH] resize: Refresh the examples in the documentation. The documentation was previously very intimidating. Bring some common, simple examples up to the top of the page in a separate section. For stable-1.2 branch: - cherry picked from commit 0e28e4104d96bf0bf5b88fb07bb7e5f9f6e6f41f - modified instructions slightly to apply to older version of virt-list-partitions - replace 'truncate' with 'dd' --- tools/virt-resize | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tools/virt-resize b/tools/virt-resize index 7ee3f27..e89564f 100755 --- a/tools/virt-resize +++ b/tools/virt-resize @@ -60,7 +60,23 @@ L and L, we recommend you go and read those manual pages first. -=head2 BASIC USAGE +=head2 EXAMPLES + +Copy C to C, extending one of the guest's partitions +to fill the extra 5GB of space. + + virt-list-partitions -lh olddisk + # Make a new blank disk which is larger than the old disk file. + dd if=/dev/zero of=newdisk bs=1024k count=15000 + # Note "/dev/sda2" is a partition inside the "olddisk" file. + virt-resize --expand /dev/sda2 olddisk newdisk + +As above, but make the /boot partition 200MB bigger, while giving the +remaining space to /dev/sda2: + + virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 olddisk newdisk + +=head2 DETAILED USAGE This describes the common case where you want to expand an image to give your guest more space. Shrinking images is considerably more -- 1.8.3.1