resize: Refresh the examples in the documentation.
[libguestfs.git] / tools / virt-resize
index 74f13b1..e89564f 100755 (executable)
@@ -60,7 +60,23 @@ L<virt-list-filesystems(1)> and
 L<virt-df(1)>,
 we recommend you go and read those manual pages first.
 
-=head2 BASIC USAGE
+=head2 EXAMPLES
+
+Copy C<olddisk> to C<newdisk>, 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<parted(8)> 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<guestfish(1)> 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<virt-list-partitions(1)>,
@@ -1007,12 +1039,13 @@ L<pvresize(8)>,
 L<lvresize(8)>,
 L<resize2fs(8)>,
 L<virsh(1)>,
+L<parted(8)>,
 L<Sys::Guestfs(3)>,
 L<http://libguestfs.org/>.
 
 =head1 AUTHOR
 
-Richard W.M. Jones L<http://et.redhat.com/~rjones/>
+Richard W.M. Jones L<http://people.redhat.com/~rjones/>
 
 =head1 COPYRIGHT