git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fish: Fix incorrect path passed to perror.
[libguestfs.git]
/
tools
/
virt-resize
diff --git
a/tools/virt-resize
b/tools/virt-resize
index
2d8e0f1
..
5d0673a
100755
(executable)
--- a/
tools/virt-resize
+++ b/
tools/virt-resize
@@
-1,6
+1,6
@@
#!/usr/bin/perl -w
# virt-resize
#!/usr/bin/perl -w
# virt-resize
-# Copyright (C) 2010 Red Hat Inc.
+# Copyright (C) 2010
-2011
Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@
-58,10
+58,8
@@
B<should not> be used on live virtual machines - for consistent
results, shut the virtual machine down before resizing it.
If you are not familiar with the associated tools:
results, shut the virtual machine down before resizing it.
If you are not familiar with the associated tools:
-L<virt-list-partitions(1)>,
-L<virt-list-filesystems(1)> and
-L<virt-df(1)>,
-we recommend you go and read those manual pages first.
+L<virt-filesystems(1)> and L<virt-df(1)>, we recommend you go and read
+those manual pages first.
=head1 EXAMPLES
=head1 EXAMPLES
@@
-69,7
+67,7
@@
Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions
to fill the extra 5GB of space.
truncate -r olddisk newdisk; truncate -s +5G newdisk
to fill the extra 5GB of space.
truncate -r olddisk newdisk; truncate -s +5G newdisk
- virt-
list-partitions -lht
olddisk
+ virt-
filesystems --long -h --all -a
olddisk
# Note "/dev/sda2" is a partition inside the "olddisk" file.
virt-resize --expand /dev/sda2 olddisk newdisk
# Note "/dev/sda2" is a partition inside the "olddisk" file.
virt-resize --expand /dev/sda2 olddisk newdisk
@@
-104,13
+102,14
@@
can use C<virsh dumpxml> like this to find the disk image name:
=item 3. Look at current sizing
=item 3. Look at current sizing
-Use L<virt-
list-partition
s(1)> to display the current partitions and
+Use L<virt-
filesystem
s(1)> to display the current partitions and
sizes:
sizes:
- # virt-list-partitions -lht /dev/vg/lv_guest
- /dev/sda1 ext3 101.9M
- /dev/sda2 pv 7.9G
- /dev/sda device 8.0G
+ # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest
+ Name Type Size Parent
+ /dev/sda1 partition 101M /dev/sda
+ /dev/sda2 partition 7.9G /dev/sda
+ /dev/sda device 8.0G -
(This example is a virtual machine with an 8 GB disk which we would
like to expand up to 10 GB).
(This example is a virtual machine with an 8 GB disk which we would
like to expand up to 10 GB).
@@
-173,9
+172,7
@@
PV, then if virt-resize knows how, it will resize the contents, the
equivalent of calling a command such as L<pvresize(8)>,
L<resize2fs(8)> or L<ntfsresize(8)>. However virt-resize does not
know how to resize some filesystems, so you would have to online
equivalent of calling a command such as L<pvresize(8)>,
L<resize2fs(8)> or L<ntfsresize(8)>. However virt-resize does not
know how to resize some filesystems, so you would have to online
-resize them after booting the guest. And virt-resize also does not
-resize anything inside an LVM PV, it just resizes the PV itself and
-leaves the user to resize any LVs inside that PV as desired.
+resize them after booting the guest.
Other options are covered below.
Other options are covered below.
@@
-362,9
+359,9
@@
Windows will check the disk.
=item *
=item *
-LVM PVs (physical volumes).
However virt-resize does I<not>
-resize anything inside the PV. The user will have to resize
-
LVs as desired
.
+LVM PVs (physical volumes).
virt-resize does not usually resize
+anything inside the PV, but see the C<--LV-expand> option. The user
+
could also resize LVs as desired after boot
.
=back
=back
@@
-443,7
+440,7
@@
The contents of the LV are also resized if virt-resize knows how to do
that. You can stop virt-resize from trying to expand the content by
using the option C<--no-expand-content>.
that. You can stop virt-resize from trying to expand the content by
using the option C<--no-expand-content>.
-Use L<virt-
list-
filesystems(1)> to list the filesystems in
+Use L<virt-filesystems(1)> to list the filesystems in
the guest.
You can give this option multiple times, I<but> it doesn't
the guest.
You can give this option multiple times, I<but> it doesn't
@@
-601,7
+598,8
@@
sub launch_guestfs
@args = ($outfile);
push @args, format => $output_format if defined $output_format;
$g->add_drive_opts (@args);
@args = ($outfile);
push @args, format => $output_format if defined $output_format;
$g->add_drive_opts (@args);
- $g->set_progress_callback (\&progress_callback) unless $quiet;
+ $g->set_event_callback (\&progress_callback, $Sys::Guestfs::EVENT_PROGRESS)
+ unless $quiet;
$g->launch ();
}
$g->launch ();
}
@@
-1404,10
+1402,15
@@
sub canonicalize
# I intend to use an external library for this at some point (XXX).
sub progress_callback
{
# I intend to use an external library for this at some point (XXX).
sub progress_callback
{
- my $proc_nr = shift;
- my $serial = shift;
- my $position = shift;
- my $total = shift;
+ my $event = shift;
+ my $event_handle = shift;
+ my $buf = shift;
+ my $array = shift;
+
+ my $proc_nr = $array->[0];
+ my $serial = $array->[1];
+ my $position = $array->[2];
+ my $total = $array->[3];
my $ratio = $position / $total;
if ($ratio < 0) { $ratio = 0 }
my $ratio = $position / $total;
if ($ratio < 0) { $ratio = 0 }
@@
-1485,8
+1488,7
@@
manual page L<sh(1)> for details.
=head1 SEE ALSO
=head1 SEE ALSO
-L<virt-list-partitions(1)>,
-L<virt-list-filesystems(1)>,
+L<virt-filesystems(1)>,
L<virt-df(1)>,
L<guestfs(3)>,
L<guestfish(1)>,
L<virt-df(1)>,
L<guestfs(3)>,
L<guestfish(1)>,