X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=tools%2Fvirt-resize;h=e89564f60feca61255bffa63b6a0355fc9bfad07;hb=51c6cc6081e2ca760e0fb4cf7cc11872f27fae3a;hp=74f13b163849692195c493cf4454d1cbe39f52e7;hpb=73ae773ca257b788e7805238a95e128d076a0987;p=libguestfs.git diff --git a/tools/virt-resize b/tools/virt-resize index 74f13b1..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 @@ -995,6 +1011,22 @@ sub canonicalize $_; } +=head1 ALTERNATIVE TOOLS + +There are several proprietary tools for resizing partitions. We +won't mention any here. + +L and its graphical shell gparted can do some types of +resizing operations on disk images. They can resize and move +partitions, but I don't think they can do anything with the contents, +and they certainly don't understand LVM. + +L can do everything that virt-resize can do and a lot +more, but at a much lower level. You will probably end up +hand-calculating sector offsets, which is something that virt-resize +was designed to avoid. If you want to see the guestfish-equivalent +commands that virt-resize runs, use the C<--debug> flag. + =head1 SEE ALSO L, @@ -1007,12 +1039,13 @@ L, L, L, L, +L, L, L. =head1 AUTHOR -Richard W.M. Jones L +Richard W.M. Jones L =head1 COPYRIGHT