Bug 729076

Summary: libguestfs confuses Hp_recovery partition with Windows root filesystem
Product: Red Hat Enterprise Linux 6 Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2CC: jzheng, leiwang, mbooth, pcao, qguan, qwan, ricardo.arguello, rwu, tzheng, virt-maint, yupzhang, yuzhou
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libguestfs-1.16.2-1.el6 Doc Type: Bug Fix
Doc Text:
Cause: Windows guest has an HP recovery partition. Consequence: libguestfs confuses the HP recovery partition with an ordinary Windows partition, so thinks the guest is dual-boot. Various virt tools including virt-v2v and virt-p2v refuse to deal with multi-boot guests, so they wouldn't work. Fix: libguestfs now recognizes the special HP recovery partition. Result: libguestfs, virt tools, virt-v2v, and virt-p2v can now be used on these guests.
Story Points: ---
Clone Of: 729075 Environment:
Last Closed: 2012-06-20 06:59:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 719879, 729075    
Bug Blocks:    

Description Richard W.M. Jones 2011-08-08 16:44:54 UTC
+++ This bug was initially created as a clone of Bug #729075 +++

Description of problem:

This error occurred during a routine virt-p2v conversion:

Aug  8 11:10:16 virtp2v-server kernel: [ 9943.068103] CE: hpet increased min_delta_ns to 7500 nsec
Aug  8 12:30:16 virtp2v-server kernel: [14743.560615] kvm: 22274: cpu0 unhandled wrmsr: 0x198 data 0
Aug  8 12:30:30 virtp2v-server virt-v2v[3368]: FATAL: inspect_os: cannot resolve Windows %SYSTEMROOT% at /usr/share/perl5/Sys/VirtConvert/GuestfsHandle.pm line 187, <> line 8.#012 at /usr/bin/virt-p2v-server line 397

Version-Release number of selected component (if applicable):

libguestfs 1.8.9

The systemroot directory is c:\WINDOWS

Comment 1 Richard W.M. Jones 2011-08-08 17:01:54 UTC
The root cause appears to be because the system has an
HP_recovery partition (as drive D:)  This contains files
with names like autoexec.bat and boot.ini which confuses
our windows root detection.

Comment 7 Richard W.M. Jones 2012-04-26 13:18:58 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause:
Windows guest has an HP recovery partition.

Consequence:
libguestfs confuses the HP recovery partition with an ordinary Windows partition, so thinks the guest is dual-boot.  Various virt tools including virt-v2v and virt-p2v refuse to deal with multi-boot guests, so they wouldn't work.

Fix:
libguestfs now recognizes the special HP recovery partition.

Result:
libguestfs, virt tools, virt-v2v, and virt-p2v can now be used on these guests.

Comment 13 Yuyu Zhou 2012-05-09 02:21:31 UTC
Reproduced accord to comment 12 on libguestfs-1.7.17-26, verified on libguestfs-1.16.19-1.

Steps:
1. Make sure libguestfs-winsupport is installed.
2. Take any Windows guest.
3. Create a second disk (called 'test1.img') using these commands:
cd /tmp
guestfish -N fs:ntfs -m /dev/sda1 touch /AUTOEXEC.BAT
4. Try to inspect the guest + the second disk:
guestfish --ro -i -a /home/data/images/Win2008r2-64-hvm.raw -a /tmp/test1.img

Test result:
On  libguestfs-1.7.17-26:
At step 4, following error message shows up.
libguestfs: error: cannot resolve Windows %SYSTEMROOT%

On libguestfs-1.16.19-1:
At step4, Windows guest is found and mounted correctly as following:

# guestfish --ro -i -a /home/data/images/Win2008r2-64-hvm.raw -a /tmp/test1.img

Welcome to guestfish, the libguestfs filesystem interactive shell for
editing virtual machine filesystems.

Type: 'help' for help on commands
      'man' to read the manual
      'quit' to quit the shell

Operating system: Windows Server 2008 R2 Standard
/dev/vda1 mounted on /

><fs>

According to above result, change this bug to VERIFIED.

Comment 15 errata-xmlrpc 2012-06-20 06:59:43 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-2012-0774.html