RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 975753 - "virt-resize --expand" and "virt-resize --resize" outputs error message for Win2008 32bit OS
Summary: "virt-resize --expand" and "virt-resize --resize" outputs error message for W...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libguestfs
Version: 6.5
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-19 09:31 UTC by bfan
Modified: 2013-11-21 04:45 UTC (History)
3 users (show)

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.
Clone Of:
Environment:
Last Closed: 2013-11-21 04:45:15 UTC
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:1536 0 normal SHIPPED_LIVE Moderate: libguestfs security, bug fix, and enhancement update 2013-11-21 00:40:55 UTC

Description bfan 2013-06-19 09:31:02 UTC
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 09:51:48 UTC
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 09:52:53 UTC
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 10:03:38 UTC
(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 19:08:37 UTC
(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-20 02:48:29 UTC
Created attachment 763195 [details]
debug output

Comment 6 bfan 2013-06-20 02:50:17 UTC
(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 06:36:04 UTC
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 08:06:41 UTC
I'll put a note in the manual about this.

Comment 12 bfan 2013-07-01 02:40:45 UTC
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-21 04:45:15 UTC
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.