Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
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


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1458 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.