X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=resize%2Fvirt-resize.pod;h=9ee9c6f6e20e3f4503ebbe10f273d06cbf277415;hp=622d8b9154de77b23a09c51a9f0754e34f577598;hb=HEAD;hpb=fac15924f59a076c903d453d20305e00e1ae258a diff --git a/resize/virt-resize.pod b/resize/virt-resize.pod index 622d8b9..9ee9c6f 100644 --- a/resize/virt-resize.pod +++ b/resize/virt-resize.pod @@ -238,6 +238,27 @@ Similarly, to get non-sparse raw output use: (on older systems that don't have the L command use C
) +=head2 LOGICAL PARTITIONS + +Logical partitions (a.k.a. C on disks using DOS partition +tables) cannot be resized. + +To understand what is going on, firstly one of the four partitions +C will have MBR partition type C<05> or C<0f>. This is +called the B. Use L to see +the MBR partition type. + +Logical partitions live inside the extended partition. + +The extended partition can be expanded, but not shrunk (unless you +force it, which is not advisable). When the extended partition is +copied across, all the logical partitions contained inside are copied +over implicitly. Virt-resize does not look inside the extended +partition, so it copies the logical partitions blindly. + +You cannot specify a logical partition (C) at all on the +command line. Doing so will give an error. + =head1 OPTIONS =over 4 @@ -246,12 +267,74 @@ C
) Display help. +=item B<--align-first auto> + +=item B<--align-first never> + +=item B<--align-first always> + +Align the first partition for improved performance (see also the +I<--alignment> option). + +The default is I<--align-first auto> which only aligns the first +partition if it is safe to do so. That is, only when we know how to +fix the bootloader automatically, and at the moment that can only be +done for Windows guests. + +I<--align-first never> means we never move the first partition. +This is the safest option. Try this if the guest does not boot +after resizing. + +I<--align-first always> means we always align the first partition (if +it needs to be aligned). For some guests this will break the +bootloader, making the guest unbootable. + +=item B<--alignment N> + +Set the alignment of partitions to C sectors. The default in +virt-resize E 1.13.19 was 64 sectors, and after that is 128 +sectors. + +Assuming 512 byte sector size inside the guest, here are some +suitable values for this: + +=over 4 + +=item I<--alignment 1> (512 bytes) + +The partitions would be packed together as closely as possible, but +would be completely unaligned. In some cases this can cause very poor +performance. See L for further details. + +=item I<--alignment 8> (4K) + +This would be the minimum acceptable alignment for reasonable +performance on modern hosts. + +=item I<--alignment 128> (64K) + +This alignment provides good performance when the host is using high +end network storage. + +=item I<--alignment 2048> (1M) + +This is the standard alignment used by all newly installed guests +since around 2008. + +=back + =item B<-d> =item B<--debug> Enable debugging messages. +=item B<--debug-gc> + +Debug garbage collection and memory allocation. This is only useful +when debugging memory problems in virt-resize or the OCaml libguestfs +bindings. + =item B<--delete part> Delete the named partition. It would be more accurate to describe @@ -545,21 +628,21 @@ I<--machine-readable> option and will return an error. =head2 "Partition 1 does not end on cylinder boundary." -Virt-resize aligns partitions to multiples of 64 sectors. Usually -this means the partitions will not be aligned to the ancient CHS -geometry. However CHS geometry is meaningless for disks manufactured -since the early 1990s, and doubly so for virtual hard drives. -Alignment of partitions to cylinders is not required by any modern -operating system. +Virt-resize aligns partitions to multiples of 128 sectors (see the +I<--alignment> parameter). Usually this means the partitions will not +be aligned to the ancient CHS geometry. However CHS geometry is +meaningless for disks manufactured since the early 1990s, and doubly +so for virtual hard drives. Alignment of partitions to cylinders is +not required by any modern operating system. =head2 RESIZING WINDOWS VIRTUAL MACHINES In Windows Vista and later versions, Microsoft switched to using a separate boot partition. In these VMs, typically C is the -boot partition and C is the main (C:) drive. We have not -had any luck resizing the boot partition. Doing so seems to break the -guest completely. However expanding the second partition (ie. C: -drive) should work. +boot partition and C is the main (C:) drive. Resizing the +first (boot) partition causes the bootloader to fail with +C<0xC0000225> error. Resizing the second partition (ie. C: drive) +should work. Windows may initiate a lengthy "chkdsk" on first boot after a resize, if NTFS partitions have been expanded. This is just a safety check @@ -568,9 +651,7 @@ and (unless it find errors) is nothing to worry about. =head2 GUEST BOOT STUCK AT "GRUB" If a Linux guest does not boot after resizing, and the boot is stuck -after printing C on the console, try reinstalling grub. This -sometimes happens on older (RHEL 5-era) guests, for reasons we don't -fully understand, although we think is to do with partition alignment. +after printing C on the console, try reinstalling grub. guestfish -i -a newdisk > cat /boot/grub/device.map @@ -630,6 +711,7 @@ L, L, L, L, +L, L. =head1 AUTHOR @@ -652,4 +734,4 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.