Bug 975753 - "virt-resize --expand" and "virt-resize --resize" outputs error message for Win2008 32bit OS
"virt-resize --expand" and "virt-resize --resize" outputs error message for W...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libguestfs (Show other bugs)
6.5
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Richard W.M. Jones
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-19 05:31 EDT by bfan
Modified: 2013-11-20 23:45 EST (History)
3 users (show)

See Also:
Fixed In Version: libguestfs-1.20.9-5.el6
Doc Type: Bug Fix
Doc Text:
Cause: virt-resize fails on Windows guests that are in an inconsistent state (ie. need a CHKDSK). Consequence: You cannot resize such guests. Fix: No fix, the problem is documented in the man page instead.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-11-20 23:45:15 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
command log with debug info (8.44 KB, text/x-log)
2013-06-19 05:31 EDT, bfan
no flags Details
debug output (142.97 KB, text/plain)
2013-06-19 22:48 EDT, bfan
no flags Details

  None (edit)
Description bfan 2013-06-19 05:31:02 EDT
Created attachment 762816 [details]
command log with debug info

Description of problem:
"virt-resize --expand" and "virt-resize --resize" outputs error message for Win2008 32bit OS, but can get the expected partition in new disk.


Version-Release number of selected component (if applicable):
libguestfs-1.20.8-5.el6.x86_64

How reproducible:
100%


Steps to Reproduce:
# for virt-resize --expand
[root]# virt-list-partitions -lh Win2008-32-hvm.raw
/dev/sda1 ntfs 14.6G
[root]# qemu-img create new_Win2008-32 15.6G
Formatting 'newWin2008-32', fmt=raw size=16750372454
[root]# virt-resize --expand /dev/sda1 Win2008-32-hvm.raw new_Win2008-32

# for virt-resize --resize
[root]# virt-list-partitions -lh Win2008-32-hvm.raw
/dev/sda1 ntfs 14.6G
[root]# qemu-img create newWin2008-32 15.6G
Formatting 'newWin2008-32', fmt=raw size=16750372454
[root]# virt-resize --resize /dev/sda1=+200M Win2008-32-hvm.raw newWin2008-32


Actual results:
Copying /dev/sda1 ...
 100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00
Expanding /dev/sda1 using the 'ntfsresize' method ...
Fatal error: exception Guestfs.Error("ntfsresize: command failed: yes | ntfsresize -P /dev/sda1 (enable debug to see the full error message)")


Expected results:
Copying /dev/sda1 ...
 100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ --:--
Expanding /dev/sda1 using the 'ntfsresize' method ...

Resize operation completed with no errors.  Before deleting the old
disk, carefully check that the resized disk boots and works correctly.


Additional info:
1. Can get the expected partition in new disk though command outputs error message
2. It works with Win2008 64bit OS and other OS
3. It works in rhel7 (libguestfs-1.22.2-1.el7)
Comment 1 Richard W.M. Jones 2013-06-19 05:51:48 EDT
Is libguestfs-winsupport installed?

If so, can you enable debugging so we get to see the
actual error message.
http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs
Comment 2 Richard W.M. Jones 2013-06-19 05:52:53 EDT
BTW if libguestfs-winsupport wasn't installed, this would
still be a bug -- we'd want to improve the error message.
Comment 3 bfan 2013-06-19 06:03:38 EDT
(In reply to Richard W.M. Jones from comment #1)
> Is libguestfs-winsupport installed?
> 
> If so, can you enable debugging so we get to see the
> actual error message.
> http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs

Yes, libguestfs-winsupport already installed, It works for Win2008 64bit OS
Comment 4 Richard W.M. Jones 2013-06-19 15:08:37 EDT
(In reply to bfan from comment #3)
> (In reply to Richard W.M. Jones from comment #1)
> > Is libguestfs-winsupport installed?
> > 
> > If so, can you enable debugging so we get to see the
> > actual error message.
> > http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs
>
> Yes, libguestfs-winsupport already installed.

OK, I still however need to see the debug output.

> It works for Win2008 64bit OS.

Strange ...  However there are lots of ways that ntfsresize
can fail.  Most commonly because the disk wasn't shut down
cleanly and ntfsresize refuses the resize disks that need
a chkdsk.  Unfortunately in Win8 this is the default ...
Comment 5 bfan 2013-06-19 22:48:29 EDT
Created attachment 763195 [details]
debug output
Comment 6 bfan 2013-06-19 22:50:17 EDT
(In reply to Richard W.M. Jones from comment #4)
> (In reply to bfan from comment #3)
> > (In reply to Richard W.M. Jones from comment #1)
> > > Is libguestfs-winsupport installed?
> > > 
> > > If so, can you enable debugging so we get to see the
> > > actual error message.
> > > http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs
> >
> > Yes, libguestfs-winsupport already installed.
> 
> OK, I still however need to see the debug output.
> 
> > It works for Win2008 64bit OS.
> 
> Strange ...  However there are lots of ways that ntfsresize
> can fail.  Most commonly because the disk wasn't shut down
> cleanly and ntfsresize refuses the resize disks that need
> a chkdsk.  Unfortunately in Win8 this is the default ...

[root]# cat test.sh 
virt-list-partitions -lh Win2008-32-hvm.raw
qemu-img create new_Win2008-32 15.6G
export LIBGUESTFS_DEBUG=1
export LIBGUESTFS_TRACE=1
virt-resize --expand /dev/sda1 Win2008-32-hvm.raw new_Win2008-32
[root]# bash test.sh > output.log 2>&1
Comment 7 bfan 2013-06-20 02:36:04 EDT
According to the debug info, do "chkdsk /f" on Windows, then virt-resize again, works well.
Comment 8 Richard W.M. Jones 2013-06-20 04:06:41 EDT
I'll put a note in the manual about this.
Comment 12 bfan 2013-06-30 22:40:45 EDT
Verified with libguestfs-1.20.9-5.el6

Found this section in virt-resize man page

"
   WINDOWS CHKDSK
       Windows disks which use NTFS must be consistent before virt-resize can be used.  If the ntfsresize operation fails, try booting the original VM and
       running "chkdsk /f" on all NTFS partitions, then shut down the VM cleanly.  For further information see:
       https://bugzilla.redhat.com/show_bug.cgi?id=975753

       After resize Windows may initiate a lengthy "chkdsk" on first boot if NTFS partitions have been expanded.  This is just a safety check and (unless
       it find errors) is nothing to worry about.
"

Change the status to verified
Comment 17 errata-xmlrpc 2013-11-20 23:45:15 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2013-1536.html

Note You need to log in before you can comment on or make changes to this bug.