Bug 7499

Summary: 3_a1: no /dev/loopX created
Product: Mageia Reporter: Bit Twister <bittwister2>
Component: RPM PackagesAssignee: Colin Guthrie <mageia>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: Normal CC: thierry.vignaud
Version: Cauldron   
Target Milestone: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Source RPM: systemd-189-5.mga3.src.rpm CVE:
Status comment:

Description Bit Twister 2012-09-17 02:10:18 CEST
Description of problem:

No /dev/loopX created. Only /dev/loop-control is created.

Version-Release number of selected component (if applicable):


How reproducible: Always


Steps to Reproduce:
1. Clean install Mageia-3-alpha1-x86_64-DVD.iso all updates applied, default runlevel is 3.
2. ls -al /dev/loop?

Also no /dev/loop? in a 64 bit VirtualBox guest.
Comment 1 Thierry Vignaud 2012-09-17 16:24:49 CEST
Those are auto created when loading loop, which eg happens on running "mount -o loop ..."

CC: (none) => thierry.vignaud
Assignee: bugsquad => mageia
Source RPM: (none) => systemd

Comment 2 Bit Twister 2012-09-17 17:25:57 CEST
(In reply to comment #1)
> Those are auto created when loading loop, which eg happens on running "mount -o
> loop ..."

I wondered why my restore backup from iso script failed then worked later on the initial alpha1 release.

I assume this command is supposed to work:
# mount -t auto -o ro,loop=/dev/loop0 dvd.iso /dvd

mount: /local/spare/Mageia-3-alpha1-x86_64-DVD.iso: failed to setup loop device: No such file or directory

# ls -ald /dvd
drwxr-xr-x 2 root root 4096 Sep 16 14:50 /dvd

# ls -ald dvd.iso
lrwxrwxrwx 1 root 1516 30 Sep  7 16:52 dvd.iso -> Mageia-3-alpha1-x86_64-DVD.iso

# ls -ald Mageia-3-alpha1-x86_64-DVD.iso
-rw-rw-r-- 1 1500 1516 3782213632 Sep  7 13:47 Mageia-3-alpha1-x86_64-DVD.iso

# ls /dev/loop*
/dev/loop-control

Source RPM: systemd => systemd-189-5.mga3.src.rpm

Comment 3 Thierry Vignaud 2012-09-17 18:08:19 CEST
Humm I remember in the old days I used to precreate /dev/loop for devfs but I don't maintain that part now => Colin?
Comment 4 Bit Twister 2012-09-17 19:19:49 CEST
(In reply to comment #3)
> Humm I remember in the old days I used to precreate /dev/loop for devfs

As an attempted workaround, I tried
    mknod /dev/loop0 c 7 0
    chown root:disk /dev/loop0
but it still would not mount.
Comment 5 Colin Guthrie 2012-09-17 19:23:00 CEST
The problem is trying to specify a specific loop device without first pre-creating it, but it should work fine if you give less info:

[root@jimmy ~]# ll /dev/loop*
crw------- 1 root root 10, 237 Sep 15 15:05 /dev/loop-control
[root@jimmy ~]# mkdir iso
[root@jimmy ~]# mount -t auto -o ro,loop=/dev/loop0 /home/colin/Download/boot.iso ~/iso
mount: /home/colin/Download/boot.iso: failed to setup loop device: No such file or directory

So the same error as you get but if you don't specify the specific loop device to use, it all works fine:

[root@jimmy ~]# mount -t auto -o ro,loop /home/colin/Download/boot.iso ~/iso
[root@jimmy ~]# ls iso
isolinux/  VERSION
[root@jimmy ~]# umount iso
[root@jimmy ~]# ll /dev/loop*
brw-rw---- 1 root disk  7,   0 Sep 17 18:18 /dev/loop0
brw-rw---- 1 root disk  7,   1 Sep 17 18:18 /dev/loop1
brw-rw---- 1 root disk  7,   2 Sep 17 18:18 /dev/loop2
brw-rw---- 1 root disk  7,   3 Sep 17 18:18 /dev/loop3
brw-rw---- 1 root disk  7,   4 Sep 17 18:18 /dev/loop4
brw-rw---- 1 root disk  7,   5 Sep 17 18:18 /dev/loop5
brw-rw---- 1 root disk  7,   6 Sep 17 18:18 /dev/loop6
brw-rw---- 1 root disk  7,   7 Sep 17 18:18 /dev/loop7
crw------- 1 root root 10, 237 Sep 17 18:18 /dev/loop-control




Essentially the loop module is loaded, it automatically creates several loop devices, but by specifying the loop device to use in the mount command, it seems to suppress the loading of the loop module because it assumes that by giving the file to use, you've already got it loaded (that's my guess anyway).

Is there anything here we really need to fix? If so, I suspect the extent of any fix is just to modprobe "loop" at some early stage.
Comment 6 Bit Twister 2012-09-18 01:54:37 CEST
(In reply to comment #5)

> Essentially the loop module is loaded, it automatically creates several loop
> devices, but by specifying the loop device to use in the mount command, it
> seems to suppress the loading of the loop module because it assumes that by
> giving the file to use, you've already got it loaded (that's my guess anyway).
>
> Is there anything here we really need to fix?

56,000+ hits found with google showing loop=/dev/loop0.  :-D

There is some other hanky panky going on. Powered up my test box and tried without loop0, everything works. Deleted /dev/loop?. Tried again and it is broke. Rebooted, tried with loop0, failed, tried with loop and still failed.
Rebooted works fine with loop. 

> If so, I suspect the extent of
> any fix is just to modprobe "loop" at some early stage.

That is a cheap fix but I disliked the "feature" that if /dev/loop? are missing, loop module does work after using a loop=/dev/loop0 first.
That would seem to be a hindrance if you wanted to automate testing of the loop module. :(
Comment 7 Colin Guthrie 2013-06-14 00:51:18 CEST
So I'm going to close this as wontfix. I think that we just have to accept that the loop module needs to be loaded if you want to use loop nodes statically. 

Otherwise, just use -o loop in mount commands and let it manage it for you.

Don't think we'd gain anything significant by shipping a static modprobe.conf snippet to always load the loop module.

If there is a practical bug that is caused by this (rather than just a command that has a more up-to-date equiv which doesn't work unless the module is loaded - lots of things don't work without the appropriate module loaded :D)

Status: NEW => RESOLVED
Resolution: (none) => WONTFIX