Red Hat Bugzilla – Bug 1242853
mount-loop failed to setup loop device: No such file or directory
Last modified: 2016-11-03 13:54:30 EDT
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:
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.
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
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.
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