guestmount does not work

Bug #1186228 reported by Mechanical snail on 2013-05-31
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
libguestfs (Ubuntu)
Undecided
Unassigned
seabios (Ubuntu)
Undecided
Unassigned

Bug Description

Guestmount does not work. Symptoms are identical to bug #930634, but that bug says it is fixed in the versions I have. Presumably either it's a different underlying bug, or the fix doesn't work on 32-bit kernels.

user@host:/scratch$ aptitude show seabios | grep Ver
Version: 0.6.2-0ubuntu2.1
user@host:/scratch$ aptitude show febootstrap | grep Ver
Version: 3.14-2
user@host:/scratch$ aptitude show libguestfs0 | grep Ver
Version: 1:1.14.8-1
user@host:/scratch$ uname -a
Linux host 3.2.0-43-generic-pae #68-Ubuntu SMP Wed May 15 03:55:10 UTC 2013 i686 i686 i386 GNU/Linux

The command and error message are:

user@host:/scratch/qemubuilder$ guestmount -a base-i386.qemu -i /run/shm/qemu.3430/warning: Unable to get device geometry for /var/tmp/guestfs.3JKtKZ/root
febootstrap-supermin-helper: ext2: parent directory not found: /lib: File not found by ext2_lookup
libguestfs: error: external command failed, see earlier error messages

The test tool output is:

user@host:/scratch/qemubuilder$ libguestfs-test-tool
===== Test starts here =====
LIBGUESTFS_DEBUG=1
TMPDIR=(not set)
libguestfs: new guestfs handle 0x9467df0
library version: 1.14.8
guestfs_get_append: (null)
guestfs_get_attach_method: appliance
guestfs_get_autosync: 1
guestfs_get_direct: 0
guestfs_get_memsize: 500
guestfs_get_network: 0
guestfs_get_path: /usr/lib/guestfs
guestfs_get_pgroup: 0
guestfs_get_qemu: /usr/bin/kvm
guestfs_get_recovery_proc: 1
guestfs_get_selinux: 0
guestfs_get_smp: 1
guestfs_get_trace: 0
guestfs_get_verbose: 1
host_cpu: i686
Launching appliance, timeout set to 600 seconds.
libguestfs: [00000ms] febootstrap-supermin-helper --verbose -f checksum '/usr/lib/guestfs/supermin.d' i686
supermin helper [00000ms] whitelist = (not specified), host_cpu = i686, kernel = (null), initrd = (null), appliance = (null)
supermin helper [00000ms] inputs[0] = /usr/lib/guestfs/supermin.d
checking modpath /lib/modules/3.2.0-44-generic-pae is a directory
picked vmlinuz-3.2.0-44-generic-pae because modpath /lib/modules/3.2.0-44-generic-pae exists
checking modpath /lib/modules/3.2.0-43-generic-pae is a directory
picked vmlinuz-3.2.0-43-generic-pae because modpath /lib/modules/3.2.0-43-generic-pae exists
supermin helper [00000ms] finished creating kernel
supermin helper [00000ms] visiting /usr/lib/guestfs/supermin.d
supermin helper [00000ms] visiting /usr/lib/guestfs/supermin.d/daemon.img
supermin helper [00000ms] visiting /usr/lib/guestfs/supermin.d/init.img
supermin helper [00000ms] adding kernel modules
supermin helper [00139ms] finished creating appliance
libguestfs: [00141ms] begin building supermin appliance
libguestfs: [00142ms] run febootstrap-supermin-helper
libguestfs: [00142ms] febootstrap-supermin-helper --verbose -f ext2 /usr/lib/guestfs/supermin.d i686 /var/tmp/guestfs.t3yS8p/kernel /var/tmp/guestfs.t3yS8p/initrd /var/tmp/guestfs.t3yS8p/root
supermin helper [00000ms] whitelist = (not specified), host_cpu = i686, kernel = /var/tmp/guestfs.t3yS8p/kernel, initrd = /var/tmp/guestfs.t3yS8p/initrd, appliance = /var/tmp/guestfs.t3yS8p/root
supermin helper [00000ms] inputs[0] = /usr/lib/guestfs/supermin.d
checking modpath /lib/modules/3.2.0-44-generic-pae is a directory
picked vmlinuz-3.2.0-44-generic-pae because modpath /lib/modules/3.2.0-44-generic-pae exists
checking modpath /lib/modules/3.2.0-43-generic-pae is a directory
picked vmlinuz-3.2.0-43-generic-pae because modpath /lib/modules/3.2.0-43-generic-pae exists
supermin helper [00000ms] finished creating kernel
warning: Unable to get device geometry for /var/tmp/guestfs.t3yS8p/root
supermin helper [00563ms] finished mke2fs
supermin helper [00564ms] visiting /usr/lib/guestfs/supermin.d
supermin helper [00564ms] visiting /usr/lib/guestfs/supermin.d/daemon.img
supermin helper [00568ms] visiting /usr/lib/guestfs/supermin.d/init.img
febootstrap-supermin-helper: ext2: parent directory not found: /lib: File not found by ext2_lookup
libguestfs: error: external command failed, see earlier error messages
libguestfs-test-tool: failed to launch appliance
libguestfs: closing guestfs handle 0x9467df0 (state 0)

