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 668611 - guestfish -i is trying to mount all mounts from /etc/fstab and fails with an error when device doesn't exists
Summary: guestfish -i is trying to mount all mounts from /etc/fstab and fails with an ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libguestfs
Version: 6.1
Hardware: Unspecified
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 668574
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-10 21:53 UTC by Richard W.M. Jones
Modified: 2015-09-28 02:23 UTC (History)
6 users (show)

Fixed In Version: libguestfs-1.7.17-9.el6
Doc Type: Bug Fix
Doc Text:
When a device in /etc/fstab did not exist, the "guestfish -i" command failed with a "No such file or directory" error. In the event of missing devices, guestfish now completes, and reports that some file systems could not be mounted. Note that this bug was reported and corrected during development. It was not seen in production systems in the field.
Clone Of: 668574
Environment:
Last Closed: 2011-05-19 11:46:00 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 Richard W.M. Jones 2011-01-10 21:53:31 UTC
+++ This bug was initially created as a clone of Bug #668574 +++

Description of problem:

If a device from /etc/fstab doesn't exists - guestfish -i fails to load.

/etc/fstab content:

LABEL=/     /         ext4    defaults         1 1
/dev/xvdb   /mnt      ext3    defaults         0 0
/dev/xvdc   /data     ext3    defaults         0 0
none       /dev/pts  devpts  gid=5,mode=620   0 0
none       /dev/shm  tmpfs   defaults         0 0
none       /proc     proc    defaults         0 0
none       /sys      sysfs   defaults         0 0

If I remove /dev/xvd* mount points from above /etc/fstab file the image gets mounted as expected with -i switch.

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

guestfish-1.8.0-1.fc14.x86_64

Guest is RHEL 6.

How reproducible:

Always with additional devices in /etc/fstab

Steps to Reproduce:
1. Add some mount point to /etc/fstab
2. run guestfish -i image

Actual results:

$ guestfish -x -i rhel-basic.ec2 
add_drive_opts "rhel-basic.ec2" = 0
is_config = 1
launch = 0
list_partitions = [""]
inspect_osumount_all = 0
list_devices = ["/dev/vda"]
vfs_type "/dev/vda" = "ext4"
mount_ro "/dev/vda" "/" = 0
is_dir "/etc" = 1
is_dir "/bin" = 1
is_dir "/share" = 0
is_file "/grub/menu.lst" = 0
is_file "/grub/grub.conf" = 0
is_file "/etc/freebsd-update.conf" = 0
is_file "/etc/fstab" = 1
exists "/etc/lsb-release" = 0
exists "/etc/redhat-release" = 1
filesize "/etc/redhat-release" = 55
head_n 1 "/etc/redhat-release" = ["Red Hat Enterprise Linux Server release 6.0 (Santiago)"]
is_file "/bin/bash" = 1
file_architecture "/bin/bash"file "/bin/bash" = "ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped"
 = "x86_64"
filesize "/etc/fstab" = 354
aug_init "/" 48 = 0
aug_rm "/augeas/load//incl[. != "/etc/fstab"]" = 158
aug_load = 0
aug_ls "/files/etc/fstab" = ["/files/etc/fstab/1", "/files/etc/fstab/2", "/files/etc/fstab/3", "/files/etc/fstab/4", "/files/etc/fstab/5", "/files/etc/fstab/6", "/files/etc/fstab/7"]
aug_get "/files/etc/fstab/1/spec" = "LABEL=/"
aug_get "/files/etc/fstab/1/file" = "/"
findfs_label "/" = "/dev/vda"
aug_get "/files/etc/fstab/2/spec" = "/dev/xvdb"
aug_get "/files/etc/fstab/2/file" = "/mnt"
list_devices = ["/dev/vda"]
aug_get "/files/etc/fstab/3/spec" = "/dev/xvdc"
aug_get "/files/etc/fstab/3/file" = "/data"
list_devices = ["/dev/vda"]
aug_get "/files/etc/fstab/4/spec" = "none"
aug_get "/files/etc/fstab/4/file" = "/dev/pts"
aug_get "/files/etc/fstab/5/spec" = "none"
aug_get "/files/etc/fstab/5/file" = "/dev/shm"
aug_get "/files/etc/fstab/6/spec" = "none"
aug_get "/files/etc/fstab/6/file" = "/proc"
aug_get "/files/etc/fstab/7/spec" = "none"
aug_get "/files/etc/fstab/7/file" = "/sys"
aug_close = 0
is_file "/etc/HOSTNAME" = 0
is_file "/etc/hostname" = 0
is_file "/etc/sysconfig/network" = 1
filesize "/etc/sysconfig/network" = 65
aug_init "/" 48 = 0
aug_rm "/augeas/load//incl[. != "/etc/sysconfig/network"]" = 158
aug_load = 0
aug_get "/files/etc/sysconfig/network/HOSTNAME" = "localhost.localdomain"
aug_close = 0
umount_all = 0
list_partitions = [""]
available "lvm2" = 0
lvs = [""]
 = ["/dev/vda"]
inspect_get_mountpoints "/dev/vda" = ["/", "/dev/vda", "/mnt", "/dev/xvdb", "/data", "/dev/xvdc"]
mount_options "" "/dev/vda" "/" = 0
mount_options "" "/dev/xvdb" "/mnt" = -1 (error)
libguestfs: error: mount_options: mount_options_stub: /dev/xvdb: No such file or directory
umount_all = 0
sync = 0
kill_subprocess = 0

Expected results:

Image gets mounted.

--- Additional comment from rjones on 2011-01-10 16:52:43 EST ---

This appears to be a bug between the inspection code
and guestfish.  The inspection code is returning the
bogus mountpoints, and guestfish is trying to mount
them and failing.

Bug also exists in RHEL 6.1, so cloning.

Comment 2 Richard W.M. Jones 2011-01-11 10:56:40 UTC
For a test case, see:
https://bugzilla.redhat.com/show_bug.cgi?id=668574#c2

Comment 3 Richard W.M. Jones 2011-01-11 11:30:26 UTC
http://brewweb.devel.redhat.com/brew/taskinfo?taskID=3022693

Comment 5 Yufang Zhang 2011-02-15 07:04:30 UTC
QA verified this bug with libguestfs-1.7.17-12.el6.x86_64 and
guestfish-1.7.17-12.el6.x86_64:

Using the image file from https://bugzilla.redhat.com/show_bug.cgi?id=668574#c2:

# guestfish -a bogus.img -i --ro 
libguestfs: error: mount_ro: mount_ro_stub: /dev/sdb3: No such file or directory
libguestfs: error: mount_ro: /dev/VG/LV1 on /nosuchfile: mount: mount point /sysroot/nosuchfile does not exist
guestfish: some filesystems could not be mounted (ignored)

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: Fedora release 14 (Phony)
/dev/VG/Root mounted on /
/dev/vda1 mounted on /boot
/dev/VG/LV1 mounted on /nosuchfile
/dev/sdb3 mounted on /var

><fs>

So change this bug to VERIFIED.

Comment 9 Laura Bailey 2011-04-20 05:11:17 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:
When a device in /etc/fstab did not exist, the "guestfish -i" command failed with a "No such file or directory" error. In the event of missing devices, guestfish now completes, and reports that some file systems could not be mounted.

Note that this bug was reported and corrected during development. It was not seen in production systems in the field.

Comment 10 Richard W.M. Jones 2011-04-20 07:50:51 UTC
This is fine, thanks.

Comment 11 errata-xmlrpc 2011-05-19 11:46:00 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 12 errata-xmlrpc 2011-05-19 13:10: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


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