Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 691724 - virt-inspector reports unknown filesystem /dev/vda1
virt-inspector reports unknown filesystem /dev/vda1
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libguestfs (Show other bugs)
6.1
Unspecified Unspecified
medium Severity low
: rc
: ---
Assigned To: Richard W.M. Jones
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-29 06:47 EDT by Rita Wu
Modified: 2015-09-27 22:15 EDT (History)
4 users (show)

See Also:
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.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-05-19 07:44:51 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0586 normal SHIPPED_LIVE Low: libguestfs security, bug fix, and enhancement update 2011-05-19 07:44:03 EDT

  None (edit)
Description Rita Wu 2011-03-29 06:47:23 EDT
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 07:08:46 EDT
Yes, Linglu's analysis looks right, and it's a simple fix too.
Comment 3 Richard W.M. Jones 2011-03-29 07:22:59 EDT
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 10:33:40 EDT
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 10:46:25 EDT
http://brewweb.devel.redhat.com/brew/taskinfo?taskID=3212787
(Build not finished at time of writing)
Comment 8 Jinxin Zheng 2011-03-30 07:07:33 EDT
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-19 21:45:12 EDT
    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 03:45:03 EDT
This is fine, thanks.
Comment 13 errata-xmlrpc 2011-05-19 07:44:51 EDT
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 09:10:59 EDT
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.