RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1011907 - 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
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-25 11:30 UTC by bfan
Modified: 2015-10-19 15:26 UTC (History)
3 users (show)

Fixed In Version: libguestfs-1.22.6-9.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 13:25:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description bfan 2013-09-25 11:30:47 UTC
Description of problem:
mount-loop failed to setup loop device: No such file or directory, test it against RHEL-7.0-20130919.0 tree.

 
Version-Release number of selected component (if applicable):
kernel 3.10.0-23.el7.x86_64
libguestfs-1.22.6-8.el7.x86_64
supermin-4.1.4-1.el7.x86_64
augeas-1.1.0-2.el7.x86_64
hivex-1.3.8-1.el7.x86_64
qemu-kvm-1.5.3-3.el7.x86_64
libvirt-1.1.1-6.el7.x86_64


How reproducible:
100%

 
Steps to Reproduce:
# guestfish -N fs
><fs> mount /dev/sda1 /
><fs> upload file.iso /file.iso
><fs> mkmountpoint /loop
><fs> ls /
file.iso
loop
lost+found

><fs> mount-loop /file.iso /loop
libguestfs: trace: mount_loop "/file.iso" "/loop"
guestfsd: main_loop: new request, len 0x44
mount -o loop /sysroot/file.iso /sysroot/loop
mount: /sysroot/file.iso: failed to setup loop device: No such file or directory
guestfsd: error: /file.iso on /loop: mount: /sysroot/file.iso: failed to setup loop device: No such file or directory
guestfsd: main_loop: proc 129 (mount_loop) took 0.03 seconds
libguestfs: trace: mount_loop = -1 (error)
libguestfs: error: mount_loop: /file.iso on /loop: mount: /sysroot/file.iso: failed to setup loop device: No such file or directory


Actual result:


Expect result:


Additional info:
I test RHEL-7.0-20130628.0 tree with all same libguestfs related packages,it works well. I'm not sure what effect it

Comment 1 Richard W.M. Jones 2013-09-25 11:45:00 UTC
Hmm .. kernel bug perhaps?  Does using the -v option provide
any more information?

Comment 2 Richard W.M. Jones 2013-09-25 11:48:52 UTC
It works for me on Fedora 19 / libguestfs 1.23.22, although
that doesn't really mean much.

Some other questions:

 - How was the ISO file prepared?  Perhaps the ISO is faulty.

 - Does the following command work on the host:
   mkdir /tmp/loop; mount -o loop file.iso /tmp/loop

Comment 4 Richard W.M. Jones 2013-09-26 08:09:23 UTC
I can reproduce this with:

kernel-3.10.0-29.el7.x86_64
libguestfs-1.22.6-8.el7.x86_64

The reproducer is:

$ mkdir /tmp/empty
$ genisoimage -o /tmp/test.iso /tmp/empty
$ guestfish -v -N fs -m /dev/sda1 upload /tmp/test.iso /test.iso : mkdir /loop : mount-loop /test.iso /loop

There's not very much information in the verbose output, in
particular no kernel error messages, just:

mount -o loop /sysroot/test.iso /sysroot/loop
mount: /sysroot/test.iso: failed to setup loop device: No such file or directory
guestfsd: error: /test.iso on /loop: mount: /sysroot/test.iso: failed to setup loop device: No such file or directory
libguestfs: error: mount_loop: /test.iso on /loop: mount: /sysroot/test.iso: failed to setup loop device: No such file or directory
libguestfs: closing guestfs handle 0x7f4e38a75bb0 (state 2)
guestfsd: main_loop: proc 129 (mount_loop) took 0.07 seconds
guestfsd: main_loop: new request, len 0x28

Comment 5 Richard W.M. Jones 2013-09-26 08:13:03 UTC
Same, in virt-rescue:

><rescue> mkdir /tmp/empty
><rescue> genisoimage -o /tmp/test.iso /tmp/empty
Total translation table size: 0
Total rockridge attributes bytes: 0
Total directory bytes: 0
Path table size(bytes): 10
Max brk space used 0
174 extents written (0 MB)
><rescue> mkdir /tmp/loop
><rescue> mount -o loop /tmp/test.iso /tmp/loop
mount: /tmp/test.iso: failed to setup loop device: No such file or directory

stracing the final command in virt-rescue shows the real error
is lack of /dev/loop devices:

readlink("/tmp", 0x7fffea3fe610, 4096)  = -1 EINVAL (Invalid argument)
readlink("/tmp/loop", 0x7fffea3fe610, 4096) = -1 EINVAL (Invalid argument)
readlink("/dev", 0x7fffea3fe610, 4096)  = -1 EINVAL (Invalid argument)
readlink("/run", 0x7fffea3fe610, 4096)  = -1 EINVAL (Invalid argument)
readlink("/sys", 0x7fffea3fe610, 4096)  = -1 EINVAL (Invalid argument)
readlink("/proc", 0x7fffea3fe610, 4096) = -1 EINVAL (Invalid argument)
stat("/dev/loop", 0x7fffea4005f0)       = -1 ENOENT (No such file or directory)
stat("/dev/loop0", 0x7fffea3ff540)      = -1 ENOENT (No such file or directory)
open("/sys/block/loop0/dev", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
readlink("/tmp", 0x7fffea3fe650, 4096)  = -1 EINVAL (Invalid argument)
readlink("/tmp/test.iso", 0x7fffea3fe650, 4096) = -1 EINVAL (Invalid argument)
open("/tmp/test.iso", O_RDWR|O_CLOEXEC) = 3
open("/dev/loop0", O_RDWR|O_CLOEXEC)    = -1 ENOENT (No such file or directory)
close(3)                                = 0
write(2, "mount: ", 7mount: )                  = 7
write(2, "/tmp/test.iso: failed to setup l"..., 42/tmp/test.iso: failed to setup loop device) = 42
write(2, ": ", 2: )                       = 2
write(2, "No such file or directory\n", 26No such file or directory
) = 26

><rescue> ls -l /dev/loop*
ls: cannot access /dev/loop*: No such file or directory
><rescue> ls -l /sys/block/loop*
ls: cannot access /sys/block/loop*: No such file or directory

Loading the kernel module explicitly makes it work:

><rescue> modprobe loop
[  159.545716] loop: module loaded
><rescue> mount -o loop /tmp/test.iso /tmp/loop

So the question would be why the kernel module needs to be
loaded explicitly or isn't loaded automatically?

Comment 6 Richard W.M. Jones 2013-09-26 10:00:07 UTC
kmod/systemd playing silly buggers again.  Here is the fix:

https://github.com/libguestfs/libguestfs/commit/e2895b19bb2be67c01172cdd0634553c21923605

Comment 8 bfan 2013-12-04 09:29:02 UTC
Verified with libguestfs-1.22.6-16.el7.x86_64

$ mkdir /tmp/empty
$ genisoimage -o /tmp/test.iso /tmp/empty
$ guestfish -v -N fs -m /dev/sda1 upload /tmp/test.iso /test.iso : mkdir /loop : mount-loop /test.iso /loop


Execute no error

Comment 9 Ludek Smid 2014-06-13 13:25:43 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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