RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 691724 - virt-inspector reports unknown filesystem /dev/vda1
Summary: virt-inspector reports unknown filesystem /dev/vda1
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libguestfs
Version: 6.1
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-29 10:47 UTC by Rita Wu
Modified: 2015-09-28 02:15 UTC (History)
4 users (show)

Fixed In Version: libguestfs-1.7.17-16.el6
Doc Type: Bug Fix
Doc Text:
If the /etc/fstab of a guest machine contained a reference to a virtio disk (/dev/vda1), virt-inspector printed a warning and ignored the virtio disk. The warning has been suppressed, and virtio disks are now recognized by virt-inspector.
Clone Of:
Environment:
Last Closed: 2011-05-19 11:44:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0586 0 normal SHIPPED_LIVE Low: libguestfs security, bug fix, and enhancement update 2011-05-19 11:44:03 UTC

Description Rita Wu 2011-03-29 10:47:23 UTC
Description of problem:
virt-inspector will report error message when fstab entry specifies virtio device. 


# cat /etc/fstab 
/dev/vda1                /                       ext3    defaults        1 1
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
LABEL=SWAP-vda2         swap                    swap    defaults        0 0


Although virt-inspector2 will not have this issue,I guess I'd better to file a bug to track this issue, since I don't know how soon the c code will take the place of the perl code, which is the first generation. 

Version-Release number of selected component (if applicable):
libguestfs-1.7.17-15.el6.x86_64
libguestfs-tools-1.7.17-15.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1.Install a vm with virtio drivers  
2.Specify device name in fstab entry
3.# virt-inspector kvm-rhel5.6-i386-virtio.img
unknown filesystem /dev/vda1
unknown filesystem label SWAP-vda2
linux rhel x86_64 5.6 (Red Hat Enterprise Linux Server release 5.6 (Tikanga)) on /dev/sda1:
  Mountpoints:
    /dev/sda1                      /
  Filesystems:
    /dev/sda1:
...
  
Actual results:
unknown filesystem /dev/vda1

Expected results:
no warning/errors about "unknown filesystem /dev/vda1" 

Additional info:
#/usr/lib64/perl5/vendor_perl/Sys/Guestfs/Lib.pm
...
        if (m{^/dev/hd(.*)} && exists $fses->{"/dev/sd$1"}) {
            return ("/dev/sd$1", $fses->{"/dev/sd$1"});
        }
        if (m{^/dev/xvd(.*)} && exists $fses->{"/dev/sd$1"}) {
            return ("/dev/sd$1", $fses->{"/dev/sd$1"});
        }
        if (m{^/dev/mapper/(.*)-(.*)$} && exists $fses->{"/dev/$1/$2"}) {
            return ("/dev/$1/$2", $fses->{"/dev/$1/$2"});
        }

        return () if $file =~ (/media\/cdrom/);
        return () if m{/dev/cdrom};
        return () if m{/dev/fd0};

        warn __x("unknown filesystem {fs}\n", fs => $_);
        return ();
    }
...

Comment 2 Richard W.M. Jones 2011-03-29 11:08:46 UTC
Yes, Linglu's analysis looks right, and it's a simple fix too.

Comment 3 Richard W.M. Jones 2011-03-29 11:22:59 UTC
The equivalent in the replacement core inspection code uses
this regexp:

^/dev/(?:h|s|v|xv)d([a-z]\d*)$   [1]

It seems that simply adding an extra case to the Perl code
should fix this.

Proposed patch (needs testing):
https://www.redhat.com/archives/libguestfs/2011-March/msg00144.html

[1] This is also slightly wrong
https://rwmj.wordpress.com/2011/01/09/how-are-linux-drives-named-beyond-drive-26-devsdz/
but that is an issue for another day.

Comment 4 Richard W.M. Jones 2011-03-29 14:33:40 UTC
Manually reproduced this by installing a Fedora 14 guest with
virtio and editing /etc/fstab so that it had an entry

 /dev/vda1 /boot ext4 defaults 1 2

(Normally Fedora 14 doesn't use device entries like this, so
I had to edit /etc/fstab).

Using Perl virt-inspector from 1.2, I saw the warning message:

 unknown filesystem /dev/vda1

followed by an error (it wasn't able to mount /boot, so it
couldn't parse the grub configuration).  This error was a
consequence of this bug.

I then ran the same virt-inspector from 1.2, but against the
newest Perl libraries with the patch from comment 3.  virt-inspector
now worked correctly.  In addition it showed the following
correct information for the boot filesystem:

      <filesystem dev="/dev/sda1">
        <label></label>
        <uuid>a8df64b5-5d2e-4431-8fee-a8bc75782ac8</uuid>
        <type>ext4</type>
        <content>linux-grub</content>
        <spec>/dev/vda1</spec>
      </filesystem>

So I am happy that the patch in comment 3 will fix the
problem.

Comment 6 Richard W.M. Jones 2011-03-29 14:46:25 UTC
http://brewweb.devel.redhat.com/brew/taskinfo?taskID=3212787
(Build not finished at time of writing)

Comment 8 Jinxin Zheng 2011-03-30 11:07:33 UTC
I tested on Linglu's image.

libguestfs-1.7.17-15.el6: we see 'unknown filesystem /dev/vda1' on the first line of the output of virt-inspector.

libguestfs-1.7.17-16.el6: the 'unknown filesystem /dev/vda1' has gone.

btw: Both detected /dev/sda1 as linux-root. The presence of the vda1 error is the only difference.

Comment 11 Laura Bailey 2011-04-20 01:45:12 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:
If the /etc/fstab of a guest machine contained a reference to a virtio disk (/dev/vda1), virt-inspector printed a warning and ignored the virtio disk. The warning has been suppressed, and virtio disks are now recognized by virt-inspector.

Comment 12 Richard W.M. Jones 2011-04-20 07:45:03 UTC
This is fine, thanks.

Comment 13 errata-xmlrpc 2011-05-19 11:44:51 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0586.html

Comment 14 errata-xmlrpc 2011-05-19 13:10:59 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0586.html


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