Bug 1373879 - virt-resize --expand fails with win2008 x86 image on aarch64 uefi host
Summary: virt-resize --expand fails with win2008 x86 image on aarch64 uefi host
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.3
Hardware: aarch64
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1212027
TreeView+ depends on / blocked
 
Reported: 2016-09-07 11:12 UTC by Xianghua Chen
Modified: 2017-02-23 09:40 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-02-23 09:40:57 UTC
Target Upstream Version:


Attachments (Terms of Use)
log.virt-resize_win2008_i386 (119.72 KB, text/plain)
2016-09-07 11:12 UTC, Xianghua Chen
no flags Details

Description Xianghua Chen 2016-09-07 11:12:10 UTC
Created attachment 1198651 [details]
log.virt-resize_win2008_i386

Description of problem:
 virt-resize --expand fails with win2008 x86 image on aarch64 uefi host.

Please refer to the detailed log with -v -x in the attachment.

Version-Release number of selected component (if applicable):
libguestfs-1.32.7-2.el7.aarch64
kernel-4.5.0-3.el7.aarch64
libguestfs-winsupport-7.2-1.el7.aarch64

How reproducible:
Always

Steps to Reproduce:
1. Prepare a win2008 x86 image:
Win2008-32-hvm.raw
2.
# virt-filesystems -a images/Win2008-32-hvm.raw -l
Name       Type        VFS   Label       Size         Parent
/dev/sda1  filesystem  ntfs  OS_Install  15728640000  -
3.
# qemu-img create libguestfs_virt-resize_test.img 17106127360

4.
# virt-resize --expand /dev/sda1 images/Win2008-32-hvm.raw libguestfs_virt-resize_test.img
... ...
[  74.9] Expanding /dev/sda1 using the 'ntfsresize' method
virt-resize: error: libguestfs error: ntfsresize: /dev/sda1: ntfsresize
v2015.3.14 (libntfs-3g)
Device name        : /dev/sda1
NTFS volume version: 3.1
Cluster size       : 4096 bytes
Current volume size: 15728636416 bytes (15729 MB)
Current device size: 17103912960 bytes (17104 MB)
New volume size    : 17103909376 bytes (17104 MB)
Checking filesystem consistency ...
Accounting clusters ...
Cluster accounting failed at 1298595 (0x13d0a3): missing cluster in $Bitmap
Cluster accounting failed at 1298596 (0x13d0a4): missing cluster in $Bitmap
Cluster accounting failed at 1298597 (0x13d0a5): missing cluster in $Bitmap
Cluster accounting failed at 1298598 (0x13d0a6): missing cluster in $Bitmap
Cluster accounting failed at 1298599 (0x13d0a7): missing cluster in $Bitmap
Cluster accounting failed at 1298600 (0x13d0a8): missing cluster in $Bitmap
Cluster accounting failed at 1298601 (0x13d0a9): missing cluster in $Bitmap
Cluster accounting failed at 1298602 (0x13d0aa): missing cluster in $Bitmap
Cluster accounting failed at 1298603 (0x13d0ab): missing cluster in $Bitmap
Cluster accounting failed at 1298604 (0x13d0ac): missing cluster in $Bitmap
Filesystem check failed! Totally 30 cluster accounting mismatches.
ERROR: NTFS is inconsistent. Run chkdsk /f on Windows then reboot it TWICE!
The usage of the /f parameter is very IMPORTANT! No modification was
and will be made to NTFS by this software until it gets repaired.

If reporting bugs, run virt-resize with debugging enabled and include the
complete output:

  virt-resize -v -x [...]



Actual results:
As above.

Expected results:
Command should finished successfully in step 4.

Additional info:
win2008 x86_64 image is ok.
On ppc64le/x86-64 is ok.

Comment 1 Richard W.M. Jones 2017-02-16 16:41:08 UTC
I tried resizing two different Windows guests on both Fedora 25 and
RHEL 7.3, and I was unable to reproduce this bug at all.  Do you
by chance have the guest image so I can try it?

Comment 2 Xianghua Chen 2017-02-20 07:42:52 UTC
(In reply to Richard W.M. Jones from comment #1)
> I tried resizing two different Windows guests on both Fedora 25 and
> RHEL 7.3, and I was unable to reproduce this bug at all.  Do you
> by chance have the guest image so I can try it?

Were you trying this on  aarch64 uefi host? Were you using Win2008-32 ?As I said, the x86_64 image doesn't have this problem.

We have an nfs server, you can try this one:
  10.8.184.80:/mnt/image/Win2008-32-hvm.raw

Any problem, pls let me know, thank you:)