First asked on Ask Ubuntu: http://askubuntu.com/questions/302289/error-mounting-disk-image-using-guestmount

Richard Jones (rjones-redhat) wrote :

> febootstrap-supermin-helper: ext2: parent directory not found: /lib: File not found by ext2_lookup

This error usually indicates that you've run out of disk space on the host. What is the output of:

  df -h /var/tmp

Richard Jones (rjones-redhat) wrote :

.. which, if it is that, then it's related to this upstream bug:
https://bugzilla.redhat.com/show_bug.cgi?id=965524

Changed in seabios (Ubuntu):
status: New → Incomplete
Changed in libguestfs (Ubuntu):
status: New → Incomplete

I have the same problem on Ubuntu 12.04.3 LTS on i386. I have plenty of space both in /tmp and /var/tmp (they're on the same partition):

hactar% LANG= df -h /tmp /var/tmp
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/hactar--vg-root 120G 107G 7.1G 94% /
/dev/mapper/hactar--vg-root 120G 107G 7.1G 94% /

I also have the problem that update-guestfs-appliance doesn't work (reported as bug #1263989).

Package versions:
libguestfs0: 1:1.14.8-1
qemu-kvm: 1.0+noroms-0ubuntu14.12
febootstrap: 3.14-2

Richard Jones (rjones-redhat) wrote :

To diagnose this what you have to do:

(1) Run libguestfs-test-tool

It will (presumably) fail. It will also print out an febootstrap-supermin-helper command line (or in newer versions, a supermin-helper command line). In the comment above, it printed out:

febootstrap-supermin-helper --verbose -f ext2 /usr/lib/guestfs/supermin.d i686 /var/tmp/guestfs.t3yS8p/kernel /var/tmp/guestfs.t3yS8p/initrd /var/tmp/guestfs.t3yS8p/root

(But note that your command line will be different).

(2) Modify the command line slightly. The 'kernel', 'initrd', and 'root' options are *output* files. You want those to be on /var/tmp. Also add -v -v -v. So you'd end up with something like:

febootstrap-supermin-helper --verbose -v -v -v -f ext2 /usr/lib/guestfs/supermin.d i686 /var/tmp/kernel /var/tmp/initrd /var/tmp/root

Run that command and it will print out lots of very detailed debugging information about what supermin-helper is trying to do.

Most likely (assuming you've not run out of disk space) it's because there's some symlink or parent directory missing, which you can fix by adding the right missing directory to /usr/lib/guestfs/supermin.d/00-missing-dir (see the supermin-helper man page).

Richard Jones (rjones-redhat) wrote :

For example, you could add a file /usr/lib/guestfs/supermin.d/00-missing-dir containing two lines:

/
/lib

(assuming /lib was the missing directory)

Download full text (7.2 KiB)

Thanks for the quick response!

After running update-guestfs-appliance the error message changed, so I was probably hitting a bug that was fixed already.

Now the failure is:

hactar% LANG= libguestfs-test-tool
===== Test starts here =====
LIBGUESTFS_DEBUG=1
TMPDIR=(not set)
libguestfs: new guestfs handle 0x808cd20
library version: 1.14.8
guestfs_get_append: (null)
guestfs_get_attach_method: appliance
guestfs_get_autosync: 1
guestfs_get_direct: 0
guestfs_get_memsize: 500
guestfs_get_network: 0
guestfs_get_path: /usr/lib/guestfs
guestfs_get_pgroup: 0
guestfs_get_qemu: /usr/bin/kvm
guestfs_get_recovery_proc: 1
guestfs_get_selinux: 0
guestfs_get_smp: 1
guestfs_get_trace: 0
guestfs_get_verbose: 1
host_cpu: i686
Launching appliance, timeout set to 600 seconds.
libguestfs: [00000ms] febootstrap-supermin-helper --verbose -f checksum '/usr/lib/guestfs/supermin.d' i686
supermin helper [00000ms] whitelist = (not specified), host_cpu = i686, kernel = (null), initrd = (null), appliance = (null)
supermin helper [00000ms] inputs[0] = /usr/lib/guestfs/supermin.d
checking modpath /lib/modules/3.2.0-54-generic-pae is a directory
picked vmlinuz-3.2.0-54-generic-pae because modpath /lib/modules/3.2.0-54-generic-pae exists
checking modpath /lib/modules/3.2.0-55-generic-pae is a directory
picked vmlinuz-3.2.0-55-generic-pae because modpath /lib/modules/3.2.0-55-generic-pae exists
checking modpath /lib/modules/3.2.0-51-generic-pae is a directory
picked vmlinuz-3.2.0-51-generic-pae because modpath /lib/modules/3.2.0-51-generic-pae exists
checking modpath /lib/modules/3.2.0-57-generic-pae is a directory
picked vmlinuz-3.2.0-57-generic-pae because modpath /lib/modules/3.2.0-57-generic-pae exists
checking modpath /lib/modules/3.2.0-56-generic-pae is a directory
picked vmlinuz-3.2.0-56-generic-pae because modpath /lib/modules/3.2.0-56-generic-pae exists
checking modpath /lib/modules/3.2.0-52-generic-pae is a directory
picked vmlinuz-3.2.0-52-generic-pae because modpath /lib/modules/3.2.0-52-generic-pae exists
checking modpath /lib/modules/3.2.0-53-generic-pae is a directory
picked vmlinuz-3.2.0-53-generic-pae because modpath /lib/modules/3.2.0-53-generic-pae exists
supermin helper [00000ms] finished creating kernel
supermin helper [00000ms] visiting /usr/lib/guestfs/supermin.d
supermin helper [00000ms] visiting /usr/lib/guestfs/supermin.d/base.img
supermin helper [00000ms] visiting /usr/lib/guestfs/supermin.d/daemon.img
supermin helper [00000ms] visiting /usr/lib/guestfs/supermin.d/hostfiles
supermin helper [00026ms] visiting /usr/lib/guestfs/supermin.d/init.img
supermin helper [00026ms] adding kernel modules
supermin helper [00071ms] finished creating appliance
libguestfs: [00073ms] begin testing qemu features
libguestfs: [00102ms] finished testing qemu features
libguestfs: accept_from_daemon: 0x808cd20 g->state = 1
[00103ms] /usr/bin/kvm \
    -global virtio-blk-pci.scsi=off \
    -drive file=/tmp/libguestfs-test-tool-sda-zaN1Cj,cache=off,format=raw,if=virtio \
    -nodefconfig \
    -machine accel=kvm:tcg \
    -nodefaults \
    -nographic \
    -m 500 \
    -no-reboot \
    -no-hpet \
    -device virtio-serial \
    -serial stdio \
    -chardev socket,path=/tmp/lib...

Read more...

I still get the following warning though:

warning: Unable to get device geometry for /var/tmp/guestfs.BxDbcl/root

It appears to be harmless. I can still use guestfish to access disk images.

Richard Jones (rjones-redhat) wrote :

The kernel permissions problem is an Ubuntu bug (https://bugs.launchpad.net/ubuntu/+source/linux/+bug/759725).

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.