X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=resize%2Fvirt-resize.pod;h=3a6af1838fba9f79af8583cdfd0bd40defe43f14;hb=06019bc82e107f7715ebc59e491610e06dad1e39;hp=a071110bb5ca05089ef4821f964b64460ffc67b4;hpb=f2d816573ffba9c5a2022ac5b3b6514eaf02d0f7;p=libguestfs.git diff --git a/resize/virt-resize.pod b/resize/virt-resize.pod index a071110..3a6af18 100644 --- a/resize/virt-resize.pod +++ b/resize/virt-resize.pod @@ -26,24 +26,48 @@ those manual pages first. =head1 EXAMPLES +=over 4 + +=item 1. + Copy C to C, extending one of the guest's partitions to fill the extra 5GB of space. - truncate -r olddisk newdisk; truncate -s +5G newdisk virt-filesystems --long -h --all -a olddisk + + truncate -r olddisk newdisk + truncate -s +5G newdisk + # Note "/dev/sda2" is a partition inside the "olddisk" file. virt-resize --expand /dev/sda2 olddisk newdisk +=item 2. + 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 + virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \ + olddisk newdisk + +=item 3. -As above, but the output format will be uncompressed qcow2: +As in the first example, but expand a logical volume as the final +step. This is what you would typically use for Linux guests that use +LVM: + + virt-resize --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root \ + olddisk newdisk + +=item 4. + +As in the first example, but the output format will be qcow2 instead +of a raw disk: qemu-img create -f qcow2 newdisk.qcow2 15G virt-resize --expand /dev/sda2 olddisk newdisk.qcow2 +=back + =head1 DETAILED USAGE =head2 EXPANDING A VIRTUAL MACHINE DISK