Maxim Perevedentsev
2015-Dec-10 10:55 UTC
[Libguestfs] Bug: windows server 2012R2 fails to start after virt-resize
Hello everyone! After I ran virt-resize (v1.31.28) on my disk with win2012R2 (partition table [GPT]: VFAT (100M), unknown (128M), NTFS (64G)) My VM fails to boot: black screen informing that Windows failed to start... Status: 0xc000000e Info: an unexpected error has occured. After some investigations, I realized that Windows remembers the GUID of disk it is installed to. If I execute >guestfish -a win2012.hdd -v ... ><fs> debug sh 'sgdisk -p /dev/sda' guestfsd: main_loop: new request, len 0x54 /bin/sh -c sgdisk -p /dev/sda Disk /dev/sda: 136314880 sectors, 65.0 GiB Logical sector size: 512 bytes Disk identifier (GUID): B3108127-1775-47B7-ABC1-A56D6761C894 Partition table holds up to 128 entries First usable sector is 34, last usable sector is 136314846 Partitions will be aligned on 2048-sector boundaries Total free space is 2101181 sectors (1.0 GiB) Number Start (sector) End (sector) Size Code Name 1 2048 206847 100.0 MiB EF00 EFI 2 206848 468991 128.0 MiB 0C01 Microsoft 3 468992 134215679 63.8 GiB 0700 Basic guestfsd: main_loop: proc 76 (debug) took 0.00 seconds *set the GUID of original disk* ><fs> debug sh 'sgdisk -U ADAA2225-3F89-4F2C-91DF-02F3E0C2ED67 /dev/sda' guestfsd: main_loop: new request, len 0x7c /bin/sh -c sgdisk -U ADAA2225-3F89-4F2C-91DF-02F3E0C2ED67 /dev/sda [ 70.170139] sda: sda1 sda2 sda3 The operation has completed successfully. guestfsd: main_loop: proc 76 (debug) took 1.02 seconds The operation has completed successfully. After that Windows successfully boots from resized image. I suggest adding get/set disk GUID to API and to virt-resize as well. Otherwise it is impossible to resize disks with this particular OS (not only this one, possibly). And yeah, libguestfs strips partition names, but windows seems to ignore that. Waiting for comments. -- Your sincerely, Maxim Perevedentsev
Pino Toscano
2015-Dec-10 11:55 UTC
Re: [Libguestfs] Bug: windows server 2012R2 fails to start after virt-resize
On Thursday 10 December 2015 13:55:26 Maxim Perevedentsev wrote:> Hello everyone! > > After I ran virt-resize (v1.31.28) on my disk with win2012R2 > (partition table [GPT]: VFAT (100M), unknown (128M), NTFS (64G)) > My VM fails to boot: black screen informing that > > Windows failed to start... > Status: 0xc000000e > Info: an unexpected error has occured. > > After some investigations, I realized that Windows remembers the GUID of > disk it is installed to. > If I execute > > >guestfish -a win2012.hdd -v > ... > ><fs> debug sh 'sgdisk -p /dev/sda' > guestfsd: main_loop: new request, len 0x54 > /bin/sh -c sgdisk -p /dev/sda > Disk /dev/sda: 136314880 sectors, 65.0 GiB > Logical sector size: 512 bytes > Disk identifier (GUID): B3108127-1775-47B7-ABC1-A56D6761C894 > Partition table holds up to 128 entries > First usable sector is 34, last usable sector is 136314846 > Partitions will be aligned on 2048-sector boundaries > Total free space is 2101181 sectors (1.0 GiB) > > Number Start (sector) End (sector) Size Code Name > 1 2048 206847 100.0 MiB EF00 EFI > 2 206848 468991 128.0 MiB 0C01 Microsoft > 3 468992 134215679 63.8 GiB 0700 Basic > guestfsd: main_loop: proc 76 (debug) took 0.00 seconds > > *set the GUID of original disk* > ><fs> debug sh 'sgdisk -U ADAA2225-3F89-4F2C-91DF-02F3E0C2ED67 /dev/sda' > guestfsd: main_loop: new request, len 0x7c > /bin/sh -c sgdisk -U ADAA2225-3F89-4F2C-91DF-02F3E0C2ED67 /dev/sda > [ 70.170139] sda: sda1 sda2 sda3 > The operation has completed successfully. > guestfsd: main_loop: proc 76 (debug) took 1.02 seconds > The operation has completed successfully. > > After that Windows successfully boots from resized image. > > I suggest adding get/set disk GUID to API and to virt-resize as well. > Otherwise it is impossible to resize disks with this particular OS (not > only this one, possibly).This is supposed to be done already, see https://bugzilla.redhat.com/show_bug.cgi?id=1189284 (and the commits linked to its comment #9). Please provide a full log of virt-resize with -v -x. -- Pino Toscano
Maxim Perevedentsev
2015-Dec-10 13:34 UTC
Re: [Libguestfs] Bug: windows server 2012R2 fails to start after virt-resize
On 12/10/2015 02:55 PM, Pino Toscano wrote:> On Thursday 10 December 2015 13:55:26 Maxim Perevedentsev wrote: >> Hello everyone! >> >> After I ran virt-resize (v1.31.28) on my disk with win2012R2 >> (partition table [GPT]: VFAT (100M), unknown (128M), NTFS (64G)) >> My VM fails to boot: black screen informing that >> >> Windows failed to start... >> Status: 0xc000000e >> Info: an unexpected error has occured. >> >> After some investigations, I realized that Windows remembers the GUID of >> disk it is installed to. >> If I execute >> >> >guestfish -a win2012.hdd -v >> ... >> ><fs> debug sh 'sgdisk -p /dev/sda' >> guestfsd: main_loop: new request, len 0x54 >> /bin/sh -c sgdisk -p /dev/sda >> Disk /dev/sda: 136314880 sectors, 65.0 GiB >> Logical sector size: 512 bytes >> Disk identifier (GUID): B3108127-1775-47B7-ABC1-A56D6761C894 >> Partition table holds up to 128 entries >> First usable sector is 34, last usable sector is 136314846 >> Partitions will be aligned on 2048-sector boundaries >> Total free space is 2101181 sectors (1.0 GiB) >> >> Number Start (sector) End (sector) Size Code Name >> 1 2048 206847 100.0 MiB EF00 EFI >> 2 206848 468991 128.0 MiB 0C01 Microsoft >> 3 468992 134215679 63.8 GiB 0700 Basic >> guestfsd: main_loop: proc 76 (debug) took 0.00 seconds >> >> *set the GUID of original disk* >> ><fs> debug sh 'sgdisk -U ADAA2225-3F89-4F2C-91DF-02F3E0C2ED67 /dev/sda' >> guestfsd: main_loop: new request, len 0x7c >> /bin/sh -c sgdisk -U ADAA2225-3F89-4F2C-91DF-02F3E0C2ED67 /dev/sda >> [ 70.170139] sda: sda1 sda2 sda3 >> The operation has completed successfully. >> guestfsd: main_loop: proc 76 (debug) took 1.02 seconds >> The operation has completed successfully. >> >> After that Windows successfully boots from resized image. >> >> I suggest adding get/set disk GUID to API and to virt-resize as well. >> Otherwise it is impossible to resize disks with this particular OS (not >> only this one, possibly). > This is supposed to be done already, see > https://bugzilla.redhat.com/show_bug.cgi?id=1189284 > (and the commits linked to its comment #9).This is another bug: the fixed one was about partition GUIDs. Now partition GUIDs are preserved, but the OS refuses to boot because of changed *disk* GUID.> > Please provide a full log of virt-resize with -v -x.OK, attached.> > > > _______________________________________________ > Libguestfs mailing list > Libguestfs@redhat.com > https://www.redhat.com/mailman/listinfo/libguestfs-- Your sincerely, Maxim Perevedentsev
Apparently Analagous Threads
- Re: Bug: windows server 2012R2 fails to start after virt-resize
- Bug: windows server 2012R2 fails to start after virt-resize
- Re: Bug: windows server 2012R2 fails to start after virt-resize
- Re: [PATCH 2/3] New API: part-get-name (RHBZ#593511).
- [PATCH] daemon: drop error message check in do_part_expand_gpt