Comment 3 Richard W.M. Jones 2017-02-20 08:40:27 UTC
(In reply to Xianghua Chen from comment #2)
> (In reply to Richard W.M. Jones from comment #1)
> > I tried resizing two different Windows guests on both Fedora 25 and
> > RHEL 7.3, and I was unable to reproduce this bug at all.  Do you
> > by chance have the guest image so I can try it?
> 
> Were you trying this on  aarch64 uefi host?

Yes.

> Were you using Win2008-32 ?

No.

> As I
> said, the x86_64 image doesn't have this problem.

OK, so it's probably because I was using a 64 bit guest.

> We have an nfs server, you can try this one:
>   10.8.184.80:/mnt/image/Win2008-32-hvm.raw

I'll grab this now and try it, thanks.

Comment 4 Richard W.M. Jones 2017-02-21 15:57:58 UTC
I tried the image on x86_64, and I get the exact same errors:

$ guestfish --ro -a Win2008-32-hvm.raw run : download /dev/sda1 bz1373879.img
$ cp bz1373879.img resized.img
$ truncate -s20G resized.img 
$ virt-rescue -a resized.img
><rescue> ntfsresize /dev/sda 
ntfsresize v2016.2.22 (libntfs-3g)
Device name        : /dev/sda
NTFS volume version: 3.1
Cluster size       : 4096 bytes
Current volume size: 15728636416 bytes (15729 MB)
Current device size: 21474836480 bytes (21475 MB)
New volume size    : 21474832896 bytes (21475 MB)
Checking filesystem consistency ...
100.00 percent completed
Accounting clusters ...
Cluster accounting failed at 1298595 (0x13d0a3): missing cluster in $Bitmap
Cluster accounting failed at 1298596 (0x13d0a4): missing cluster in $Bitmap
Cluster accounting failed at 1298597 (0x13d0a5): missing cluster in $Bitmap
Cluster accounting failed at 1298598 (0x13d0a6): missing cluster in $Bitmap
Cluster accounting failed at 1298599 (0x13d0a7): missing cluster in $Bitmap
Cluster accounting failed at 1298600 (0x13d0a8): missing cluster in $Bitmap
Cluster accounting failed at 1298601 (0x13d0a9): missing cluster in $Bitmap
Cluster accounting failed at 1298602 (0x13d0aa): missing cluster in $Bitmap
Cluster accounting failed at 1298603 (0x13d0ab): missing cluster in $Bitmap
Cluster accounting failed at 1298604 (0x13d0ac): missing cluster in $Bitmap
Filesystem check failed! Totally 30 cluster accounting mismatches.
ERROR: NTFS is inconsistent. Run chkdsk /f on Windows then reboot it TWICE!
The usage of the /f parameter is very IMPORTANT! No modification was
and will be made to NTFS by this software until it gets repaired.
><rescue> uname -a
Linux (none) 4.10.0-0.rc7.git0.1.fc26.x86_64 #1 SMP Mon Feb 6 15:19:38 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

So I think the problem here is that the image is broken.

Comment 5 Richard W.M. Jones 2017-02-21 15:58:44 UTC
In fact even virt-resize fails on x86_64 on this image:

$ truncate -s 20G resized
$ virt-resize Win2008-32-hvm.raw resized --expand /dev/sda1 
[   0.0] Examining Win2008-32-hvm.raw
 100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ --:--
**********

Summary of changes:

/dev/sda1: This partition will be resized from 14.6G to 20.0G.  The 
filesystem ntfs on /dev/sda1 will be expanded using the 'ntfsresize' 
method.

**********
[   7.2] Setting up initial partition table on resized
[   7.4] Copying /dev/sda1
 100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00
[  35.8] Expanding /dev/sda1 using the 'ntfsresize' method
virt-resize: error: libguestfs error: ntfsresize: /dev/sda1: ntfsresize 
v2016.2.22 (libntfs-3g)
Device name        : /dev/sda1
NTFS volume version: 3.1
Cluster size       : 4096 bytes
Current volume size: 15728636416 bytes (15729 MB)
Current device size: 21472608256 bytes (21473 MB)
New volume size    : 21472604672 bytes (21473 MB)
Checking filesystem consistency ...
Accounting clusters ...
Cluster accounting failed at 1298595 (0x13d0a3): missing cluster in $Bitmap
Cluster accounting failed at 1298596 (0x13d0a4): missing cluster in $Bitmap
Cluster accounting failed at 1298597 (0x13d0a5): missing cluster in $Bitmap
Cluster accounting failed at 1298598 (0x13d0a6): missing cluster in $Bitmap
Cluster accounting failed at 1298599 (0x13d0a7): missing cluster in $Bitmap
Cluster accounting failed at 1298600 (0x13d0a8): missing cluster in $Bitmap
Cluster accounting failed at 1298601 (0x13d0a9): missing cluster in $Bitmap
Cluster accounting failed at 1298602 (0x13d0aa): missing cluster in $Bitmap
Cluster accounting failed at 1298603 (0x13d0ab): missing cluster in $Bitmap
Cluster accounting failed at 1298604 (0x13d0ac): missing cluster in $Bitmap
Filesystem check failed! Totally 30 cluster accounting mismatches.
ERROR: NTFS is inconsistent. Run chkdsk /f on Windows then reboot it TWICE!
The usage of the /f parameter is very IMPORTANT! No modification was
and will be made to NTFS by this software until it gets repaired.

If reporting bugs, run virt-resize with debugging enabled and include the 
complete output:

  virt-resize -v -x [...]

Comment 6 Xianghua Chen 2017-02-23 09:40:57 UTC
(In reply to Richard W.M. Jones from comment #5)
> In fact even virt-resize fails on x86_64 on this image:
> 
> $ truncate -s 20G resized
> $ virt-resize Win2008-32-hvm.raw resized --expand /dev/sda1 
> [   0.0] Examining Win2008-32-hvm.raw
>  100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧
> --:--
> **********
> 
> Summary of changes:
> 
> /dev/sda1: This partition will be resized from 14.6G to 20.0G.  The 
> filesystem ntfs on /dev/sda1 will be expanded using the 'ntfsresize' 
> method.
> 
> **********
> [   7.2] Setting up initial partition table on resized
> [   7.4] Copying /dev/sda1
>  100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧
> 00:00
> [  35.8] Expanding /dev/sda1 using the 'ntfsresize' method
> virt-resize: error: libguestfs error: ntfsresize: /dev/sda1: ntfsresize 
> v2016.2.22 (libntfs-3g)
> Device name        : /dev/sda1
> NTFS volume version: 3.1
> Cluster size       : 4096 bytes
> Current volume size: 15728636416 bytes (15729 MB)
> Current device size: 21472608256 bytes (21473 MB)
> New volume size    : 21472604672 bytes (21473 MB)
> Checking filesystem consistency ...
> Accounting clusters ...
> Cluster accounting failed at 1298595 (0x13d0a3): missing cluster in $Bitmap
> Cluster accounting failed at 1298596 (0x13d0a4): missing cluster in $Bitmap
> Cluster accounting failed at 1298597 (0x13d0a5): missing cluster in $Bitmap
> Cluster accounting failed at 1298598 (0x13d0a6): missing cluster in $Bitmap
> Cluster accounting failed at 1298599 (0x13d0a7): missing cluster in $Bitmap
> Cluster accounting failed at 1298600 (0x13d0a8): missing cluster in $Bitmap
> Cluster accounting failed at 1298601 (0x13d0a9): missing cluster in $Bitmap
> Cluster accounting failed at 1298602 (0x13d0aa): missing cluster in $Bitmap
> Cluster accounting failed at 1298603 (0x13d0ab): missing cluster in $Bitmap
> Cluster accounting failed at 1298604 (0x13d0ac): missing cluster in $Bitmap
> Filesystem check failed! Totally 30 cluster accounting mismatches.
> ERROR: NTFS is inconsistent. Run chkdsk /f on Windows then reboot it TWICE!
> The usage of the /f parameter is very IMPORTANT! No modification was
> and will be made to NTFS by this software until it gets repaired.
> 
> If reporting bugs, run virt-resize with debugging enabled and include the 
> complete output:
> 
>   virt-resize -v -x [...]

Yes, I re-installed one Win2008-32 guest image, it's ok. 
Just weird that I tried  the old image on ppc64le last year it didn't have this problem.
Any way, I'll close this bug for now, sorry for the inconvenient:(


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