[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libguestfs] virt-resize problem for Windows 2003

On Wed, Nov 06, 2013 at 10:58:06AM +0800, Xinglong Wu wrote:
> Hi,
>      I'm using virt-resize to expand the primary partition (C:) in a
> Windows 2003 image. The command works fine but after expanding, when I boot
> into Windows 2003, all the other partitions (D:, E:, and F:) are lost.

I can see why this would happen.

In the Windows registry, Windows stores drive letter mappings using a
(basically crazy) system using the partition offset.  It is described here:

  "How does Windows XP remember drive letters?"

We implement this in libguestfs:


Virt-resize moves partitions around, so of course the partition offset
changes and we don't update the registry to reflect this.  As a result
Windows cannot find the D:/E:/... partitions any longer.  (I believe
the C: drive probably works a bit differently, so the C: drive isn't "lost").

Anyway, we could conceivably fix up the Registry in virt-resize.  You
would need to file an RFE bug:


Patches would be even better, since I don't know when we'd get around
to fixing such a complex corner-case.

> After using the disk management tool within Windows 2003, I can re-label
> the above three partitions and all the files are still there. But it is
> really annoying because every time you have to do some work by hand after
> expanding the disk size. As below is the details:
> Host OS: RHEL6.3
> libguestfs: libguestfs-1.16.19-1.el6.x86_64
>                  libguestfs-tools-c-1.16.19-1.el6.x86_64
>                  libguestfs-winsupport-1.0-7.el6.x86_64

It won't fix your problem, but there is a newer version of libguestfs
available for RHEL 6 users:


> Guest OS partitions:
>            C:    /dev/sda1  primary
>            D:    /dev/sda5  logical
>            E:    /dev/sda6  logical
>            F:    /dev/sda7  logical
> Also, if I use virt-resize on logical partitions (i.e., D: E: or F:), the
> command runs fine but logical partitions don't actually expand. Exactly the
> same problem as descripted above shows up, and now, these logical
> partitions don't even change their sizes. Any suggestions?

Virt-resize cannot resize individual logical partitions.  It can only
resize the extended partition that contains the logical partitions.  See:


This is not expected to change any time soon.


Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]