Bug 1166618
| Summary: | virt-resize should give out the detail warning info to let customers know what's going wrong | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | yuliu <yuliu> |
| Component: | libguestfs | Assignee: | Richard W.M. Jones <rjones> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | 7.1 | CC: | leiwang, lkong, mbooth, ptoscano, rjones, wshi, yuliu |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | libguestfs-1.28.1-1.14.el7 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-03-05 13:47:33 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
yuliu
2014-11-21 11:21:03 UTC
First can you try adding the --ntfsresize-force option:
--ntfsresize-force
Pass the --force option to ntfsresize(8), allowing resizing even if
the NTFS disk is marked as needing a consistency check. You have
to use this option if you want to resize a Windows guest multiple
times without booting into Windows between each resize.
If it still doesn't work after adding that option, then you're
going to have to send me /dev/sda1 from that disk image. Do this:
guestfish --ro -a Win2008-32-hvm.raw run : download /dev/sda1 /tmp/sda1
xz --best /tmp/sda1
and then send me /tmp/sda1.xz
(In reply to Richard W.M. Jones from comment #1) > First can you try adding the --ntfsresize-force option: > > --ntfsresize-force > Pass the --force option to ntfsresize(8), allowing resizing even > if > the NTFS disk is marked as needing a consistency check. You have > to use this option if you want to resize a Windows guest multiple > times without booting into Windows between each resize. > > If it still doesn't work after adding that option, then you're > going to have to send me /dev/sda1 from that disk image. Do this: > > guestfish --ro -a Win2008-32-hvm.raw run : download /dev/sda1 /tmp/sda1 > xz --best /tmp/sda1 > > and then send me /tmp/sda1.xz Hey Rich, I just tried the steps as above, it still failed with the same error. Expanding /dev/sda1 using the 'ntfsresize' method ... libguestfs: trace: ntfsresize "/dev/sda1" "force:true" guestfsd: main_loop: new request, len 0x44 ntfsresize -P --force /dev/sda1 guestfsd: error: /dev/sda1: guestfsd: main_loop: proc 288 (ntfsresize) took 0.25 seconds libguestfs: trace: ntfsresize = -1 (error) virt-resize: error: libguestfs error: ntfsresize: /dev/sda1: If reporting bugs, run virt-resize with debugging enabled and include the complete output: virt-resize -v -x [...] libguestfs: trace: close And about the sda1.xz, I'll send it to you later. Thanks for sending me the /dev/sda1 filesystem. I'm afraid the filesystem appears to be corrupt: $ ntfsresize sda1 ntfsresize v2014.2.15 (libntfs-3g) Device name : sda1 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. There is no effective fsck tool on Linux, so you have to run the suggested chkdsk command on Windows before resizing. However there is also a bug here, which is that the ntfsresize API loses the error messages, because the underlying command sends errors to stdout. I have posted a patch to fix this: https://www.redhat.com/archives/libguestfs/2014-November/msg00174.html Hey Rich, have you tried on the original image? I have reinstalled a new OS, nothing changed, totally clean, and then tried the steps, still failed. Nope, I tried the 'sda1.xz' file provided. If you like I can try another image, but you'll have to send me that one. (In reply to Richard W.M. Jones from comment #5) > Nope, I tried the 'sda1.xz' file provided. If you like I can > try another image, but you'll have to send me that one. Also login to the machine that I told you. The image Win2008-32-hvm.raw under /home/ is the new OS that I reinstalled. If you want to reinstall a new one by yourself, here is the ISO image: #mount 10.66.90.128:/vol/S1/iso/ /mnt/ #ls /mnt/ISO/Win2008/32/ en_windows_server_2008_datacenter_enterprise_standard_sp2_x86_dvd_342333.iso I tried Win2008-32-hvm.raw and that resized successfully for me (on Fedora 21 -- but that is pretty close to what we have in RHEL 7.1). I don't have enough disk space to try this on my RHEL 7 VM. (In reply to Richard W.M. Jones from comment #7) > I tried Win2008-32-hvm.raw and that resized successfully for me > (on Fedora 21 -- but that is pretty close to what we have in RHEL 7.1). > I don't have enough disk space to try this on my RHEL 7 VM. I tried this image on my Fedora, it succeed. That's really strange because it still failed on RHEL, some time. I say "some time" because I did succeed once. When I found that partition was already expanded to the largest, so I reduced it by virt-sparsify tool. And then virt-resize, it actually succeed, but only once. And I believe that there is nothing to our machine, because we had tried different machines by different person. I think there was not only one bug here, I wrote a script to do more test, but it costs time, I'll update my result here the time I get it, so let's wait for some hours. Hi Rich, Seems the original image was okay to resize, the filesystem may be broken while copying, I have checked the md5sum and they are actually different. So you can take this bug as comment 3. (In reply to yuliu from comment #8) > I say "some time" because I did succeed once. When I found that partition > was already expanded to the largest, so I reduced it by virt-sparsify tool. > And then virt-resize, it actually succeed, but only once. This is to be expected with NTFS. You have to use the --ntfsresize-force flag to do multiple resizes. See comment 1. Verified: libguestfs-1.28.1-1.14.el7.x86_64 Details: virt-resize: error: libguestfs error: ntfsresize: /dev/sda1: ntfsresize v2014.2.15 (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: 19325124608 bytes (19326 MB) New volume size : 19325121024 bytes (19326 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 [...] The error details were given, verified as above. 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. https://rhn.redhat.com/errata/RHBA-2015-0303.html |