Bug 1242853 - mount-loop failed to setup loop device: No such file or directory
Summary: mount-loop failed to setup loop device: No such file or directory
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.2
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Keywords:
Depends On: 1165785 1218766
Blocks: 1288337 1301891
TreeView+ depends on / blocked
 
Reported: 2015-07-14 09:25 UTC by Hu Zhang
Modified: 2016-11-03 17:54 UTC (History)
7 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2016-11-03 17:54:30 UTC


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2576 normal SHIPPED_LIVE Moderate: libguestfs and virt-p2v security, bug fix, and enhancement update 2016-11-03 12:06:51 UTC

Description Hu Zhang 2015-07-14 09:25:35 UTC
Description of problem:
"mount-loop" fails to mount a filesystem image. It returns "failed to setup loop device: No such file or directory". Same as Bug 1011907.

Version-Release number of selected component (if applicable):
kernel-3.10.0-290.el7.x86_64
libguestfs-1.28.1-1.46.el7.x86_64
libguestfs-winsupport-7.2-1.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1. # qemu-img create test-loop.raw 100M
   # qemu-img create test.raw 500M

2. # guestfish -a test-loop.raw
   ><fs> part-disk /dev/sda mbr
   ><fs> mkfs ext3 /dev/sda
   ><fs> mount /dev/sda /
   ><fs> exit

3. # guestfish -a test.raw -vx
   ><fs> part-disk /dev/sda mbr
   ><fs> mkfs ext3 /dev/sda1
   ><fs> mount /dev/sda /
   ><fs> upload /path/to/test-loop.raw /test-loop.raw
   ><fs> mkmountpoint /loop
   ><fs> mount-loop /test-loop.raw /loop/
  
Actual results:
In step 3,
><fs> mount-loop /test-loop.raw /loop/
libguestfs: trace: mount_loop "/test-loop.raw" "/loop/"
guestfsd: error: /test-loop.raw on /loop/: mount: /sysroot/test-loop.raw: failed to setup loop device: No such file or directory
libguestfs: trace: mount_loop = -1 (error)
libguestfs: error: mount_loop: /test.raw on /loop/: mount: /sysroot/test-loop.raw: failed to setup loop device: No such file or directory

Expected results:
In step 3, mount-loop can mount the image to the mount point successfully.

Additional info:

Comment 2 Richard W.M. Jones 2015-07-14 09:55:06 UTC
This works if you run:

><fs> modprobe loop
><fs> mount-loop /test-loop.raw /loop

It probably means we are missing a udev rule somewhere.

I can only reproduce the bug on RHEL 7.2, not on Fedora.

Comment 3 Pino Toscano 2015-10-19 13:22:17 UTC
This is basically the RHEL version of bug #1165785.

The fix (commit 3dabc7a7bae709e884b56e297e7ece222e653d0c) is part of libguestfs >= 1.29.9, and thus it will be picked by the rebase (bug #1218766).

I just sent the small instructions this bug as regression test case, so we can check this keeps working:
  https://www.redhat.com/archives/libguestfs/2015-October/msg00198.html

Comment 7 Xianghua Chen 2016-06-28 05:50:02 UTC
Verified with the packages:
libguestfs-1.32.5-6.el7.x86_64

Verify steps:
1. # qemu-img create test-loop.raw 100M
   # qemu-img create test.raw 500M

2. # guestfish -a test-loop.raw
   ><fs> part-disk /dev/sda mbr
   ><fs> mkfs ext3 /dev/sda
   ><fs> mount /dev/sda /
   ><fs> exit

3. # guestfish -a test.raw 
   ><fs> part-disk /dev/sda mbr
   ><fs> mkfs ext3 /dev/sda
   ><fs> mount /dev/sda /
   ><fs> upload /path/to/test-loop.raw /test-loop.raw
   ><fs> mkmountpoint /loop
   ><fs> mount-loop /test-loop.raw /loop/

Commands finished successfully.

So Verified.

Comment 9 errata-xmlrpc 2016-11-03 17:54:30 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.

https://rhn.redhat.com/errata/RHSA-2016-2576.html


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