Bug 1057504 - 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 RAWHIDE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1057492 1057510
TreeView+ depends on / blocked
 
Reported: 2014-01-24 09:08 UTC by Richard W.M. Jones
Modified: 2014-02-05 16:51 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1057492
Environment:
Last Closed: 2014-02-05 16:51:59 UTC
Embargoed:


Attachments (Terms of Use)

Description Richard W.M. Jones 2014-01-24 09:08:11 UTC
+++ This bug was initially created as a clone of Bug #1057492 +++

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 1 Richard W.M. Jones 2014-01-24 10:23:47 UTC
I've posted a simple patch which tests if root is mounted:

$ guestfish -N fs mount-local /tmp/mnt : mount-local-run
libguestfs: error: exists: exists_stub: you must call 'mount' first to mount the root filesystem

https://www.redhat.com/archives/libguestfs/2014-January/msg00225.html

Comment 2 Richard W.M. Jones 2014-02-05 16:51:59 UTC
Fixed upstream in git commit 0e2489974b91e4728d544fe2aa08c2a1c9deb365.


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