Bug 637251 - virt-inspector fails to recognize data-only NTFS disk image
Summary: virt-inspector fails to recognize data-only NTFS disk image
Keywords:
Status: NEW
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-09-24 17:16 UTC by Eric Blake
Modified: 2021-04-19 10:35 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description Eric Blake 2010-09-24 17:16:54 UTC
Description of problem:
I have a Windows VM set up with two disk images, c:\ containing the OS and d:\ containing data (mainly so that I can preserve data while nuking and reinstalling the OS).  However, while virt-manager correctly recognizes that the second image does not contain an OS, it fails to at least mention that it _did_ recognize a valid NTFS partition.

Version-Release number of selected component (if applicable):
libguestfs-1.5.18-1.fc14.2.i686
libguestfs-tools-1.5.18-1.fc14.2.i686


How reproducible:
always

Steps to Reproduce:
1. set up a windows VM with two virtio disk images; one image for the OS becoming the virtual c:\, and another as the virtual d:\.
2. virt-inspector image1.img
3. virt-inspector image2.img
  
Actual results:
step 2: inspecting the OS image alone makes no mention that the OS mount table has mention of a d:\ drive:
# virt-inspector /mnt/backup/opt/libvirt/images/windows_2008.img 
windows i386 6.0 (Windows Server (R) 2008 Standard) on /dev/sda1:
  Mountpoints:
    /dev/sda1                      /
  Filesystems:
    /dev/sda1:
      type: ntfs
      content: windows-root
  Applications:

step 3: inspecting the data image completely fails:
# virt-inspector /mnt/backup/opt/libvirt/images/data.img 
No operating system could be detected inside this disk image.

This may be because the file is not a disk image, or is not a virtual machine
image, or because the OS type is not understood by virt-inspector.

If you feel this is an error, please file a bug report including as much
information about the disk image as possible.


Expected results:
I'm not sure if it is possible to inspect the windows registry to see what cross-disk mount points windows expects to see, but it would be nice if inspecting image1 could tell me that the image depends on the existence of a d: mountpoint when loaded in a VM, similarly to how virt-inspector detects missing mountpoints for a two-image Linux guest.

More importantly, it would be nice if inspecting the data disk could display something like:
No operating system could be detected inside this disk image.
  Mountpoints:
    /dev/sda1                      /
  Filesystems:
    /dev/sda1:
      type: ntfs
      content: data
  Applications:

rather than flat-out giving up when no OS is detected on any partition.


Additional info:
guestfish can successfully use both images in a single session:
# guestfish --ro -a /mnt/backup/opt/libvirt/images/windows_2008.img \
  -a /mnt/backup/opt/libvirt/images/data.img 

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

Type: 'help' for a list of commands
      'man' to read the manual
      'quit' to quit the shell

><fs> run
><fs> mkmountpoint /c
><fs> mkmountpoint /d
><fs> mount /dev/sda1 /c
><fs> mount /dev/sdb1 /d

at which point 'll /c /d' showed both windows root drive contents.

Comment 1 Richard W.M. Jones 2011-04-12 17:44:57 UTC
Sorry for losing track of this bug.

Firstly I'll note that you're using virt-inspector wrong.  If a
VM has two disks, then you have to present both of those disks
to virt-inspector at the same time, and in the same order that
they would appear to the regular guest.  Thus:

  virt-inspector image1.img image2.img

Now with libguestfs < something very very recent, that would still
have failed.  So the second point is that we've fixed the Windows
second drive problem (bug 674130), and provided support for
drive letters in the API (http://libguestfs.org/guestfs.3.html#guestfs_inspect_get_drive_mappings).

You will need the most recent version of libguestfs to
get these changes.


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