Bug 1011907
Summary: | mount-loop failed to setup loop device: No such file or directory | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | bfan |
Component: | libguestfs | Assignee: | Richard W.M. Jones <rjones> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.0 | CC: | bfan, leiwang, wshi |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | libguestfs-1.22.6-9.el7 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-06-13 13:25:43 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
bfan
2013-09-25 11:30:47 UTC
Hmm .. kernel bug perhaps? Does using the -v option provide any more information? 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 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 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? kmod/systemd playing silly buggers again. Here is the fix: https://github.com/libguestfs/libguestfs/commit/e2895b19bb2be67c01172cdd0634553c21923605 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 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. |