Created attachment 940723 [details] Debug info about converting windows with unclean file system Description Improve the error info when converting windows guest with unclean file system Version: virt-v2v-1.27.53-1.1.el7.x86_64 libguestfs-winsupport-7.1-4.el7.x86_64 libguestfs-1.27.53-1.1.el7.x86_64 virtio-win-1.7.2-1.el7.noarch How reproducible: 100% Steps to Reproduce: 1.Use virt-v2v to convert a windows guest which has an unclean file system. # virt-v2v -ic xen+ssh://10.66.106.64 -os default xen-hvm-win8-i386 -of raw [ 0.0] Opening the source -i libvirt -ic xen+ssh://10.66.106.64 xen-hvm-win8-i386 [ 16.0] Creating an overlay to protect the source from being modified [ 30.0] Opening the overlay [ 52.0] Initializing the target -o libvirt -os default [ 52.0] Inspecting the overlay mount: /dev/sda2 on / (options: ''): The disk contains an unclean file system (0, 0). Metadata kept in Windows cache, refused to mount. Failed to mount '/dev/sda2': Operation not permitted The NTFS partition is in an unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting), or mount the volume read-only with the 'ro' mount option. (ignored) virt-v2v: error: libguestfs error: case_sensitive_path: case_sensitive_path_stub: you must call 'mount' first to mount the root filesystem If reporting bugs, run virt-v2v with debugging enabled and include the complete output: virt-v2v -v -x [...] Actual results: error info shows as below,which is not so clear and friendly. mount: /dev/sda2 on / (options: ''): The disk contains an unclean file system (0, 0). Metadata kept in Windows cache, refused to mount. Failed to mount '/dev/sda2': Operation not permitted The NTFS partition is in an unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting), or mount the volume read-only with the 'ro' mount option. (ignored) virt-v2v: error: libguestfs error: case_sensitive_path: case_sensitive_path_stub: you must call 'mount' first to mount the root filesystem Expected results: Improve the error info,especally the error info throw from virt-v2v. Additional info:
Should be fixed in >= 1.27.54: https://github.com/libguestfs/libguestfs/commit/f6e40498a90ac6f082bede202d15d5a8fbb80fa3
Tested with: libguestfs-1.27.54-1.1.el7.x86_64 virt-v2v-1.27.54-1.1.el7.x86_64 # virt-v2v -ic xen+ssh://10.66.106.64 -os default xen-hvm-win8-i386 -of raw [ 0.0] Opening the source -i libvirt -ic xen+ssh://10.66.106.64 xen-hvm-win8-i386 [ 16.0] Creating an overlay to protect the source from being modified [ 30.0] Opening the overlay [ 52.0] Initializing the target -o libvirt -os default [ 52.0] Inspecting the overlay virt-v2v: error: unable to mount the disk image for writing. This has probably happened because Windows Hibernation or Fast Restart is being used in this guest. You have to disable this (in the guest) in order to use virt-v2v. Original error message: mount: /dev/sda2 on / (options: ''): The disk contains an unclean file system (0, 0). Metadata kept in Windows cache, refused to mount. Failed to mount '/dev/sda2': Operation not permitted The NTFS partition is in an unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting), or mount the volume read-only with the 'ro' mount option. If reporting bugs, run virt-v2v with debugging enabled and include the complete output: virt-v2v -v -x [...] The error info has been improved,so move the bug to VERIFIED.
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