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 1057510 - mount-local should give a clearer error if root is not mounted
Summary: mount-local should give a clearer error if root is not mounted
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libguestfs
Version: 6.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Pino Toscano
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 1057504
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-24 09:18 UTC by yuliu
Modified: 2015-02-15 06:38 UTC (History)
7 users (show)

Fixed In Version: libguestfs-1.20.11-3.el6
Doc Type: Bug Fix
Doc Text:
Clone Of: 1057492
Environment:
Last Closed: 2014-10-14 06:35:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1458 0 normal SHIPPED_LIVE libguestfs bug fix update 2014-10-14 01:10:57 UTC

Description yuliu 2014-01-24 09:18:02 UTC
+++ This bug was initially created as a clone of Bug #1057492 +++

Description of problem:
Before run "mount-local localmountpoint " you should mount filesystem to "/" first.
This prerequisites should be added to help info.

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


How reproducible:
100%

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

--- Additional comment from Richard W.M. Jones on 2014-01-24 04:07:09 EST ---

If you use mount-local without mounting something on / then you get
odd errors:

$ mkdir -p /tmp/mnt
$ guestfish -x -N fs mount-local /tmp/mnt : mount-local-run
libguestfs: error: lstat: lstat_stub: you must call 'mount' first to mount the root filesystem
libguestfs: error: lstat: lstat_stub: you must call 'mount' first to mount the root filesystem

Basically what happens is that mount-local itself doesn't do the
usual "is root mounted" daemon check (because it cannot - it is not
running in the daemon).  However any later commands which are run
by mount-local do this check, and give errors.

It would be better if mount-local itself did this check and gave
a clearer error if root was not mounted.

Comment 4 Lingfei Kong 2014-05-07 05:52:01 UTC
Verified with libguestfs-1.20.11-3.el6

[root@amd-4450b-4-1 ~]# mkdir -p /tmp/mnt
[root@amd-4450b-4-1 ~]# guestfish -x -N fs mount-local /tmp/mnt : mount-local-run
libguestfs: trace: set_pgroup true
libguestfs: trace: set_pgroup = 0
libguestfs: trace: add_drive "test1.img" "format:raw"
libguestfs: trace: add_drive = 0
libguestfs: trace: is_config
libguestfs: trace: is_config = 1
libguestfs: trace: launch
libguestfs: trace: get_tmpdir
libguestfs: trace: get_tmpdir = "/tmp"
libguestfs: trace: get_cachedir
libguestfs: trace: get_cachedir = "/var/tmp"
libguestfs: trace: get_cachedir
libguestfs: trace: get_cachedir = "/var/tmp"
libguestfs: trace: launch = 0
libguestfs: trace: part_disk "/dev/sda" "mbr"
libguestfs: trace: part_disk = 0
libguestfs: trace: mkfs "ext2" "/dev/sda1"
libguestfs: trace: mkfs = 0
libguestfs: trace: mount_local "/tmp/mnt"
libguestfs: trace: mount_local = 0
libguestfs: trace: mount_local_run
libguestfs: trace: exists "/"
libguestfs: trace: exists = -1 (error)
libguestfs: error: you must call 'guestfs_mount' first to mount a filesystem on '/'.
Note: '/tmp/mnt' is still mounted.  Use 'fusermount -u /tmp/mnt' to clean up.
libguestfs: trace: mount_local_run = -1 (error)
libguestfs: trace: close
libguestfs: trace: internal_autosync
libguestfs: trace: internal_autosync = 0

Comment 5 errata-xmlrpc 2014-10-14 06:35:06 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/RHBA-2014-1458.html


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